aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-25 20:32:02 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-25 20:32:02 +0000
commit2d39bc311b64c2dd5c40236c43a98d4fb2dce31f (patch)
tree7c8426ba8ec21c5394fc182632d3e8f0cbeb72ed /engine
parentf947735999c0e646454e3a98b075cf921c4e0bec (diff)
downloadelgg-2d39bc311b64c2dd5c40236c43a98d4fb2dce31f.tar.gz
elgg-2d39bc311b64c2dd5c40236c43a98d4fb2dce31f.tar.bz2
Refs #2895: Made topbar into 2 menus. CSS will have to be fixed
git-svn-id: http://code.elgg.org/elgg/trunk@8473 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/admin.php7
-rw-r--r--engine/lib/users.php40
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');