From 83797643716fcd3c04ea9597b36e69195c8dee61 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 10 Dec 2009 02:05:12 +0000 Subject: [PATCH] navigation MDL-20735 Patch to properly display front page actitivies on the navigation --- lib/navigationlib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 46d8349b9f..8b298a39dc 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -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); } -- 2.39.5