diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/admin.php | 7 | ||||
-rw-r--r-- | engine/lib/users.php | 40 |
2 files changed, 41 insertions, 6 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 1c78ce210..81403a6be 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -210,6 +210,13 @@ function admin_init() { 'weight' => 10, )); + elgg_register_menu_item('topbar_alt', array( + 'name' => 'administration', + 'href' => 'pg/admin', + 'text' => elgg_view_icon('settings') . elgg_echo('admin'), + 'weight' => 100, + )); + // widgets $widgets = array('online_users', 'new_users', 'content_stats'); foreach ($widgets as $widget) { diff --git a/engine/lib/users.php b/engine/lib/users.php index 1ac87e7d1..cf50c7ae2 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1508,20 +1508,48 @@ function users_init() { $user = elgg_get_logged_in_user_entity(); if ($user) { - $params = array( + elgg_register_menu_item('page', array( 'name' => 'edit_avatar', 'href' => "pg/avatar/edit/{$user->username}", 'text' => elgg_echo('avatar:edit'), 'contexts' => array('profile_edit'), - ); - elgg_register_menu_item('page', $params); - $params = array( + )); + + 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('page', $params); + )); + + elgg_register_menu_item('topbar', array( + 'name' => 'profile', + 'href' => $user->getURL(), + 'text' => "<img src=\"{$user->getIconURL('topbar')}\" alt=\"$user->name\" />", + )); + + elgg_register_menu_item('topbar', array( + 'name' => 'friends', + 'href' => "pg/friends/{$user->username}", + 'text' => elgg_view_icon('friends'), + 'title' => elgg_echo('friends'), + )); + + elgg_register_menu_item('topbar_alt', array( + 'name' => 'usersettings', + 'href' => "pg/settings/user/{$user->username}", + 'text' => elgg_view_icon('settings') . elgg_echo('settings'), + 'weight' => 500 + )); + + elgg_register_menu_item('topbar_alt', array( + 'name' => 'logout', + 'href' => "action/logout", + 'text' => elgg_echo('logout'), + 'is_action' => TRUE, + 'weight' => 1000, + )); + } elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elgg_user_hover_menu'); |