Skip to content

Commit

Permalink
themes: MDL-19077 Don't need both output_starting_hook and starting_o…
Browse files Browse the repository at this point in the history
…utput method on page.
  • Loading branch information
tjhunt committed Jul 14, 2009
1 parent 485e466 commit 144390b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
24 changes: 0 additions & 24 deletions lib/moodlelib.php
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion lib/outputlib.php
Expand Up @@ -1823,7 +1823,6 @@ public function header($navigation = '', $menu='') {
// 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.
Expand Down
18 changes: 17 additions & 1 deletion lib/pagelib.php
Expand Up @@ -853,14 +853,30 @@ public function https_required() {
* state. This is our last change to initialise things.
*/
protected function starting_output() {
global $SITE, $CFG;
global $CFG;

$this->initialise_standard_body_classes();

if (!during_initial_install()) {
$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 ' .
Expand Down

0 comments on commit 144390b

Please sign in to comment.