diff options
author | foockinho <foockinho@lorea.org> | 2012-11-01 03:16:02 +0100 |
---|---|---|
committer | foockinho <foockinho@lorea.org> | 2012-11-01 03:16:02 +0100 |
commit | 57915e6d7471ce7545b2adf70974cb921c0ab3ac (patch) | |
tree | 946f78e02b4ef12e4cd19444f58ae40d25ae5eac /start.php | |
parent | 55ca743ea61105b7ec8985e9d8dc29e2f57f092d (diff) | |
parent | 74895a430a7eb9a31f0555eae29e098608bdf049 (diff) | |
download | saravea_theme-57915e6d7471ce7545b2adf70974cb921c0ab3ac.tar.gz saravea_theme-57915e6d7471ce7545b2adf70974cb921c0ab3ac.tar.bz2 |
Merge branch 'master' of gitorious.org:lorea/n1_theme
Conflicts:
_graphics/elgg_sprites.png
Diffstat (limited to 'start.php')
-rw-r--r-- | start.php | 72 |
1 files changed, 71 insertions, 1 deletions
@@ -28,7 +28,77 @@ 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_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' => "<span class=\"messages-new\">$num_invitations</span>",
+ 'href' => "groups/invitations/$user->username",
+ ));
+ }
+
+ $returnvalue[] = ElggMenuItem::factory(array(
+ 'name' => 'groups',
+ 'href' => "groups/member/$user->username",
+ 'text' => elgg_view_icon('groups') . $num_invitations,
+ 'title' => elgg_echo('groups'),
+ 'priority' => 500,
+ ));
+ }
+
+ 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;
}
/**
|