]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21125 obsoleting global $THEME
authorPetr Skoda <skodak@moodle.org>
Wed, 23 Dec 2009 17:51:41 +0000 (17:51 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 23 Dec 2009 17:51:41 +0000 (17:51 +0000)
filter/mediaplugin/filter.php
lib/outputrenderers.php
lib/resourcelib.php
mod/hotpot/lib.php
mod/hotpot/mediaplayers/moodle/filter.php

index aa36702cc67ead9ed3defbc2155319ed1c9b30ba..40be83ae146f5aa10ad8221927d5dc37cf3a0dad 100644 (file)
@@ -129,15 +129,9 @@ class mediaplugin_filter extends moodle_text_filter {
 /// callback filter functions
 
 function mediaplugin_filter_mp3_callback($link) {
-    global $CFG, $THEME, $PAGE;
+    global $CFG, $OUTPUT, $PAGE;
 
-    if (!empty($THEME->filter_mediaplugin_colors)) {
-        $c = $THEME->filter_mediaplugin_colors;   // You can set this up in your theme/xxx/config.php
-    } else {
-        $c = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
-             'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
-             'waitForPlay=yes';
-    }
+    $c = $OUTPUT->filter_mediaplugin_colors();   // You can set this up in your theme/xxx/config.php
 
     static $count = 0;
     $count++;
index 6c00352a53854319febf196546a91aac17422c24..29d87985e903ed9095d8abcde0ea852a1db2c220 100644 (file)
@@ -2137,6 +2137,22 @@ class core_renderer extends renderer_base {
     public function larrow() {
         return $this->page->theme->larrow;
     }
+
+    /**
+     * Returns the colours of the small MP3 player
+     * @return string
+     */
+    public function filter_mediaplugin_colors() {
+        return $this->page->theme->filter_mediaplugin_colors;
+    }
+
+    /**
+     * Returns the colours of the big MP3 player
+     * @return string
+     */
+    public function resource_mp3player_colors() {
+        return $this->page->theme->resource_mp3player_colors;
+    }
 }
 
 
index 1b3d0d085c800b22171176bb699f91789885b856..336942ab67ff2edd1d4ca208cd129015ebb1e69b 100644 (file)
@@ -136,15 +136,10 @@ function resourcelib_embed_image($fullurl, $title) {
  * @return string html
  */
 function resourcelib_embed_mp3($fullurl, $title, $clicktoopen) {
-    global $CFG, $THEME, $PAGE;
+    global $CFG, $OUTPUT, $PAGE;
+
+    $c = $OUTPUT->resource_mp3player_colors();   // You can set this up in your theme/xxx/config.php
 
-    if (!empty($THEME->resource_mp3player_colors)) {
-        $c = $THEME->resource_mp3player_colors;   // You can set this up in your theme/xxx/config.php
-    } else {
-        $c = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
-             'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
-             'font=Arial&fontColour=FF33FF&buffer=10&waitForPlay=no&autoPlay=yes';
-    }
     $c .= '&volText='.get_string('vol', 'resource').'&panText='.get_string('pan','resource');
     $id = 'filter_mp3_'.time(); //we need something unique because it might be stored in text cache
 
index d43d14b4931e584f5743be9388648c10922975ef..9094548743f6afd436c73dbd8287199c01915e88 100644 (file)
@@ -1251,13 +1251,9 @@ function hotpot_get_recent_mod_activity(&$activities, &$index, $sincetime, $cour
  */
 function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
 
-    global $CFG, $THEME, $USER, $OUTPUT;
+    global $CFG, $USER, $OUTPUT;
 
-    if (isset($THEME->cellcontent2)) {
-        $bgcolor =  ' bgcolor="'.$THEME->cellcontent2.'"';
-    } else {
-        $bgcolor = '';
-    }
+    $bgcolor = '';
 
     print '<table border="0" cellpadding="3" cellspacing="0">';
 
index 0f895c56437dd87dee0bed0cdd6057c0467934d4..abbf572ac56a75427d192c4e14f41a34ca327d87 100644 (file)
 /// courseid and the text to be filtered (in HTML form).
 
 function hotpot_mediaplayer_moodle(&$hotpot, $text) {
-    global $CFG, $THEME;
+    global $CFG, $OUTPUT;
 
     if ($CFG->filter_mediaplugin_enable_mp3) {
         static $c;
 
         if (empty($c)) {
-            if (!empty($THEME->filter_mediaplugin_colors)) {
-                $c = $THEME->filter_mediaplugin_colors;   // You can set this up in your theme/xxx/config.php
-            } else {
-                $c = 'bgColour=000000&amp;btnColour=ffffff&amp;btnBorderColour=cccccc&amp;iconColour=000000&amp;iconOverColour=00cc00&amp;trackColour=cccccc&amp;handleColour=ffffff&amp;loaderColour=ffffff&amp;waitForPlay=yes&amp;';
-            }
+            $c = $OUTPUT->filter_mediaplugin_colors();   // You can set this up in your theme/xxx/config.php
         }
         // $c = htmlentities($c);  // Commented out pending bug 5223
         $search = '/<a(.*?)href=\"([^<]+)\.mp3\"([^>]*)>(.*?)<\/a>/is';