From: samhemelryk Date: Tue, 20 Oct 2009 03:31:19 +0000 (+0000) Subject: navigation MDL-20521 Changed procedure for hidden admin pages X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8140c440943175ec5e3b94f6371c4ae33fe98e82;p=moodle.git 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. --- diff --git a/lib/navigationlib.php b/lib/navigationlib.php index ddd9c7efa4..04d32be25f 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -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');