From 8140c440943175ec5e3b94f6371c4ae33fe98e82 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Tue, 20 Oct 2009 03:31:19 +0000 Subject: [PATCH] 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. --- lib/navigationlib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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'); -- 2.39.5