Skip to content

Commit

Permalink
Merge pull request #98 from edfactor/patch-1
Browse files Browse the repository at this point in the history
Only admins should see Administration topbar menu item
  • Loading branch information
ewinslow committed Jun 10, 2013
2 parents 00d072d + b49274c commit 076886f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions start.php
Expand Up @@ -335,13 +335,15 @@ function facebook_theme_pagesetup_handler() {
));

elgg_unregister_menu_item('topbar', 'administration');
elgg_register_menu_item('topbar', array(
'href' => '/admin',
'name' => 'administration',
'parent_name' => 'account',
'section' => 'alt',
'text' => elgg_echo('admin'),
));
if (elgg_is_admin_logged_in()) {
elgg_register_menu_item('topbar', array(
'href' => '/admin',
'name' => 'administration',
'parent_name' => 'account',
'section' => 'alt',
'text' => elgg_echo('admin'),
));
}

if (elgg_is_active_plugin('notifications')) {
elgg_register_menu_item('topbar', array(
Expand Down Expand Up @@ -677,4 +679,4 @@ function facebook_theme_profile_page_handler($page) {
return true;
}

elgg_register_event_handler('init', 'system', 'facebook_theme_init');
elgg_register_event_handler('init', 'system', 'facebook_theme_init');

0 comments on commit 076886f

Please sign in to comment.