Hello
I have some funtionality in my module, where I need to remove the local tasks of another modules (for example "Revisions" tab). I've searched across drupal.org and google and didn't found any idea how to override another modules' tabs from module (but found planty of implementations with theme system). I've tried to do my own, but didn't found any way to do it without changes in the core.
I know that situation is chenged in Drupal6, but I can't leave D5 vranch unsupported, so I've prepared the tinny patch which makes possible to override menu items from 3-rd party module.
After applying this patch, if you want to owerride some menu items, you just need to create the same item in your hook_menu() and make it MENU_CREATED_BY_ADMIN.
Thanks beforehead for your review :)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | menu.inc_.patch | 638 bytes | neochief |
| menu.inc_.patch | 90 KB | neochief |
Comments
Comment #1
neochief commentedOh, sorry, wrong one. Here is the patch:
Comment #2
Anonymous (not verified) commentedThe way I accomplish this is to ensure the weight of my module is lower than the module whose menu items I wish to replace and then in my menu hook, I replace the menu path with my own version of the item.
Comment #3
neochief commentedNice idea, earnie. But what to do if I already made my module's weight little heavier (for instance, for correct hook_form_alter() overrides)? Create another module? :)
Comment #4
Anonymous (not verified) commentedWhy not create another module? And make that module dependent on the primary module. And in the primary module give a status message that says the secondary module needs to be activated if it isn't already.
Comment #5
neochief commentedYes, I can do it. And I do it in most of my projects :)
But why I need to do it all over the time, if there is a simplier way with this patch?
Comment #6
tr commentedhook_menu_alter() was introduced in D6 for this purpose.
As 5.x is no longer supported, I'm marking this issue as won't fix.
Comment #7
johanneshahn commentedhi,u can try hook_menu_alter and override the path file/%node/download which calls file_serve
sorry wrong thread