Created
November 21, 2013 20:22
-
-
Save samhemelryk/7588922 to your computer and use it in GitHub Desktop.
Force the courses branch in the navigation to populate itself and to always be shown expanded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/navigationlib.php b/lib/navigationlib.php | |
index d1c873f..452d956 100644 | |
--- a/lib/navigationlib.php | |
+++ b/lib/navigationlib.php | |
@@ -1137,6 +1137,12 @@ class global_navigation extends navigation_node { | |
$canviewcourseprofile = true; | |
+ // Tell the navigation to always load all courses. | |
+ // Default behaviour is load the courses by AJAX, we want them there from word go. | |
+ $this->load_all_courses(); | |
+ // And expand the courses branch by default. | |
+ $this->rootnodes['courses']->force_open(); | |
+ | |
// Next load context specific content into the navigation | |
switch ($this->page->context->contextlevel) { | |
case CONTEXT_SYSTEM : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment