Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.362 diff -u -p -r1.362 menu.inc --- includes/menu.inc 11 Nov 2009 08:28:50 -0000 1.362 +++ includes/menu.inc 13 Nov 2009 02:07:28 -0000 @@ -162,7 +162,7 @@ define('MENU_SUGGESTED_ITEM', MENU_VISIB * parent item. An example is the path "node/52/edit", which performs the * "edit" task on "node/52". */ -define('MENU_LOCAL_TASK', MENU_IS_LOCAL_TASK); +define('MENU_LOCAL_TASK', MENU_IS_LOCAL_TASK | MENU_VISIBLE_IN_BREADCRUMB); /** * Menu type -- The "default" local task, which is initially active. @@ -170,7 +170,7 @@ define('MENU_LOCAL_TASK', MENU_IS_LOCAL_ * Every set of local tasks should provide one "default" task, that links to the * same path as its parent when clicked. */ -define('MENU_DEFAULT_LOCAL_TASK', MENU_IS_LOCAL_TASK | MENU_LINKS_TO_PARENT); +define('MENU_DEFAULT_LOCAL_TASK', MENU_IS_LOCAL_TASK | MENU_LINKS_TO_PARENT | MENU_VISIBLE_IN_BREADCRUMB); /** * Menu type -- An action specific to the parent, usually rendered as a link. @@ -178,7 +178,7 @@ define('MENU_DEFAULT_LOCAL_TASK', MENU_I * Local actions are menu items that describe actions on the parent item such * as adding a new user, taxonomy term, etc. */ -define('MENU_LOCAL_ACTION', MENU_IS_LOCAL_TASK | MENU_IS_LOCAL_ACTION); +define('MENU_LOCAL_ACTION', MENU_IS_LOCAL_TASK | MENU_IS_LOCAL_ACTION | MENU_VISIBLE_IN_BREADCRUMB); /** * @} End of "Menu item types". @@ -2287,12 +2287,14 @@ function menu_get_router() { * Builds a link from a router item. */ function _menu_link_build($item) { - if ($item['type'] == MENU_CALLBACK) { - $item['hidden'] = -1; - } - elseif ($item['type'] == MENU_SUGGESTED_ITEM) { + // Suggested items are hidden in terms of disabled by default. + if ($item['type'] == MENU_SUGGESTED_ITEM) { $item['hidden'] = 1; } + // Hide any other items that are not visible in the tree (MENU_NORMAL_ITEM). + elseif (!($item['type'] & MENU_VISIBLE_IN_TREE)) { + $item['hidden'] = -1; + } // Note, we set this as 'system', so that we can be sure to distinguish all // the menu links generated automatically from entries in {menu_router}. $item['module'] = 'system'; @@ -2607,9 +2609,8 @@ function menu_link_save(&$item) { $item['menu_name'] = $parent['menu_name']; } $menu_name = $item['menu_name']; - // Menu callbacks need to be in the links table for breadcrumbs, but can't - // be parents if they are generated directly from a router item. - if (empty($parent['mlid']) || $parent['hidden'] < 0) { + // If no corresponding parent link was found, move the link to the top-level. + if (empty($parent['mlid'])) { $item['plid'] = 0; } else {