From 1b46d7fcfe5480d1e7f5d6b291715208bc4f789e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 19 Jun 2004 14:57:44 +0000 Subject: - Patch #8614 by JonBob: better way to display menus. --- includes/menu.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'includes') 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 = "\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 '
  • '. theme('menu_item', $mid) ."
  • \n"; + return '
  • '. theme('menu_item', $mid) ."
  • \n"; } else { return '
  • '. theme('menu_item', $mid) ."
  • \n"; -- cgit v1.2.3