diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-16 07:28:18 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-16 07:28:18 +0000 |
commit | 968a51a442059feb4faabbec018970c7cc29a391 (patch) | |
tree | 67da871aeda59d242fec5c2d8ff2b5f60483c688 /includes | |
parent | 72fc8dbc984723ac7de46c4f17beacf9034a7398 (diff) | |
download | brdo-968a51a442059feb4faabbec018970c7cc29a391.tar.gz brdo-968a51a442059feb4faabbec018970c7cc29a391.tar.bz2 |
#72674 by kkaefer. Make adding menu items for local tasks not interfere with the local task.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/menu.inc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index 65e0a4f5d..7510599e4 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -1101,8 +1101,13 @@ function _menu_build() { if ($old_mid < 0) { // It had a temporary ID, so use a permanent one. $_menu['items'][$item->mid] = $_menu['items'][$old_mid]; - unset($_menu['items'][$old_mid]); - $_menu['path index'][$item->path] = $item->mid; + if ($_menu['items'][$item->mid]['type'] & $item->type) { + // If the item is of the same type, delete the old item. + unset($_menu['items'][$old_mid]); + $_menu['path index'][$item->path] = $item->mid; + } + // The new menu item gets all the custom type flags from the database + $_menu['items'][$item->mid]['type'] &= $item->type; } else { // It has a permanent ID. Only replace with non-custom menu items. @@ -1258,6 +1263,11 @@ function _menu_append_contextual_items() { $_menu['items'][$mid]['callback arguments'] = $item['callback arguments']; } } + if ($item['type'] & MENU_LOCAL_TASK && !($_menu['items'][$mid]['type'] & MENU_LOCAL_TASK)) { + // A local task is in the menu table and the path is already present + $_menu['items'][$mid]['type'] = MENU_LOCAL_TASK; + $new_items[$mid] = $item; + } } } |