Commit 891514f5 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't highlight Staff Users/Admin Users menu items for site admin editing...

Don't highlight Staff Users/Admin Users menu items for site admin editing institution staff/admin pages
parent a67320b3
......@@ -28,12 +28,13 @@
// here might need to be fixed there too.
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'configusers/adminusers');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('adminusers', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'adminusers');
global $USER;
define('MENUITEM', $USER->get('admin') ? 'configusers/institutions' : 'configusers/institutionadmins');
require_once('pieforms/pieform.php');
$smarty = smarty();
......
......@@ -28,12 +28,13 @@
// here might need to be fixed there too.
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'configusers/staffusers');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('staffusers', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'staffusers');
global $USER;
define('MENUITEM', $USER->get('admin') ? 'configusers/institutions' : 'configusers/institutionstaff');
require_once('pieforms/pieform.php');
$smarty = smarty();
......
......@@ -28,18 +28,18 @@
// here might need to be fixed there too.
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'configusers/institutionusers');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('adminusers', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'institutionusers');
global $USER;
define('MENUITEM', $USER->get('admin') ? 'configusers/institutions' : 'configusers/institutionusers');
require_once('pieforms/pieform.php');
require_once('institution.php');
$institutionelement = get_institution_selector(false);
global $USER;
$institution = param_alphanum('institution', false);
if (!$institution || !$USER->can_edit_institution($institution)) {
$institution = empty($institutionelement['value']) ? $institutionelement['defaultvalue'] : $institutionelement['value'];
......
......@@ -1324,13 +1324,13 @@ function admin_nav() {
'weight' => 20,
),
array(
'path' => 'configusers/staff',
'path' => 'configusers/institutionstaff',
'url' => 'admin/users/institutionstaff.php',
'title' => get_string('staffusers', 'admin'),
'weight' => 30,
),
array(
'path' => 'configusers/admin',
'path' => 'configusers/institutionadmins',
'url' => 'admin/users/institutionadmins.php',
'title' => get_string('adminusers', 'admin'),
'weight' => 40,
......@@ -1575,12 +1575,10 @@ function find_menu_children(&$menu, $path) {
}
foreach ($menu as $key => $item) {
if (
defined('MENUITEM') &&
((MENUITEM == '' && $item['path'] == '') ||
($item['path'] != '' && $item['path'] == substr(MENUITEM, 0, strlen($item['path']))))) {
$item['selected'] = true;
}
$len = strlen($item['path']);
$item['selected'] = defined('MENUITEM')
&& ($item['path'] == MENUITEM
|| ($item['path'] . '/' == substr(MENUITEM, 0, strlen($item['path'])+1)));
if (
($path == '' && $item['path'] == '') ||
($item['path'] != '' && substr($item['path'], 0, strlen($path)) == $path && !preg_match('%/%', substr($item['path'], strlen($path) + 1)))) {
......
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