]> git.mjollnir.org Git - moodle.git/commitdiff
navigation MDL-20521 Changed procedure for hidden admin pages
authorsamhemelryk <samhemelryk>
Tue, 20 Oct 2009 03:31:19 +0000 (03:31 +0000)
committersamhemelryk <samhemelryk>
Tue, 20 Oct 2009 03:31:19 +0000 (03:31 +0000)
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

index ddd9c7efa435481bd01ce11705734b4d98061dab..04d32be25fdffb40e7389240f81ae24ad6e464f6 100644 (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');