MDL-21125 removing obsolete global $THEME

This commit is contained in:
Petr Skoda
2009-12-23 18:23:21 +00:00
parent f6794ace8b
commit cbcc9852e0
4 changed files with 7 additions and 17 deletions
+1
View File
@@ -13,6 +13,7 @@ required changes in code:
* rewrite backup/restore
* theme changes: move plugin styles into blocks/xxx/styles.css and use new css markers for images,
move all images into new blocks/xxx/pix/ directory and use new outputlib api
old global $THEME is fully replaced by $OUTPUT
optional - no changes needed in older code:
+3 -9
View File
@@ -944,18 +944,13 @@ class moodle_page {
/**
* Force this page to use a particular theme.
*
* Please use this cautiously. It is only intended to be used by the themes selector
* admin page, and theme/styles.php.
* Please use this cautiously. It is only intended to be used by the themes selector admin page.
*
* @param $themename the name of the theme to use.
*/
public function force_theme($themename) {
global $PAGE, $THEME;
$this->ensure_theme_not_set();
$this->_theme = theme_config::load($themename);
if ($this === $PAGE) {
$THEME = $this->_theme;
}
}
/**
@@ -1025,10 +1020,10 @@ class moodle_page {
*
* Make sure the right theme for this page is loaded. Tell our
* blocks_manager about the theme block regions, and then, if
* we are $PAGE, set up the globals $THEME and $OUTPUT.
* we are $PAGE, set up the global $OUTPUT.
*/
public function initialise_theme_and_output() {
global $OUTPUT, $PAGE, $SITE, $THEME;
global $OUTPUT, $PAGE, $SITE;
if (!empty($this->_wherethemewasinitialised)) {
return;
@@ -1047,7 +1042,6 @@ class moodle_page {
$this->_theme->setup_blocks($this->pagelayout, $this->blocks);
if ($this === $PAGE) {
$THEME = $this->_theme;
$OUTPUT = $this->get_renderer('core');
}
+2 -8
View File
@@ -110,19 +110,13 @@ global $COURSE;
* to change something that affects the current theme ($PAGE->course, logged in use,
* httpsrequried ... will result in an exception.)
*
* Please note the $OUTPUT is replacing the old global $THEME object.
*
* @global object $OUTPUT
* @name $OUTPUT
*/
global $OUTPUT;
/**
* $THEME is a global that defines the current theme.
*
* @global theme_config $THEME
* @name THEME
*/
global $THEME;
/**
* Shared memory cache.
* @global object $MCACHE
+1
View File
@@ -22,6 +22,7 @@ required changes in code:
* theme changes: move plugin styles into mod/xxx/styles.css and use new css markers for images,
move all images into new mod/xxx/pix/ directory and use new outputlib api
move module icon to mod/xxx/pix/icon.gif
old global $THEME is fully replaced by $OUTPUT
optional - no changes needed in older code: