Skip to content

Commit

Permalink
navigation MDL-20521 Changed procedure for hidden admin pages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samhemelryk committed Oct 20, 2009
1 parent bcca62a commit 8140c44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2444,7 +2444,7 @@ protected function load_administration_settings($referencebranch=null, $adminbra
}
// 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;
Expand All @@ -2458,6 +2458,11 @@ protected function load_administration_settings($referencebranch=null, $adminbra
// 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');
Expand Down

0 comments on commit 8140c44

Please sign in to comment.