Hello everybody.
I am kinda new to Drupal, so I appologize in advance if my question seems stupid, but I have not found any other post which helped, nor succeeded in solving this problem myself by hacking the core module.
The thing is I am developing a new where I need to change the way the User module displays it's data. I am using the hook_form_alter() and hook_user() hooks to catch the events I need and change the way forms are displayed (i.e add/remove fields to them), but I also need to change the menu hierarchy...!
I want to change the menus so that the View tab (local task) would not appear, since I have no need for it, and to add other tabs which I do need.
I looked for a hook_menu_alter(), but there is no such function. The closest I found was hook_link_alter() but that didn't solve my problem. Thinking about it, I decided to create such a hook, and added the following code to the user.module file just before thereturn $items;
at end of the user_menu() hook function:
// allow altering the module's menus
foreach (module_implements('menu_alter') as $module) {
$function = $module .'_menu_alter';
$function( 'user', $items );
}
Then, I created the following function in my code to try changing the menu:
<?php
/**
* Catch User's menus and alter them.