navigation MDL-23323 Site pages content is ALWAYS generated now so that it is available when JS is disabled

This commit is contained in:
Sam Hemelryk 2010-07-23 02:38:59 +00:00
parent 0dd819c7e1
commit 14d35a26a5

View File

@ -948,13 +948,17 @@ class global_navigation extends navigation_node {
$this->load_all_courses();
}
// We always load the frontpage course to ensure it is available without
// JavaScript enabled.
$frontpagecourse = $this->load_course($SITE);
$this->add_front_page_course_essentials($frontpagecourse, $SITE);
// Next load context specific content into the navigation
switch ($this->page->context->contextlevel) {
case CONTEXT_SYSTEM :
case CONTEXT_COURSECAT :
// Load the front page course navigation
$coursenode = $this->load_course($SITE);
$this->add_front_page_course_essentials($coursenode, $SITE);
// This has already been loaded we just need to map the variable
$coursenode = $frontpagecourse;
break;
case CONTEXT_BLOCK :
case CONTEXT_COURSE :