I created once the same module
there is an additional feature: the local tasks are also weighted
http://www.drupalcenter.de/files/category_weight.tar_0.gz

Important it uses a custom theme function for phptemplate_user_profile

CommentFileSizeAuthor
#9 manage_profile.tar_.gz21.85 KBnkanand4
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hanoii’s picture

I was aware of that, and that it might be an useful feature as well.

It's pity you haven't contributed your module before. I'll definetely give it a look. Can I take/copy ideas from your module? I just give it a very rough look. I saw the phptemplate function, I don't like to have the phptemplate_ function inside the module because if some theme already override that one it would throw a fatal error, though it can be stated in a readme file and as a separate template.php example file kind of how CCK does it if you'd like to theme fields.

Thanks!
a.=

dawehner’s picture

sure you can copy it, i could write a test, because this module can break very fast

I thought that so small modules aren't good to publish, so ...

EgonO’s picture

i hope the weight of the local tasks is realizable without the use of uses a custom theme function...

dawehner’s picture

sure this is only for displaying the categoryies weighted on the user profile page

but the weighted local tasks works perfect without this "hack"

EgonO’s picture

ok, sorry, i meant the profile categories - but after looking upon the profile_categories() function the weight of the profile categories is hardcoded in D4-D7...

dawehner’s picture

year therefore is my theme function

i think in drupal6 you could use hook_theme and hook_preprocess_hook for it, but i'm not sure

hanoii’s picture

I gave both thoughts and a proper look to the code you submitted.

I have some doubts about the local tasks feature. I have already thought of this when I did the module but I knew I'll encounter some problems.

First of all I tried to work out this module as general as possible, so it's only working to the profile categories but to rather any category appearing in the user registration page (even those available by other modules, such as simplenews).

So something similar should be done for the local tasks. I could user _user_categories() or the actual hook_user to retrieve categories for the local tasks but I will face the problem on overriding menu items that I really shouldn't, probably messing with menu items I won't know the proper 'access' or the actual callback.

The technique you are using to override menu items with the new weight configuration is fine, but you are creating an item of your own, very similar to what the user.module creates so everything is still working as expected, but I can't be aware of every local task that might be added to the user/#/edit screen by any other module. Not sure if I am being clear with this, probably not :). I worked to day a little trying to come up with a more 'general' solution that could fit nicely but I haven't found one yet.

For sure there's something missing close to hook_menu_alter in drupal 6.

I also tried to see if the menu items were already there somewhere so I can pull menu item information from somewhere but it couldn't find any yet. The function menu_get_item() doesn't seem to work although my module is definitely being called after all the others. That's probably because non cacheable menu items are added to the menu structure sometime after all hook_menu are called...

Thanks,
a.=

hanoii’s picture

Just to let you know that D6 version, just released. support local tasks ordering.

nkanand4’s picture

FileSize
21.85 KB

Here is another module.
This module provides the capabilities of renaming different profile categories and also reordering them.

Choose your own order of displaying different "category" fieldsets on the registration page. The setting page is located at http://www.yoursite.com/admin/user/profile_reorder

Added jquery sortable to provide the ease of re-ordering the categories, and also added double-click event on the category name which allows you to rename them. This module depends on core "profile" module. I am now working on ordering the tabs as well.

Please notify if you find a bug in it.

Babalu’s picture

subscribing D6

hanoii’s picture

Status: Active » Closed (won't fix)

This feature is available in the D6 version of the module and I don't think it can be backported in any way into the D5 branch