output MDL-24683 Fixed up premature initialisation of theme and output through the admin structure.

This commit is contained in:
Sam Hemelryk 2010-10-15 02:04:17 +00:00
parent 019ae3e1c3
commit b4c91012d4
2 changed files with 11 additions and 1 deletions

View File

@ -331,7 +331,12 @@ if ($hassiteconfig) {
if (empty($CFG->enablewebservices)) {
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
}
$wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
// We cannot use $OUTPUT this early, doing so means that we lose the ability
// to set the page layout on all admin pages.
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
$wsdoclink = html_writer::tag('a', get_string('supplyinfo'),array('href'=>$url));
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', get_string('enablewsdocumentation',
'admin'), get_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
$ADMIN->add('webservicesettings', $temp);

View File

@ -1203,6 +1203,11 @@ class moodle_page {
public function initialise_theme_and_output() {
global $OUTPUT, $PAGE, $SITE;
// If you have lost all blocks on a page and cannot work out why
// try uncommenting this this debugging line and seeing what you get.
// Chances are the theme and output are being initialised prematurely.
// debugging('Initialising theme and output with layout '.$this->_pagelayout, DEBUG_DEVELOPER);
if (!empty($this->_wherethemewasinitialised)) {
return;
}