Commit 81128042 authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Allow staff to view site statistics



- Also adds various submenus for admin home
  - register
  - statistics
  - home

This means that these pages can see where they are

Change-Id: I81faade62ac140a3c68503c13aadbfe36c646911
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent 3be3f815
......@@ -27,7 +27,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'adminhome');
define('MENUITEM', 'adminhome/home');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'index');
......
......@@ -27,7 +27,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'adminhome');
define('MENUITEM', 'adminhome/registersite');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
......
......@@ -26,8 +26,8 @@
*/
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'adminhome');
define('STAFF', 1);
define('MENUITEM', 'adminhome/statistics');
require(dirname(dirname(__FILE__)).'/init.php');
require(get_config('libroot') . 'registration.php');
......
......@@ -26,7 +26,7 @@
*/
define('INTERNAL', 1);
define('ADMIN', 1);
define('STAFF', 1);
require(dirname(dirname(__FILE__)).'/init.php');
$type = param_alpha('type');
......
......@@ -542,6 +542,7 @@ $string['processing'] = 'Processing';
$string['unknownerror'] = 'An unknown error occurred (0x20f91a0)';
// menu
$string['overview'] = 'Overview';
$string['home'] = 'Home';
$string['Content'] = 'Content';
$string['myportfolio'] = 'Portfolio';
......
......@@ -1776,6 +1776,24 @@ function admin_nav() {
'title' => get_string('adminhome', 'admin'),
'weight' => 10,
),
'adminhome/home' => array(
'path' => 'adminhome/home',
'url' => 'admin/',
'title' => get_string('overview'),
'weight' => 10,
),
'adminhome/registersite' => array(
'path' => 'adminhome/registersite',
'url' => 'admin/registersite.php',
'title' => get_string('register'),
'weight' => 20,
),
'adminhome/statistics' => array(
'path' => 'adminhome/statistics',
'url' => 'admin/statistics.php',
'title' => get_string('sitestatistics', 'admin'),
'weight' => 30,
),
'configsite' => array(
'path' => 'configsite',
'url' => 'admin/site/options.php',
......@@ -2117,6 +2135,28 @@ function institutional_admin_nav() {
* @return a data structure containing the staff navigation
*/
function staff_nav() {
return array(
'usersearch' => array(
'path' => 'usersearch',
'url' => 'admin/users/search.php',
'title' => get_string('usersearch', 'admin'),
'weight' => 10,
),
'statistics' => array(
'path' => 'statistics',
'url' => 'admin/statistics.php',
'title' => get_string('sitestatistics', 'admin'),
'weight' => 20,
),
);
}
/**
* Returns the entries in the institutional staff menu
*
* @return a data structure containing the institutional staff navigation
*/
function institutional_staff_nav() {
return array(
'usersearch' => array(
'path' => 'usersearch',
......@@ -2240,9 +2280,12 @@ function main_nav() {
else if ($USER->is_institutional_admin()) {
$menu = institutional_admin_nav();
}
else {
else if ($USER->get('staff')) {
$menu = staff_nav();
}
else {
$menu = institutional_staff_nav();
}
}
else {
// Build the menu structure for the site
......
Supports Markdown
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