From 6ed3c77c05c2cf6e16f0b65f818c50b0a6d9bee8 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 18 Aug 2008 09:40:43 +0000 Subject: More submenu corrections git-svn-id: https://code.elgg.org/elgg/trunk@1999 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 9fc3e65f2..114698ad3 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -557,9 +557,6 @@ ksort($submenu_register); foreach($submenu_register as $groupname => $submenu_register_group) { - - $submenu = ""; - foreach($submenu_register_group as $key => $item) { if (substr_count($item->value, $_SERVER['REQUEST_URI'])) { @@ -567,22 +564,29 @@ if ($comparevals[$key] < $maxcompareval) { $maxcompareval = $comparevals[$key]; $preselected = $key; + $preselectedgroup = $groupname; } } } + } + + foreach($submenu_register as $groupname => $submenu_register_group) { + + $submenu = ""; foreach($submenu_register_group as $key => $item) { if ($preselected === false) { if (substr_count($item->value, $_SERVER['REQUEST_URI'])) { $preselected = $key; + $preselectedgroup = $groupname; $selected = true; } else { $selected = false; } } else { - if ($key == $preselected) { + if ($key == $preselected && $groupname == $preselectedgroup) { $selected = true; } else { $selected = false; -- cgit v1.2.3