navigation MDL-20521 Changed procedure for hidden admin pages

Admin pages were originally skipped over and not added to the navigation, however this means we don't know where in the navigation structure we are on display, now we add hidden pages to the structure and force them to not display.
This commit is contained in:
samhemelryk 2009-10-20 03:31:19 +00:00
parent bcca62a442
commit 8140c44094

View File

@ -2444,7 +2444,7 @@ class settings_navigation extends navigation_node {
}
// Return the branch key
return $branchkey;
} else if ($adminbranch->check_access() && !$adminbranch->is_hidden()) {
} else if ($adminbranch->check_access()) {
// We have a reference branch that we can access and is not hidden `hurrah`
// Now we need to display it and any children it may have
$url = null;
@ -2458,6 +2458,11 @@ class settings_navigation extends navigation_node {
// Add the branch
$branchkey = $referencebranch->add($adminbranch->visiblename, $url, self::TYPE_SETTING, null, null, $icon);
$reference = $referencebranch->get($branchkey);
if ($adminbranch->is_hidden()) {
$reference->display = false;
}
// Check if we are generating the admin notifications and whether notificiations exist
if ($adminbranch->name === 'adminnotifications' && admin_critical_warnings_present()) {
$reference->add_class('criticalnotification');