diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-18 17:47:50 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-18 17:47:50 +0000 |
commit | 569f19d8ff89539eb8d38b1ca1b07a2baa41852c (patch) | |
tree | 0ace0c2792db822cd0db5eae672f1f472a29439a /engine/lib/users.php | |
parent | 8ec093ecc1bf28c09f5d2dbe3c7bc8e6a2485ac6 (diff) | |
download | elgg-569f19d8ff89539eb8d38b1ca1b07a2baa41852c.tar.gz elgg-569f19d8ff89539eb8d38b1ca1b07a2baa41852c.tar.bz2 |
half way through converting submenu to new menu code - pages and groups are the two major users left
git-svn-id: http://code.elgg.org/elgg/trunk@7669 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r-- | engine/lib/users.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index d22e42ebf..d69461c2b 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1336,6 +1336,7 @@ function friends_page_handler($page_elements) { * @return void */ function friends_of_page_handler($page_elements) { + elgg_set_context('friends'); if (isset($page_elements[0]) && $user = get_user_by_username($page_elements[0])) { set_page_owner($user->getGUID()); } @@ -1490,22 +1491,23 @@ function elgg_members_page_handler($page) { * @return void */ function users_pagesetup() { - // Load config - global $CONFIG; - - //add submenu options - if (elgg_get_context() == "friends" || elgg_get_context() == "friendsof") { - // || elgg_get_context() == "collections") { - disabled as we no longer use collections - - add_submenu_item(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" - . elgg_get_page_owner()->username); - add_submenu_item(elgg_echo('friends:of'), $CONFIG->wwwroot . "pg/friendsof/" - . elgg_get_page_owner()->username); - - if (is_plugin_enabled('members')) { - add_submenu_item(elgg_echo('members:browse'), $CONFIG->wwwroot . "mod/members/index.php"); - } + if (elgg_get_page_owner_guid()) { + $params = array( + 'name' => 'friends', + 'title' => elgg_echo('friends'), + 'url' => 'pg/friends/' . elgg_get_page_owner()->username, + 'contexts' => array('friends') + ); + elgg_register_menu_item('page', $params); + + $params = array( + 'name' => 'friendsof', + 'title' => elgg_echo('friends:of'), + 'url' => 'pg/friendsof/' . elgg_get_page_owner()->username, + 'contexts' => array('friends') + ); + elgg_register_menu_item('page', $params); } } |