Commit 6bd2b12a authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Fix institution menu (Bug #1045234)



When an institution admin is viewing the admin menu
and is also a site staff, they can't see the site
statistics

Change-Id: If447e5384da0e067702efbe936ffa909a636e21b
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent 52c77a4c
......@@ -271,6 +271,7 @@ $string['groupstatstabletitle'] = 'Biggest groups';
$string['viewstatstabletitle'] = 'Most popular pages';
$string['exportstatsascsv'] = 'Export statistics in CSV format';
$string['nostats'] = 'No statistics available';
$string['site'] = 'Site';
// Institution statistics
$string['statistics'] = 'Statistics';
......
......@@ -2047,8 +2047,9 @@ function admin_nav() {
* @return $adminnav a data structure containing the admin navigation
*/
function institutional_admin_nav() {
global $USER;
return array(
$ret = array(
'configusers' => array(
'path' => 'configusers',
'url' => 'admin/users/search.php',
......@@ -2170,6 +2171,22 @@ function institutional_admin_nav() {
'weight' => 110,
),
);
if ($USER->get('staff')) {
$ret['adminhome'] = array(
'path' => 'adminhome',
'url' => 'admin/statistics.php',
'title' => get_string('site', 'admin'),
'weight' => 40,
);
$ret['adminhome/statistics'] = array(
'path' => 'adminhome/statistics',
'url' => 'admin/statistics.php',
'title' => get_string('statistics', 'admin'),
'weight' => 10,
);
};
return $ret;
}
......
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