diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-13 18:56:17 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-13 18:56:17 +0000 |
commit | a21bc98222a29de9f823cec19e34d32868dfacee (patch) | |
tree | 4d538055f739572e683c00398b50199696ef800d /engine/lib | |
parent | ca060f3f15a653b53df870f2c22fa3df6ca12191 (diff) | |
download | elgg-a21bc98222a29de9f823cec19e34d32868dfacee.tar.gz elgg-a21bc98222a29de9f823cec19e34d32868dfacee.tar.bz2 |
To detect if a submenu item is selected, using output from full_url() instead of $_SERVER['REQUEST_URI'] because the host isn't set in REQUEST_URI.
git-svn-id: http://code.elgg.org/elgg/trunk@6033 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 722e92ca0..78761c739 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1080,6 +1080,7 @@ function elgg_prepare_submenu($context = 'main', $sort = FALSE) { $CONFIG->submenu[$context][$group] = $parsed_menu; } + return TRUE; } @@ -1146,7 +1147,7 @@ function elgg_get_submenu($context = NULL, $sort = FALSE) { // try to guess if this should be selected if they don't specify if ((!isset($item->selected) || $item->selected === NULL) && isset($item->href)) { - $item->selected = elgg_http_url_is_identical($_SERVER['REQUEST_URI'], $item->href); + $item->selected = elgg_http_url_is_identical(full_url(), $item->href); } // traverse up the parent tree if matached to mark all parents as selected/expanded. @@ -3107,17 +3108,17 @@ function __elgg_shutdown_hook() { function elgg_init() { // Page handler for JS register_page_handler('js','js_page_handler'); - + // Register an event triggered at system shutdown register_shutdown_function('__elgg_shutdown_hook'); } function elgg_walled_garden_index() { global $CONFIG; - + $login = elgg_view('account/forms/login'); $layout = elgg_view_layout('one_column', $login); - + echo page_draw('', $layout); return TRUE; } @@ -3296,7 +3297,7 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset function elgg_walled_garden() { global $CONFIG; - + // check for external page view if (isset($CONFIG->site) && $CONFIG->site instanceof ElggSite) { $CONFIG->site->check_walled_garden(); |