}
}
-/**
- * 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.
// 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.
* state. This is our last change to initialise things.
*/
protected function starting_output() {
- global $SITE, $CFG;
+ global $CFG;
$this->initialise_standard_body_classes();
$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 ' .