diff options
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/users.php | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index 1b9a6128b..99466bf73 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1484,30 +1484,8 @@ function users_pagesetup() { ); elgg_register_menu_item('page', $params); } -} - -/** - * Users initialisation function, which establishes the page handler - * - * @return void - */ -function users_init() { - global $CONFIG; - - elgg_register_page_handler('friends', 'friends_page_handler'); - elgg_register_page_handler('friendsof', 'friends_of_page_handler'); - elgg_register_page_handler('dashboard', 'dashboard_page_handler'); - elgg_register_page_handler('register', 'registration_page_handler'); - elgg_register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler'); - elgg_register_page_handler('login', 'elgg_user_login_page_handler'); - elgg_register_page_handler('members', 'elgg_members_page_handler'); - elgg_register_page_handler('avatar', 'elgg_avatar_page_handler'); - elgg_register_page_handler('profile', 'elgg_profile_page_handler'); - elgg_register_page_handler('collections', 'collections_page_handler'); - - $item = new ElggMenuItem('members', elgg_echo('members'), 'pg/members'); - elgg_register_menu_item('site', $item); + // topbar $user = elgg_get_logged_in_user_entity(); if ($user) { elgg_register_menu_item('page', array( @@ -1516,21 +1494,21 @@ function users_init() { 'text' => elgg_echo('avatar:edit'), 'contexts' => array('profile_edit'), )); - + elgg_register_menu_item('page', array( 'name' => 'edit_profile', 'href' => "pg/profile/{$user->username}/edit", 'text' => elgg_echo('profile:edit'), 'contexts' => array('profile_edit'), )); - + elgg_register_menu_item('topbar', array( 'name' => 'profile', 'href' => $user->getURL(), 'text' => "<img src=\"{$user->getIconURL('topbar')}\" alt=\"$user->name\" />", 'weight' => 100, )); - + elgg_register_menu_item('topbar', array( 'name' => 'friends', 'href' => "pg/friends/{$user->username}", @@ -1538,7 +1516,7 @@ function users_init() { 'title' => elgg_echo('friends'), 'weight' => 300, )); - + elgg_register_menu_item('topbar', array( 'name' => 'usersettings', 'href' => "pg/settings/user/{$user->username}", @@ -1546,7 +1524,7 @@ function users_init() { 'weight' => 500, 'section' => 'alt', )); - + elgg_register_menu_item('topbar', array( 'name' => 'logout', 'href' => "action/logout", @@ -1555,8 +1533,31 @@ function users_init() { 'weight' => 1000, 'section' => 'alt', )); - + } +} + +/** + * Users initialisation function, which establishes the page handler + * + * @return void + */ +function users_init() { + global $CONFIG; + + elgg_register_page_handler('friends', 'friends_page_handler'); + elgg_register_page_handler('friendsof', 'friends_of_page_handler'); + elgg_register_page_handler('dashboard', 'dashboard_page_handler'); + elgg_register_page_handler('register', 'registration_page_handler'); + elgg_register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler'); + elgg_register_page_handler('login', 'elgg_user_login_page_handler'); + elgg_register_page_handler('members', 'elgg_members_page_handler'); + elgg_register_page_handler('avatar', 'elgg_avatar_page_handler'); + elgg_register_page_handler('profile', 'elgg_profile_page_handler'); + elgg_register_page_handler('collections', 'collections_page_handler'); + + $item = new ElggMenuItem('members', elgg_echo('members'), 'pg/members'); + elgg_register_menu_item('site', $item); elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elgg_user_hover_menu'); |