]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4912 custom site menu items are now matched
authorCash Costello <cash.costello@gmail.com>
Fri, 31 May 2013 21:39:15 +0000 (17:39 -0400)
committerCash Costello <cash.costello@gmail.com>
Fri, 31 May 2013 21:39:15 +0000 (17:39 -0400)
engine/lib/navigation.php

index 118a7214c8f0c87417544403877aed8e4b451aa6..2831d418bac7ef1f4d0c7900bac2721b499eb2e0 100644 (file)
@@ -323,7 +323,8 @@ function elgg_site_menu_setup($hook, $type, $return, $params) {
        }
        
        if (!$selected) {
-               // nothing selected, match name to context
+               // nothing selected, match name to context or match url
+               $current_url = current_page_url();
                foreach ($return as $section_name => $section) {
                        foreach ($section as $key => $item) {
                                // only highlight internal links
@@ -332,6 +333,10 @@ function elgg_site_menu_setup($hook, $type, $return, $params) {
                                                $return[$section_name][$key]->setSelected(true);
                                                break 2;
                                        }
+                                       if ($item->getHref() == $current_url) {
+                                               $return[$section_name][$key]->setSelected(true);
+                                               break 2;
+                                       }
                                }
                        }
                }