themes: MDL-19077 Don't need both output_starting_hook and starting_output method on page.

This commit is contained in:
tjhunt 2009-07-14 05:14:45 +00:00
parent 485e46611a
commit 144390b4d9
3 changed files with 17 additions and 26 deletions

View 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.

View 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.

View 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 ' .