From 1e503286839742e72c01a6357c4293b7bf390d56 Mon Sep 17 00:00:00 2001 From: Sem Date: Tue, 23 Oct 2012 06:20:08 +0200 Subject: Overrided topbar icons with tooltips. --- start.php | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'start.php') diff --git a/start.php b/start.php index 43d175f..eb25a82 100644 --- a/start.php +++ b/start.php @@ -28,7 +28,49 @@ function n1_theme_init() { } function n1_theme_topbar_menu($hook, $type, $returnvalue, $params){ - //var_dump($returnvalue);exit(); + $user = elgg_get_logged_in_user_entity(); + + if (elgg_is_admin_logged_in()) { + $returnvalue[] = ElggMenuItem::factory(array( + 'name' => 'administration', + 'href' => "admin", + 'text' => elgg_view_icon('settings'), + 'title' => elgg_echo('admin'), + 'priority' => 100, + 'section' => 'alt', + )); + } + + if (elgg_is_active_plugin('dashboard')) { + $returnvalue[] = ElggMenuItem::factory(array( + 'name' => 'dashboard', + 'href' => "dashboard", + 'text' => elgg_view_icon('home'), + 'title' => elgg_echo('dashboard'), + 'priority' => 200, + 'section' => 'alt', + )); + } + + $returnvalue[] = ElggMenuItem::factory(array( + 'name' => 'usersettings', + 'href' => "settings/user/{$user->username}", + 'text' => elgg_view_icon('settings-alt'), + 'title' => elgg_echo('settings'), + 'priority' => 500, + 'section' => 'alt', + )); + + $returnvalue[] = ElggMenuItem::factory(array( + 'name' => 'logout', + 'href' => "action/logout", + 'text' => elgg_echo('logout'), + 'title' => elgg_echo('logout'), + 'is_action' => TRUE, + 'priority' => 1000, + 'section' => 'alt', + )); + return $returnvalue; } /** -- cgit v1.2.3 From b4ad2436f397f5f9f155a723f4a07bb3cc7eb32a Mon Sep 17 00:00:00 2001 From: Sem Date: Tue, 30 Oct 2012 02:32:04 +0100 Subject: Added groups icon in topbar. --- _graphics/elgg_sprites.png | Bin 26601 -> 27129 bytes start.php | 12 +++++++++++- views/default/css/elements/icons.php | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'start.php') diff --git a/_graphics/elgg_sprites.png b/_graphics/elgg_sprites.png index b8b9b2b..461799c 100644 Binary files a/_graphics/elgg_sprites.png and b/_graphics/elgg_sprites.png differ diff --git a/start.php b/start.php index eb25a82..ae5f3d6 100644 --- a/start.php +++ b/start.php @@ -29,7 +29,17 @@ function n1_theme_init() { function n1_theme_topbar_menu($hook, $type, $returnvalue, $params){ $user = elgg_get_logged_in_user_entity(); - + + if (elgg_is_active_plugin('groups')) { + $returnvalue[] = ElggMenuItem::factory(array( + 'name' => 'groups', + 'href' => $user ? "groups/member/$user->username" : "groups/all", + 'text' => elgg_view_icon('groups'), + 'title' => elgg_echo('groups'), + 'priority' => 500, + )); + } + if (elgg_is_admin_logged_in()) { $returnvalue[] = ElggMenuItem::factory(array( 'name' => 'administration', diff --git a/views/default/css/elements/icons.php b/views/default/css/elements/icons.php index ba62a66..2d6db62 100644 --- a/views/default/css/elements/icons.php +++ b/views/default/css/elements/icons.php @@ -281,6 +281,12 @@ .elgg-icon-logout:hover, .elgg-menu-item-logout:hover a { background-position: 0 -1542px; } +.elgg-icon-groups { + background-position: 0 -1577px; +} +.elgg-icon-groups:hover { + background-position: 0 -1560px; +} .elgg-avatar > .elgg-icon-hover-menu { -- cgit v1.2.3 From 971504c5c53593d63d74714acf3ae7321ec557c4 Mon Sep 17 00:00:00 2001 From: Sem Date: Tue, 30 Oct 2012 02:52:43 +0100 Subject: Added group invitations in groups topbar icon. --- start.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'start.php') diff --git a/start.php b/start.php index ae5f3d6..65ea0e5 100644 --- a/start.php +++ b/start.php @@ -31,10 +31,28 @@ function n1_theme_topbar_menu($hook, $type, $returnvalue, $params){ $user = elgg_get_logged_in_user_entity(); if (elgg_is_active_plugin('groups')) { + + $ia = elgg_set_ignore_access(TRUE); + $num_invitations = elgg_get_entities_from_relationship(array( + 'relationship' => 'invited', + 'relationship_guid' => $user->guid, + 'inverse_relationship' => TRUE, + 'limit' => 0, + 'count' => TRUE, + )); + elgg_set_ignore_access($ia); + + if ($num_invitations) { + $num_invitations = elgg_view('output/url', array( + 'text' => "$num_invitations", + 'href' => "groups/invitations/$user->username", + )); + } + $returnvalue[] = ElggMenuItem::factory(array( 'name' => 'groups', - 'href' => $user ? "groups/member/$user->username" : "groups/all", - 'text' => elgg_view_icon('groups'), + 'href' => "groups/member/$user->username", + 'text' => elgg_view_icon('groups') . $num_invitations, 'title' => elgg_echo('groups'), 'priority' => 500, )); -- cgit v1.2.3