From 94398fb3e852b50fa12cecb314f27fffeb98bb91 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 3 Jul 2009 09:03:50 +0000 Subject: [PATCH] MDL-19696 make sure install works. --- lang/en_utf8/moodle.php | 1 + lib/pagelib.php | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index d1901b3634..5129fce865 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1192,6 +1192,7 @@ $string['outline'] = 'Outline'; $string['outlinereport'] = 'Outline report'; $string['page'] = 'Page'; $string['pageheaderconfigablock'] = 'Configuring a block in %%fullname%%'; +$string['pageshouldredirect'] = 'This page should automatically redirect. If nothing is happening please use the continue link below.'; $string['parentcategory'] = 'Parent category'; $string['parentcoursenotfound'] = 'Parent course not found!'; $string['parentcoursenotmetacourse'] = 'Parent course not metacourse!'; diff --git a/lib/pagelib.php b/lib/pagelib.php index a57ae0f359..7f0c049f15 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -855,20 +855,12 @@ class moodle_page { protected function starting_output() { global $SITE, $CFG; - if (during_initial_install()) { - $this->_course = new stdClass; - $this->_course->id = 1; - moodle_setlocale(); - return; - } + $this->initialise_standard_body_classes(); - if (!$this->_course) { - $this->set_course($SITE); + if (!during_initial_install()) { + $this->blocks->load_blocks(); } - $this->initialise_standard_body_classes(); - $this->blocks->load_blocks(); - // Add any stylesheets required using the horrible legacy mechanism. if (!empty($CFG->stylesheets)) { debugging('Some code on this page is using the horrible legacy mechanism $CFG->stylesheets to include links to ' . @@ -896,7 +888,7 @@ class moodle_page { public function initialise_theme_and_output() { global $OUTPUT, $PAGE, $SITE, $THEME; - if (!$this->_course) { + if (!$this->_course && !during_initial_install()) { $this->set_course($SITE); } @@ -1039,27 +1031,22 @@ class moodle_page { } $this->add_body_class($this->_legacyclass); - $this->add_body_class('course-' . $this->_course->id); $this->add_body_classes(get_browser_version_classes()); $this->add_body_class('dir-' . get_string('thisdirection')); $this->add_body_class('lang-' . current_language()); $this->add_body_class('yui-skin-sam'); // Make YUI happy, if it is used. - $this->add_body_class($this->url_to_class_name($CFG->wwwroot)); - $this->add_body_class('context-' . $this->context->id); - - if (!empty($this->_cm)) { - $this->add_body_class('cmid-' . $this->_cm->id); + if (!during_initial_install()) { + $this->add_body_class('course-' . $this->_course->id); + $this->add_body_class('context-' . $this->context->id); } - $this->add_body_class('context-' . $this->context->id); - if (!empty($this->_cm)) { $this->add_body_class('cmid-' . $this->_cm->id); } - if ($CFG->allowcategorythemes) { + if (!empty($CFG->allowcategorythemes)) { $this->ensure_category_loaded(); foreach ($this->_categories as $catid => $notused) { $this->add_body_class('category-' . $catid); -- 2.39.5