diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-06-19 14:57:44 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-06-19 14:57:44 +0000 |
commit | 1b46d7fcfe5480d1e7f5d6b291715208bc4f789e (patch) | |
tree | 08b855c40764120aba576ea1238a592604595976 /includes | |
parent | d2ff1ca54e2167b1b7c2d1a9cb844badf0180c80 (diff) | |
download | brdo-1b46d7fcfe5480d1e7f5d6b291715208bc4f789e.tar.gz brdo-1b46d7fcfe5480d1e7f5d6b291715208bc4f789e.tar.bz2 |
- Patch #8614 by JonBob: better way to display menus.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/menu.inc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index 59ccdcde8..c97ab1e5a 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -421,17 +421,17 @@ function theme_menu_item($mid) { */ function theme_menu_local_tasks() { - $active = true; if ($mid = menu_get_active_nontask_item()) { $menu = menu_get_menu(); + $active_mid = $mid; if ($children = $menu['items'][$mid]['children']) { foreach ($menu['items'][$mid]['children'] as $cid) { if (($menu['items'][$cid]['type'] & MENU_IS_LOCAL_TASK) && _menu_item_is_accessible($cid)) { if (menu_in_active_trail($cid)) { $tabs[] = theme('menu_local_task', $cid, TRUE); - $active = false; + $active_mid = $cid; } else { $tabs[] = theme('menu_local_task', $cid, FALSE); @@ -442,13 +442,14 @@ function theme_menu_local_tasks() { if ($tabs) { // We add a default view-tab for the parent: $output = "<ul class=\"tabs primary\">\n"; - $output .= theme('menu_local_task', $mid, $active); + $output .= theme('menu_local_task', $mid, $active_mid == $mid); $output .= implode($tabs); $output .= "</ul>\n"; - $output .= theme('menu_local_subtasks', $mid); + $output .= theme('menu_local_subtasks', $active_mid); } } } + return $output; } @@ -462,7 +463,7 @@ function theme_menu_local_tasks() { */ function theme_menu_local_task($mid, $active) { if ($active) { - return '<li class="active">'. theme('menu_item', $mid) ."</li>\n"; + return '<li class="active">'. theme('menu_item', $mid) ."</li>\n"; } else { return '<li>'. theme('menu_item', $mid) ."</li>\n"; |