summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/menu.inc182
-rw-r--r--modules/aggregator.module7
-rw-r--r--modules/aggregator/aggregator.module7
-rw-r--r--modules/archive.module2
-rw-r--r--modules/archive/archive.module2
-rw-r--r--modules/block.module2
-rw-r--r--modules/block/block.module2
-rw-r--r--modules/filter.module4
-rw-r--r--modules/filter/filter.module4
-rw-r--r--modules/menu.module3
-rw-r--r--modules/menu/menu.module3
-rw-r--r--modules/node.module22
-rw-r--r--modules/node/node.module22
-rw-r--r--modules/path.module5
-rw-r--r--modules/path/path.module5
-rw-r--r--modules/profile.module2
-rw-r--r--modules/profile/profile.module2
-rw-r--r--modules/search.module2
-rw-r--r--modules/search/search.module2
-rw-r--r--modules/taxonomy.module2
-rw-r--r--modules/taxonomy/taxonomy.module2
-rw-r--r--modules/user.module38
-rw-r--r--modules/user/user.module38
23 files changed, 204 insertions, 156 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 33429c89b..9e9e2b5f9 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -7,6 +7,8 @@
*/
/**
+ * @name Menu Flags
+ * @{
* Flags for use in the "type" attribute of menu items.
*/
define('MENU_IS_ROOT', 0x0001);
@@ -18,6 +20,17 @@ define('MENU_MODIFIED_BY_ADMIN', 0x0020);
define('MENU_CREATED_BY_ADMIN', 0x0040);
define('MENU_IS_LOCAL_TASK', 0x0080);
define('MENU_IS_LOCAL_SUBTASK', 0x0100);
+define('MENU_LINKS_TO_PARENT', 0x0200);
+/**
+ * @}
+ */
+
+/**
+ * @name Menu Item Types
+ * @{
+ * Menu item definitions provide one of these constants, which are shortcuts for
+ * combinations of the above flags.
+ */
/**
* Normal menu items show up in the menu tree and can be moved/hidden by
@@ -59,6 +72,12 @@ define('MENU_LOCAL_TASK', MENU_IS_LOCAL_TASK);
define('MENU_LOCAL_SUBTASK', MENU_IS_LOCAL_SUBTASK);
/**
+ * 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);
+
+/**
* Custom items are those defined by the administrator.
*/
define('MENU_CUSTOM_ITEM', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB | MENU_CREATED_BY_ADMIN | MENU_MODIFIABLE_BY_ADMIN);
@@ -69,11 +88,20 @@ define('MENU_CUSTOM_ITEM', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB | M
define('MENU_CUSTOM_MENU', MENU_IS_ROOT | MENU_VISIBLE_IN_TREE | MENU_CREATED_BY_ADMIN | MENU_MODIFIABLE_BY_ADMIN);
/**
+ * @}
+ */
+
+/**
+ * @name Menu status codes
+ * @{
* Status codes for menu callbacks.
*/
define('MENU_FOUND', 1);
define('MENU_NOT_FOUND', 2);
define('MENU_ACCESS_DENIED', 3);
+/**
+ * @}
+ */
/**
* Return the menu data structure.
@@ -127,7 +155,11 @@ function menu_get_local_tasks() {
// _menu_build_local_tasks() may indirectly call this function, so prevent
// infinite loops.
$_menu['local tasks'] = array();
- _menu_build_local_tasks();
+ $pid = menu_get_active_nontask_item();
+ if (!_menu_build_local_tasks($pid)) {
+ // If the build returned FALSE, the tasks need not be displayed.
+ $_menu['local tasks'][$pid]['children'] = array();
+ }
}
return $_menu['local tasks'];
@@ -265,6 +297,20 @@ function menu_set_active_item($path = NULL) {
$path = substr($path, 0, strrpos($path, '/'));
}
$stored_mid = array_key_exists($path, $menu['path index']) ? $menu['path index'][$path] : 0;
+
+ // Search for default local tasks to activate instead of this item.
+ $continue = TRUE;
+ while ($continue) {
+ $continue = FALSE;
+ if (array_key_exists('children', $menu['items'][$stored_mid])) {
+ foreach ($menu['items'][$stored_mid]['children'] as $cid) {
+ if ($menu['items'][$cid]['type'] & MENU_LINKS_TO_PARENT) {
+ $stored_mid = $cid;
+ $continue = TRUE;
+ }
+ }
+ }
+ }
}
return $stored_mid;
@@ -289,24 +335,6 @@ function menu_get_active_nontask_item() {
}
/**
- * Returns the ID of the current menu item or, if the current item is a
- * local task or subtask, the ID of the current local task (not subtask).
- */
-function menu_get_active_local_task() {
- $menu = menu_get_menu();
- $mid = menu_get_active_item();
-
- // Find the first non-task item:
- while ($mid && ($menu['items'][$mid]['type'] & MENU_LOCAL_SUBTASK)) {
- $mid = $menu['items'][$mid]['pid'];
- }
-
- if ($mid) {
- return $mid;
- }
-}
-
-/**
* Returns the title of the active menu item.
*/
function menu_get_active_title() {
@@ -346,7 +374,7 @@ function menu_get_active_breadcrumb() {
$links[] = l(t('Home'), '');
- $trail = _menu_get_trail($_GET['q']);
+ $trail = _menu_get_active_trail();
foreach ($trail as $mid) {
if ($menu['items'][$mid]['type'] & MENU_VISIBLE_IN_BREADCRUMB) {
$links[] = theme('menu_item', $mid);
@@ -363,11 +391,7 @@ function menu_get_active_breadcrumb() {
* Returns true when the menu item is in the active trail.
*/
function menu_in_active_trail($mid) {
- static $trail;
-
- if (empty($trail)) {
- $trail = _menu_get_trail($_GET['q']);
- }
+ $trail = _menu_get_active_trail();
return in_array($mid, $trail);
}
@@ -457,7 +481,12 @@ function theme_menu_tree($pid = 1, $all = FALSE) {
function theme_menu_item($mid) {
$menu = menu_get_menu();
- return l($menu['items'][$mid]['title'], $menu['items'][$mid]['path']);
+ $link_mid = $mid;
+ while ($menu['items'][$link_mid]['type'] & MENU_LINKS_TO_PARENT) {
+ $link_mid = $menu['items'][$link_mid]['pid'];
+ }
+
+ return l($menu['items'][$mid]['title'], $menu['items'][$link_mid]['path']);
}
/**
@@ -466,17 +495,18 @@ function theme_menu_item($mid) {
*/
function theme_menu_local_tasks() {
$local_tasks = menu_get_local_tasks();
+ $pid = menu_get_active_nontask_item();
$output = '';
- if (count($local_tasks[0]['children'])) {
+ if (count($local_tasks[$pid]['children'])) {
$output .= "<ul class=\"tabs primary\">\n";
- foreach ($local_tasks[0]['children'] as $mid) {
- $output .= theme('menu_local_task', $mid, $mid == menu_get_active_local_task());
+ foreach ($local_tasks[$pid]['children'] as $mid) {
+ $output .= theme('menu_local_task', $mid, menu_in_active_trail($mid));
}
$output .= "</ul>\n";
- foreach ($local_tasks[0]['children'] as $mid) {
- if ($mid == menu_get_active_local_task() && count($local_tasks[$mid]['children'])) {
+ foreach ($local_tasks[$pid]['children'] as $mid) {
+ if (menu_in_active_trail($mid) && count($local_tasks[$mid]['children'])) {
$output .= "<ul class=\"tabs secondary\">\n";
foreach ($local_tasks[$mid]['children'] as $cid) {
$output .= theme('menu_local_task', $cid, menu_in_active_trail($cid));
@@ -509,28 +539,24 @@ function theme_menu_local_task($mid, $active) {
/** @} End of addtogroup themeable */
/**
- * Returns an array with the menu items that lead to the specified path.
+ * Returns an array with the menu items that lead to the current menu item.
*/
-function _menu_get_trail($path) {
- $menu = menu_get_menu();
+function _menu_get_active_trail() {
+ static $trail;
- $trail = array();
+ if (!isset($trail)) {
+ $menu = menu_get_menu();
- // Find the ID of the given path.
- while ($path && !array_key_exists($path, $menu['path index'])) {
- $path = substr($path, 0, strrpos($path, '/'));
- }
- if (!array_key_exists($path, $menu['path index'])) {
- return array();
- }
- $mid = $menu['path index'][$path];
+ $trail = array();
- // Follow the parents up the chain to get the trail.
- while ($mid && $menu['items'][$mid]) {
- array_unshift($trail, $mid);
- $mid = $menu['items'][$mid]['pid'];
- }
+ $mid = menu_get_active_item();
+ // Follow the parents up the chain to get the trail.
+ while ($mid && $menu['items'][$mid]) {
+ array_unshift($trail, $mid);
+ $mid = $menu['items'][$mid]['pid'];
+ }
+ }
return $trail;
}
@@ -721,50 +747,42 @@ function _menu_build_visible_tree($pid = 0) {
*
* Since this is only for display, we only need title, path, and children
* for each item.
+ *
+ * At the close of this function, $_menu['local tasks'] is populated with the
+ * menu items in the local task tree.
+ *
+ * @return
+ * TRUE if the local task tree is forked. It does not need to be displayed
+ * otherwise.
*/
-function _menu_build_local_tasks() {
+function _menu_build_local_tasks($pid) {
global $_menu;
- $tasks = array();
- $tasks[0] = array('children' => array());
+ $forked = FALSE;
- $mid = menu_get_active_nontask_item();
- if ($mid) {
- // Find top-level tasks
- if ($children = $_menu['items'][$mid]['children']) {
- foreach ($children as $cid) {
- if (($_menu['items'][$cid]['type'] & MENU_IS_LOCAL_TASK) && _menu_item_is_accessible($cid)) {
- $tasks[$cid] = array('title' => $_menu['items'][$cid]['title'], 'path' => $_menu['items'][$cid]['path'], 'children' => array());
- $tasks[0]['children'][] = $cid;
+ if (isset($_menu['items'][$pid])) {
+ $parent = $_menu['items'][$pid];
+
+ $children = array();
+ if (array_key_exists('children', $parent)) {
+ foreach ($parent['children'] as $mid) {
+ if (($_menu['items'][$mid]['type'] & MENU_IS_LOCAL_TASK) && _menu_item_is_accessible($mid)) {
+ $children[] = $mid;
+ // Beware short-circuiting || operator!
+ $forked = _menu_build_local_tasks($mid) || $forked;
}
}
}
- usort($tasks[0]['children'], '_menu_sort');
-
- $tasks[$mid] = array('title' => $_menu['items'][$mid]['title'], 'path' => $_menu['items'][$mid]['path'], 'children' => array());
- array_unshift($tasks[0]['children'], $mid);
-
- // Find subtasks
- foreach ($tasks[0]['children'] as $mid) {
- if ($children = $_menu['items'][$mid]['children']) {
- foreach ($children as $cid) {
- if (($_menu['items'][$cid]['type'] & MENU_IS_LOCAL_SUBTASK) && _menu_item_is_accessible($cid)) {
- $tasks[$cid] = array('title' => $_menu['items'][$cid]['title'], 'path' => $_menu['items'][$cid]['path'], 'children' => array());
- $tasks[$mid]['children'][] = $cid;
- }
- }
- }
- usort($tasks[$mid]['children'], '_menu_sort');
+ usort($children, '_menu_sort');
+ $forked = $forked || count($children) > 1;
+
+ $_menu['local tasks'][$pid] = array('title' => $parent['title'], 'path' => $parent['path'], 'children' => $children);
+ foreach ($children as $mid) {
+ $_menu['local tasks'][$mid]['pid'] = $pid;
}
}
- if (count($tasks) > 2) {
- $_menu['local tasks'] = $tasks;
- }
- else {
- $_menu['local tasks'] = array();
- $_menu['local tasks'][0] = array('children' => array());
- }
+ return $forked;
}
?>
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 8d3f0d6fd..7a8983c78 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -129,7 +129,8 @@ function aggregator_menu() {
'callback' => 'aggregator_admin_refresh_feed', 'access' => $edit,
'type' => MENU_CALLBACK);
- // Tabs:
+ $items[] = array('path' => 'admin/aggregator/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/aggregator/add/feed', 'title' => t('add feed'),
'callback' => 'aggregator_admin_edit_feed', 'access' => $edit,
'type' => MENU_LOCAL_TASK);
@@ -159,6 +160,8 @@ function aggregator_menu() {
while ($feed = db_fetch_object($result)) {
$items[] = array('path' => 'aggregator/sources/'. $feed->fid, 'title' => $feed->title,
'callback' => 'aggregator_page_source', 'access' => $view);
+ $items[] = array('path' => 'aggregator/sources/'. $feed->fid .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'aggregator/sources/'. $feed->fid .'/categorize', 'title' => t('categorize'),
'callback' => 'aggregator_page_source', 'access' => $edit,
'type' => MENU_LOCAL_TASK);
@@ -173,6 +176,8 @@ function aggregator_menu() {
while ($category = db_fetch_object($result)) {
$items[] = array('path' => 'aggregator/categories/'. $category->cid, 'title' => $category->title,
'callback' => 'aggregator_page_category', 'access' => $view);
+ $items[] = array('path' => 'aggregator/categories/'. $category->cid .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'aggregator/categories/'. $category->cid .'/categorize', 'title' => t('categorize'),
'callback' => 'aggregator_page_category', 'access' => $edit,
'type' => MENU_LOCAL_TASK);
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 8d3f0d6fd..7a8983c78 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -129,7 +129,8 @@ function aggregator_menu() {
'callback' => 'aggregator_admin_refresh_feed', 'access' => $edit,
'type' => MENU_CALLBACK);
- // Tabs:
+ $items[] = array('path' => 'admin/aggregator/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/aggregator/add/feed', 'title' => t('add feed'),
'callback' => 'aggregator_admin_edit_feed', 'access' => $edit,
'type' => MENU_LOCAL_TASK);
@@ -159,6 +160,8 @@ function aggregator_menu() {
while ($feed = db_fetch_object($result)) {
$items[] = array('path' => 'aggregator/sources/'. $feed->fid, 'title' => $feed->title,
'callback' => 'aggregator_page_source', 'access' => $view);
+ $items[] = array('path' => 'aggregator/sources/'. $feed->fid .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'aggregator/sources/'. $feed->fid .'/categorize', 'title' => t('categorize'),
'callback' => 'aggregator_page_source', 'access' => $edit,
'type' => MENU_LOCAL_TASK);
@@ -173,6 +176,8 @@ function aggregator_menu() {
while ($category = db_fetch_object($result)) {
$items[] = array('path' => 'aggregator/categories/'. $category->cid, 'title' => $category->title,
'callback' => 'aggregator_page_category', 'access' => $view);
+ $items[] = array('path' => 'aggregator/categories/'. $category->cid .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'aggregator/categories/'. $category->cid .'/categorize', 'title' => t('categorize'),
'callback' => 'aggregator_page_category', 'access' => $edit,
'type' => MENU_LOCAL_TASK);
diff --git a/modules/archive.module b/modules/archive.module
index 50bea226a..db1c8e5f7 100644
--- a/modules/archive.module
+++ b/modules/archive.module
@@ -208,6 +208,8 @@ function archive_menu() {
'access' => user_access('access content'),
'callback' => 'archive_page',
'type' => MENU_SUGGESTED_ITEM);
+ $items[] = array('path' => 'archive/browse', 'title' => t('browse'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'archive/configure', 'title' => t('configure'),
'access' => user_access('administer site configuration'),
'callback' => 'archive_configure',
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index 50bea226a..db1c8e5f7 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -208,6 +208,8 @@ function archive_menu() {
'access' => user_access('access content'),
'callback' => 'archive_page',
'type' => MENU_SUGGESTED_ITEM);
+ $items[] = array('path' => 'archive/browse', 'title' => t('browse'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'archive/configure', 'title' => t('configure'),
'access' => user_access('administer site configuration'),
'callback' => 'archive_configure',
diff --git a/modules/block.module b/modules/block.module
index 3c9df6967..b7e66cbfd 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -67,6 +67,8 @@ function block_menu() {
$items[] = array('path' => 'admin/block', 'title' => t('blocks'),
'access' => user_access('administer blocks'),
'callback' => 'block_admin');
+ $items[] = array('path' => 'admin/block/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/block/edit', 'title' => t('edit block'),
'access' => user_access('administer blocks'),
'callback' => 'block_box_edit',
diff --git a/modules/block/block.module b/modules/block/block.module
index 3c9df6967..b7e66cbfd 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -67,6 +67,8 @@ function block_menu() {
$items[] = array('path' => 'admin/block', 'title' => t('blocks'),
'access' => user_access('administer blocks'),
'callback' => 'block_admin');
+ $items[] = array('path' => 'admin/block/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/block/edit', 'title' => t('edit block'),
'access' => user_access('administer blocks'),
'callback' => 'block_box_edit',
diff --git a/modules/filter.module b/modules/filter.module
index 4688d0bc0..dbb2eab99 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -52,7 +52,9 @@ function filter_menu() {
$items[] = array('path' => 'admin/filters', 'title' => t('filters'),
'callback' => 'filter_admin_settings',
'access' => user_access('administer site configuration'));
- $items[] = array('path' => 'admin/filters/order', 'title' => t('rearrange filters'),
+ $items[] = array('path' => 'admin/filters/configure', 'title' => t('configure'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/filters/order', 'title' => t('rearrange'),
'callback' => 'filter_admin_order',
'access' => user_access('administer site configuration'),
'type' => MENU_LOCAL_TASK);
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 4688d0bc0..dbb2eab99 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -52,7 +52,9 @@ function filter_menu() {
$items[] = array('path' => 'admin/filters', 'title' => t('filters'),
'callback' => 'filter_admin_settings',
'access' => user_access('administer site configuration'));
- $items[] = array('path' => 'admin/filters/order', 'title' => t('rearrange filters'),
+ $items[] = array('path' => 'admin/filters/configure', 'title' => t('configure'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/filters/order', 'title' => t('rearrange'),
'callback' => 'filter_admin_order',
'access' => user_access('administer site configuration'),
'type' => MENU_LOCAL_TASK);
diff --git a/modules/menu.module b/modules/menu.module
index 6177d99b2..438dc8de5 100644
--- a/modules/menu.module
+++ b/modules/menu.module
@@ -26,7 +26,8 @@ function menu_menu() {
'access' => user_access('administer menu'),
'type' => MENU_CALLBACK);
- // Tabs:
+ $items[] = array('path' => 'admin/menu/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/menu/menu/add', 'title' => t('add menu'),
'callback' => 'menu_add_menu',
'access' => user_access('administer menu'),
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 6177d99b2..438dc8de5 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -26,7 +26,8 @@ function menu_menu() {
'access' => user_access('administer menu'),
'type' => MENU_CALLBACK);
- // Tabs:
+ $items[] = array('path' => 'admin/menu/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/menu/menu/add', 'title' => t('add menu'),
'callback' => 'menu_add_menu',
'access' => user_access('administer menu'),
diff --git a/modules/node.module b/modules/node.module
index fd188d34e..af41ab7a2 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -641,12 +641,18 @@ function node_menu() {
$items[] = array('path' => 'admin/node', 'title' => t('content'),
'callback' => 'node_admin',
'access' => user_access('administer nodes'));
-
- // Tabs:
+ $items[] = array('path' => 'admin/node/overview', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/configure', 'title' => t('configure'),
'callback' => 'node_configure',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK);
+ $items[] = array('path' => 'admin/node/configure/settings', 'title' => t('settings'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/node/configure/defaults', 'title' => t('default workflow'),
+ 'callback' => 'node_default_settings',
+ 'access' => user_access('administer nodes'),
+ 'type' => MENU_LOCAL_TASK);
if (module_exist('search')) {
$items[] = array('path' => 'admin/node/search', 'title' => t('search'),
'callback' => 'node_admin',
@@ -654,16 +660,6 @@ function node_menu() {
'type' => MENU_LOCAL_TASK);
}
- // Subtabs:
- $items[] = array('path' => 'admin/node/configure/settings', 'title' => t('settings'),
- 'callback' => 'node_configure',
- 'access' => user_access('administer nodes'),
- 'type' => MENU_LOCAL_SUBTASK);
- $items[] = array('path' => 'admin/node/configure/defaults', 'title' => t('default workflow'),
- 'callback' => 'node_default_settings',
- 'access' => user_access('administer nodes'),
- 'type' => MENU_LOCAL_SUBTASK);
-
$items[] = array('path' => 'node', 'title' => t('content'),
'callback' => 'node_page',
'access' => user_access('access content'),
@@ -681,6 +677,8 @@ function node_menu() {
'callback' => 'node_page',
'access' => user_access('access content'),
'type' => MENU_CALLBACK);
+ $items[] = array('path' => 'node/'. arg(1) .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'),
'callback' => 'node_page',
'access' => node_access('update', $node),
diff --git a/modules/node/node.module b/modules/node/node.module
index fd188d34e..af41ab7a2 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -641,12 +641,18 @@ function node_menu() {
$items[] = array('path' => 'admin/node', 'title' => t('content'),
'callback' => 'node_admin',
'access' => user_access('administer nodes'));
-
- // Tabs:
+ $items[] = array('path' => 'admin/node/overview', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/configure', 'title' => t('configure'),
'callback' => 'node_configure',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK);
+ $items[] = array('path' => 'admin/node/configure/settings', 'title' => t('settings'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/node/configure/defaults', 'title' => t('default workflow'),
+ 'callback' => 'node_default_settings',
+ 'access' => user_access('administer nodes'),
+ 'type' => MENU_LOCAL_TASK);
if (module_exist('search')) {
$items[] = array('path' => 'admin/node/search', 'title' => t('search'),
'callback' => 'node_admin',
@@ -654,16 +660,6 @@ function node_menu() {
'type' => MENU_LOCAL_TASK);
}
- // Subtabs:
- $items[] = array('path' => 'admin/node/configure/settings', 'title' => t('settings'),
- 'callback' => 'node_configure',
- 'access' => user_access('administer nodes'),
- 'type' => MENU_LOCAL_SUBTASK);
- $items[] = array('path' => 'admin/node/configure/defaults', 'title' => t('default workflow'),
- 'callback' => 'node_default_settings',
- 'access' => user_access('administer nodes'),
- 'type' => MENU_LOCAL_SUBTASK);
-
$items[] = array('path' => 'node', 'title' => t('content'),
'callback' => 'node_page',
'access' => user_access('access content'),
@@ -681,6 +677,8 @@ function node_menu() {
'callback' => 'node_page',
'access' => user_access('access content'),
'type' => MENU_CALLBACK);
+ $items[] = array('path' => 'node/'. arg(1) .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'),
'callback' => 'node_page',
'access' => node_access('update', $node),
diff --git a/modules/path.module b/modules/path.module
index 82d600a31..61e7046be 100644
--- a/modules/path.module
+++ b/modules/path.module
@@ -66,8 +66,9 @@ function path_menu() {
'callback' => 'path_admin_delete',
'access' => user_access('administer url aliases'),
'type' => MENU_CALLBACK);
- // Tabs:
- $items[] = array('path' => 'admin/path/add', 'title' => t('add alias'),
+ $items[] = array('path' => 'admin/path/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/path/add', 'title' => t('add'),
'callback' => 'path_admin_edit',
'access' => user_access('administer url aliases'),
'type' => MENU_LOCAL_TASK);
diff --git a/modules/path/path.module b/modules/path/path.module
index 82d600a31..61e7046be 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -66,8 +66,9 @@ function path_menu() {
'callback' => 'path_admin_delete',
'access' => user_access('administer url aliases'),
'type' => MENU_CALLBACK);
- // Tabs:
- $items[] = array('path' => 'admin/path/add', 'title' => t('add alias'),
+ $items[] = array('path' => 'admin/path/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/path/add', 'title' => t('add'),
'callback' => 'path_admin_edit',
'access' => user_access('administer url aliases'),
'type' => MENU_LOCAL_TASK);
diff --git a/modules/profile.module b/modules/profile.module
index 137e1a9b1..61eca0aa2 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -34,7 +34,7 @@ function profile_menu() {
$items[] = array('path' => 'admin/user/configure/profile', 'title' => t('profiles'),
'callback' => 'profile_admin_overview',
'access' => user_access('administer users'),
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/profile/add', 'title' => t('add field'),
'callback' => 'profile_admin_add',
'access' => user_access('administer users'),
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 137e1a9b1..61eca0aa2 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -34,7 +34,7 @@ function profile_menu() {
$items[] = array('path' => 'admin/user/configure/profile', 'title' => t('profiles'),
'callback' => 'profile_admin_overview',
'access' => user_access('administer users'),
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/profile/add', 'title' => t('add field'),
'callback' => 'profile_admin_add',
'access' => user_access('administer users'),
diff --git a/modules/search.module b/modules/search.module
index baf0809be..90e6de7c7 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -52,6 +52,8 @@ function search_menu() {
'callback' => 'search_help_page',
'access' => user_access('search content'),
'type' => MENU_SUGGESTED_ITEM);
+ $items[] = array('path' => 'search/search', 'title' => t('search'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'search/configure', 'title' => t('configure'),
'callback' => 'search_configure',
'access' => user_access('administer site configuration'),
diff --git a/modules/search/search.module b/modules/search/search.module
index baf0809be..90e6de7c7 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -52,6 +52,8 @@ function search_menu() {
'callback' => 'search_help_page',
'access' => user_access('search content'),
'type' => MENU_SUGGESTED_ITEM);
+ $items[] = array('path' => 'search/search', 'title' => t('search'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'search/configure', 'title' => t('configure'),
'callback' => 'search_configure',
'access' => user_access('administer site configuration'),
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 435d92095..5eae639fa 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -63,6 +63,8 @@ function taxonomy_menu() {
$items[] = array('path' => 'admin/taxonomy', 'title' => t('categories'),
'callback' => 'taxonomy_admin',
'access' => user_access('administer taxonomy'));
+ $items[] = array('path' => 'admin/taxonomy/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/taxonomy/add/vocabulary', 'title' => t('add vocabulary'),
'callback' => 'taxonomy_admin',
'access' => user_access('administer taxonomy'),
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 435d92095..5eae639fa 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -63,6 +63,8 @@ function taxonomy_menu() {
$items[] = array('path' => 'admin/taxonomy', 'title' => t('categories'),
'callback' => 'taxonomy_admin',
'access' => user_access('administer taxonomy'));
+ $items[] = array('path' => 'admin/taxonomy/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/taxonomy/add/vocabulary', 'title' => t('add vocabulary'),
'callback' => 'taxonomy_admin',
'access' => user_access('administer taxonomy'),
diff --git a/modules/user.module b/modules/user.module
index 4b5416910..e589869f2 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -605,6 +605,8 @@ function user_menu() {
if (arg(0) == 'user' && is_numeric(arg(1))) {
$items[] = array('path' => 'user/'. arg(1), 'title' => t('user'),
'callback' => 'user_page', 'access' => TRUE);
+ $items[] = array('path' => 'user/'. arg(1) .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'user/'. arg(1) .'/edit', 'title' => t('edit'),
'callback' => 'user_edit', 'access' => $access || $user->uid == arg(1),
'type' => MENU_LOCAL_TASK);
@@ -613,8 +615,8 @@ function user_menu() {
if (($categories = _user_categories()) && (count($categories) > 1)) {
foreach ($categories as $key => $category) {
$items[] = array('path' => 'user/'. arg(1) .'/edit/'. $category['name'], 'title' => $category['title'],
- 'callback' => $function, 'access' => $access || $user->uid == arg(1),
- 'type' => MENU_LOCAL_SUBTASK, 'weight' => $category['weight']);
+ 'type' => $category['name'] == 'account' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
+ 'weight' => $category['weight']);
}
}
}
@@ -645,39 +647,37 @@ function user_menu() {
$items[] = array('path' => 'admin/user', 'title' => t('users'),
'callback' => 'user_admin', 'access' => $access);
-
- // Tabs:
- $items[] = array('path' => 'admin/user/create', 'title' => t('add user'),
+ $items[] = array('path' => 'admin/user/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/user/create', 'title' => t('add'),
'callback' => 'user_admin', 'access' => $access,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure', 'title' => t('configure'),
'callback' => 'user_configure', 'access' => $access,
'type' => MENU_LOCAL_TASK);
- if (module_exist('search')) {
- $items[] = array('path' => 'admin/user/search', 'title' => t('search'),
- 'callback' => 'user_admin', 'access' => $access,
- 'type' => MENU_LOCAL_TASK);
- }
-
- // Sub-tabs:
$items[] = array('path' => 'admin/user/configure/settings', 'title' => t('settings'),
- 'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/user/configure/access', 'title' => t('access rules'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/access/mail', 'title' => t('e-mail rules'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/access/user', 'title' => t('name rules'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/role', 'title' => t('roles'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/permission', 'title' => t('permissions'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
+
+ if (module_exist('search')) {
+ $items[] = array('path' => 'admin/user/search', 'title' => t('search'),
+ 'callback' => 'user_admin', 'access' => $access,
+ 'type' => MENU_LOCAL_TASK);
+ }
return $items;
}
diff --git a/modules/user/user.module b/modules/user/user.module
index 4b5416910..e589869f2 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -605,6 +605,8 @@ function user_menu() {
if (arg(0) == 'user' && is_numeric(arg(1))) {
$items[] = array('path' => 'user/'. arg(1), 'title' => t('user'),
'callback' => 'user_page', 'access' => TRUE);
+ $items[] = array('path' => 'user/'. arg(1) .'/view', 'title' => t('view'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'user/'. arg(1) .'/edit', 'title' => t('edit'),
'callback' => 'user_edit', 'access' => $access || $user->uid == arg(1),
'type' => MENU_LOCAL_TASK);
@@ -613,8 +615,8 @@ function user_menu() {
if (($categories = _user_categories()) && (count($categories) > 1)) {
foreach ($categories as $key => $category) {
$items[] = array('path' => 'user/'. arg(1) .'/edit/'. $category['name'], 'title' => $category['title'],
- 'callback' => $function, 'access' => $access || $user->uid == arg(1),
- 'type' => MENU_LOCAL_SUBTASK, 'weight' => $category['weight']);
+ 'type' => $category['name'] == 'account' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
+ 'weight' => $category['weight']);
}
}
}
@@ -645,39 +647,37 @@ function user_menu() {
$items[] = array('path' => 'admin/user', 'title' => t('users'),
'callback' => 'user_admin', 'access' => $access);
-
- // Tabs:
- $items[] = array('path' => 'admin/user/create', 'title' => t('add user'),
+ $items[] = array('path' => 'admin/user/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/user/create', 'title' => t('add'),
'callback' => 'user_admin', 'access' => $access,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure', 'title' => t('configure'),
'callback' => 'user_configure', 'access' => $access,
'type' => MENU_LOCAL_TASK);
- if (module_exist('search')) {
- $items[] = array('path' => 'admin/user/search', 'title' => t('search'),
- 'callback' => 'user_admin', 'access' => $access,
- 'type' => MENU_LOCAL_TASK);
- }
-
- // Sub-tabs:
$items[] = array('path' => 'admin/user/configure/settings', 'title' => t('settings'),
- 'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/user/configure/access', 'title' => t('access rules'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/access/mail', 'title' => t('e-mail rules'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/access/user', 'title' => t('name rules'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/role', 'title' => t('roles'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/configure/permission', 'title' => t('permissions'),
'callback' => 'user_configure', 'access' => $access,
- 'type' => MENU_LOCAL_SUBTASK);
+ 'type' => MENU_LOCAL_TASK);
+
+ if (module_exist('search')) {
+ $items[] = array('path' => 'admin/user/search', 'title' => t('search'),
+ 'callback' => 'user_admin', 'access' => $access,
+ 'type' => MENU_LOCAL_TASK);
+ }
return $items;
}