]> git.mjollnir.org Git - moodle.git/commitdiff
navigation MDL-20735 Patch to properly display front page actitivies on the navigation
authorSam Hemelryk <sam@moodle.com>
Thu, 10 Dec 2009 02:05:12 +0000 (02:05 +0000)
committerSam Hemelryk <sam@moodle.com>
Thu, 10 Dec 2009 02:05:12 +0000 (02:05 +0000)
lib/navigationlib.php

index 46d8349b9f8a432df5205ed42056af5f8a720206..8b298a39dc27b8f952ffed5f0909979a9ef6b609 100644 (file)
@@ -925,7 +925,13 @@ class global_navigation extends navigation_node {
             $contextlevel = 10;
         }
         $depth = 0;
-
+        
+        /**
+         * We always want to load the front page activities into the tree, these
+         * will appear at the bottom of the opening (site) node.
+         */
+        $sitekeys = array();
+        $this->load_course_activities($sitekeys, $SITE);
         switch ($contextlevel) {
             case CONTEXT_SYSTEM:
                 $this->cache->volatile();
@@ -1379,7 +1385,8 @@ class global_navigation extends navigation_node {
         if ($course===null) {
             $course = $PAGE->course;
         }
-        if (is_object($course)) {
+        if (is_object($course) && $course->id !== SITEID) {
+
             if (!$this->cache->cached('canviewhiddencourses')) {
                 $this->cache->canviewhiddencourses = has_capability('moodle/course:viewhiddencourses', $this->context);
             }