diff --git a/filter/mediaplugin/filter.php b/filter/mediaplugin/filter.php index aa36702cc67..40be83ae146 100644 --- a/filter/mediaplugin/filter.php +++ b/filter/mediaplugin/filter.php @@ -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++; diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 6c00352a538..29d87985e90 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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; + } } diff --git a/lib/resourcelib.php b/lib/resourcelib.php index 1b3d0d085c8..336942ab67f 100644 --- a/lib/resourcelib.php +++ b/lib/resourcelib.php @@ -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 diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index d43d14b4931..9094548743f 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -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 ''; diff --git a/mod/hotpot/mediaplayers/moodle/filter.php b/mod/hotpot/mediaplayers/moodle/filter.php index 0f895c56437..abbf572ac56 100644 --- a/mod/hotpot/mediaplayers/moodle/filter.php +++ b/mod/hotpot/mediaplayers/moodle/filter.php @@ -11,17 +11,13 @@ /// 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&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 } // $c = htmlentities($c); // Commented out pending bug 5223 $search = '/]*)>(.*?)<\/a>/is';