Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.333 diff -u -p -r1.333 menu.inc --- includes/menu.inc 11 Aug 2009 17:26:33 -0000 1.333 +++ includes/menu.inc 13 Aug 2009 13:13:28 -0000 @@ -113,6 +113,11 @@ define('MENU_CREATED_BY_ADMIN', 0x0040); define('MENU_IS_LOCAL_TASK', 0x0080); /** + * Internal menu flag -- menu item is a local action. + */ +define('MENU_IS_LOCAL_ACTION', 0x0100); + +/** * @} End of "Menu flags". */ @@ -168,6 +173,14 @@ define('MENU_LOCAL_TASK', MENU_IS_LOCAL_ define('MENU_DEFAULT_LOCAL_TASK', MENU_IS_LOCAL_TASK | MENU_LINKS_TO_PARENT); /** + * Menu type -- An action specific to the parent, usually rendered as a link. + * + * 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); + +/** * @} End of "Menu item types". */ @@ -1443,14 +1456,17 @@ function menu_navigation_links($menu_nam * The level of tasks you ask for. Primary tasks are 0, secondary are 1. * @param $return_root * Whether to return the root path for the current page. + * @param $type_match + * Required value, when matched with MENU_IS_LOCAL_ACTION. Practically + * 0 or MENU_IS_LOCAL_ACTION. * @return * Themed output corresponding to the tabs of the requested level, or * router path if $return_root == TRUE. This router path corresponds to * a parent tab, if the current page is a default local task. */ -function menu_local_tasks($level = 0, $return_root = FALSE) { - $tabs = &drupal_static(__FUNCTION__); - $root_path = &drupal_static(__FUNCTION__ . ':root_path'); +function menu_local_tasks($level = 0, $return_root = FALSE, $type_match = 0) { + $tabs = &drupal_static(__FUNCTION__ . ':' . $type_match); + $root_path = &drupal_static(__FUNCTION__ . ':root_path:' . $type_match); if (!isset($tabs)) { $tabs = array(); @@ -1472,6 +1488,10 @@ function menu_local_tasks($level = 0, $r $root_path = $router_item['path']; foreach ($result as $item) { + if (($item['type'] & MENU_IS_LOCAL_ACTION) != $type_match) { + // Filter for items which are either actions or just actions. + continue; + } _menu_translate($item, $map, TRUE); if ($item['tab_parent']) { // All tabs, but not the root page. @@ -1565,6 +1585,10 @@ function menu_local_tasks($level = 0, $r if ($return_root) { return $root_path; } + elseif ($type_match) { + // Always return output when asking for specific type. + return $tabs[$level]['output']; + } else { // We do not display single tabs. return (isset($tabs[$level]) && $tabs[$level]['count'] > 1) ? $tabs[$level]['output'] : ''; @@ -1586,6 +1610,13 @@ function menu_secondary_local_tasks() { } /** + * Returns the rendered local actions at the current level. + */ +function menu_local_actions() { + return menu_local_tasks(0, FALSE, MENU_IS_LOCAL_ACTION); +} + +/** * Returns the router path, or the path of the parent tab of a default local task. */ function menu_tab_root_path() { Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.195 diff -u -p -r1.195 menu.module --- modules/menu/menu.module 20 Jul 2009 18:51:33 -0000 1.195 +++ modules/menu/menu.module 13 Aug 2009 13:13:28 -0000 @@ -65,7 +65,7 @@ function menu_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('menu_edit_menu', 'add'), 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_ACTION, ); $items['admin/structure/menu/settings'] = array( 'title' => 'Settings', @@ -94,7 +94,7 @@ function menu_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('menu_edit_item', 'add', NULL, 3), 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_ACTION, ); $items['admin/structure/menu-customize/%menu/edit'] = array( 'title' => 'Edit menu', Index: themes/seven/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/page.tpl.php,v retrieving revision 1.1 diff -u -p -r1.1 page.tpl.php --- themes/seven/page.tpl.php 31 Jul 2009 19:35:57 -0000 1.1 +++ themes/seven/page.tpl.php 13 Aug 2009 13:13:28 -0000 @@ -33,6 +33,7 @@ +