Commit a0eb0249 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add navigation for staff to access the user search page



Although this is currently just for user searches, using the terms
"Site Information" for site staff, and "Institution Information" for
institution staff will allow us to add site/institution statistics
under the same menu.

Change-Id: I40bae94406a1a6f16b428e3821f3be1ec41ae52d
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 6266cae9
......@@ -543,6 +543,8 @@ $string['findgroups'] = 'Find Groups';
$string['returntosite'] = 'Return to Site';
$string['siteadministration'] = 'Site Administration';
$string['institutionadministration'] = 'Institution Administration';
$string['siteinformation'] = 'Site Information';
$string['institutioninformation'] = 'Institution Information';
$string['unreadmessages'] = 'unread messages';
$string['unreadmessage'] = 'unread message';
......
......@@ -2070,6 +2070,21 @@ function institutional_admin_nav() {
}
/**
* Returns the entries in the staff menu
*
* @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,
),
);
}
/**
* Returns the entries in the standard user menu
......@@ -2176,9 +2191,17 @@ function mahara_standard_nav() {
* Builds a data structure representing the menu for Mahara.
*/
function main_nav() {
if (defined('ADMIN') || defined('INSTITUTIONALADMIN')) {
if (in_admin_section()) {
global $USER;
$menu = $USER->get('admin') ? admin_nav() : institutional_admin_nav();
if ($USER->get('admin')) {
$menu = admin_nav();
}
else if ($USER->is_institutional_admin()) {
$menu = institutional_admin_nav();
}
else {
$menu = staff_nav();
}
}
else {
// Build the menu structure for the site
......
......@@ -23,12 +23,16 @@
{/if}
</li>
{/foreach}
{if $ADMIN || $INSTITUTIONALADMIN}
{if $ADMIN || $INSTITUTIONALADMIN || $STAFF || $INSTITUTIONALSTAFF}
<li><span><a href="{$WWWROOT}" accesskey="h" class="return-site">{str tag="returntosite"}</a></span></li>
{elseif $USER->get('admin')}
<li><span><a href="{$WWWROOT}admin/" accesskey="a" class="admin-site">{str tag="siteadministration"}</a></span></li>
{elseif $USER->is_institutional_admin()}
<li><span><a href="{$WWWROOT}admin/users/search.php" accesskey="a" class="admin-user">{str tag="institutionadministration"}</a></span></li>
{elseif $USER->get('staff')}
<li><span><a href="{$WWWROOT}admin/users/search.php" accesskey="a" class="admin-user">{str tag="siteinformation"}</a></span></li>
{elseif $USER->is_institutional_staff()}
<li><span><a href="{$WWWROOT}admin/users/search.php" accesskey="a" class="admin-user">{str tag="institutioninformation"}</a></span></li>
{/if}
{/strip}
</ul>
......
......@@ -6,12 +6,16 @@
{foreach from=$MAINNAV item=item}
<li{if $item.selected} class="selected"{/if}><span><a href="{$WWWROOT}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if} class="{if $item.path}{$item.path}{else}dashboard{/if}">{$item.title}</a></span></li>
{/foreach}
{if $ADMIN || $INSTITUTIONALADMIN}
{if $ADMIN || $INSTITUTIONALADMIN || $STAFF || $INSTITUTIONALSTAFF}
<li><span><a href="{$WWWROOT}" accesskey="h" class="return-site">{str tag="returntosite"}</a></span></li>
{elseif $USER->get('admin')}
<li><span><a href="{$WWWROOT}admin/" accesskey="a" class="admin-site">{str tag="siteadministration"}</a></span></li>
{elseif $USER->is_institutional_admin()}
<li><span><a href="{$WWWROOT}admin/users/search.php" accesskey="a" class="admin-user">{str tag="institutionadministration"}</a></span></li>
{elseif $USER->get('staff')}
<li><span><a href="{$WWWROOT}admin/users/search.php" accesskey="a" class="admin-user">{str tag="siteinformation"}</a></span></li>
{elseif $USER->is_institutional_staff()}
<li><span><a href="{$WWWROOT}admin/users/search.php" accesskey="a" class="admin-user">{str tag="institutioninformation"}</a></span></li>
{/if}
{/strip}</ul>
......
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