Commit 1cd02936 authored by Camille Tardy's avatar Camille Tardy
Browse files

Change Admin button in user menu (only if site admin)


Signed-off-by: Camille Tardy's avatarCamille Tardy <camille.tardy@unige.ch>
parent dd0cb3d4
......@@ -228,14 +228,16 @@ function user_get_user_navigation_info_bis($user, $page, $options = array()) {
$switchrole->titleidentifier = 'switchroleto,moodle';
$returnobject->navitems[] = $switchrole;
// Links: admin.
$administration = new stdClass();
$administration->itemtype = 'link';
$administration->url = new moodle_url('/admin/search.php');
$administration->title = get_string('administration');
$administration->titleidentifier = "admin";
$administration->pix = "a/setting";
$returnobject->navitems[] = $administration;
if(is_siteadmin()){
// Links: admin.
$administration = new stdClass();
$administration->itemtype = 'link';
$administration->url = new moodle_url('/admin/search.php');
$administration->title = get_string('administration');
$administration->titleidentifier = "admin";
$administration->pix = "a/setting";
$returnobject->navitems[] = $administration;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment