]> git.mjollnir.org Git - moodle.git/commitdiff
themes: MDL-19077 Don't need both output_starting_hook and starting_output method...
authortjhunt <tjhunt>
Tue, 14 Jul 2009 05:14:45 +0000 (05:14 +0000)
committertjhunt <tjhunt>
Tue, 14 Jul 2009 05:14:45 +0000 (05:14 +0000)
lib/moodlelib.php
lib/outputlib.php
lib/pagelib.php

index cd0eb8117fea7ae03a15b16bf2a7f23d1daf1be0..708210593291a27d9f658e0eefd87174ef6a618e 100644 (file)
@@ -8473,30 +8473,6 @@ function moodle_request_shutdown() {
     }
 }
 
-/**
- * This function is called when output is started. This is a chance for Moodle core
- * to check things like whether the messages popup should be shown.
- */
-function output_starting_hook() {
-    global $CFG, $PAGE;
-
-    // If maintenance mode is on, change the page header.
-    if (!empty($CFG->maintenance_enabled)) {
-        $PAGE->set_button('<a href="' . $CFG->wwwroot . '/' . $CFG->admin .
-                '/settings.php?section=maintenancemode">' . get_string('maintenancemode', 'admin') .
-                '</a> ' . $PAGE->button);
-
-        $title = $PAGE->title;
-        if ($title) {
-            $title .= ' - ';
-        }
-        $PAGE->set_title($title . get_string('maintenancemode', 'admin'));
-    }
-
-    // Show the messaging popup, if there are messages.
-    message_popup_window();
-}
-
 /**
  * If new messages are waiting for the current user, then load the
  * JavaScript required to pop up the messaging window.
index 2381dbe70ea432ce9a6a9e96c66ed65c8a42784c..3809989d8cf91e2a2f209ccb1a41250f56afc50e 100644 (file)
@@ -1823,7 +1823,6 @@ class moodle_core_renderer extends moodle_renderer_base {
     // TODO remove $navigation and $menu arguments - replace with $PAGE->navigation
         global $USER, $CFG;
 
-        output_starting_hook();
         $this->page->set_state(moodle_page::STATE_PRINTING_HEADER);
 
         // Find the appropriate page template, based on $this->page->generaltype.
index 7c1a822ab39a13d2db7b6e9feba4205a86fafb29..5beed2160635c3cbcf5d585c9405b7bc51f14060 100644 (file)
@@ -853,7 +853,7 @@ class moodle_page {
      * state. This is our last change to initialise things.
      */
     protected function starting_output() {
-        global $SITE, $CFG;
+        global $CFG;
 
         $this->initialise_standard_body_classes();
 
@@ -861,6 +861,22 @@ class moodle_page {
             $this->blocks->load_blocks();
         }
 
+        // If maintenance mode is on, change the page header.
+        if (!empty($CFG->maintenance_enabled)) {
+            $this->set_button('<a href="' . $CFG->wwwroot . '/' . $CFG->admin .
+                    '/settings.php?section=maintenancemode">' . get_string('maintenancemode', 'admin') .
+                    '</a> ' . $this->button);
+    
+            $title = $this->title;
+            if ($title) {
+                $title .= ' - ';
+            }
+            $this->set_title($title . get_string('maintenancemode', 'admin'));
+        }
+    
+        // Show the messaging popup, if there are messages.
+        message_popup_window();
+
         // 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 ' .