]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21125 removing obsolete global $THEME
authorPetr Skoda <skodak@moodle.org>
Wed, 23 Dec 2009 18:23:21 +0000 (18:23 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 23 Dec 2009 18:23:21 +0000 (18:23 +0000)
blocks/upgrade.txt
lib/pagelib.php
lib/setup.php
mod/upgrade.txt

index f7239e1c06ab8b6bf6be1c652d262a9e0eed4614..4eec74c02afb0f4acf8fa577d53cd45a0d9492da 100644 (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:
index 6c63b678c8a967237ece4c5cb58bbbefd7402f57..d7151b677f6113ea61eac2bd6e9332357afd94bb 100644 (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');
         }
 
index a78979b43bfb5dae82416f724bf528a251739c42..0aa0212883536139813ff8e7508437f33bebf70d 100644 (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
index 30df086fd085ccfc2086923744ced2759d92d571..bc8192162309fe3b90b833b2b5f49f925fde3c45 100644 (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: