Skip to content

Commit

Permalink
MDL-21125 obsoleting global $THEME
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Dec 23, 2009
1 parent 92e01ab commit 088ccb4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 28 deletions.
10 changes: 2 additions & 8 deletions filter/mediaplugin/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,9 @@ function filter($text) {
/// 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++;
Expand Down
16 changes: 16 additions & 0 deletions lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2137,6 +2137,22 @@ public function rarrow() {
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;
}
}


Expand Down
11 changes: 3 additions & 8 deletions lib/resourcelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 2 additions & 6 deletions mod/hotpot/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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">';

Expand Down
8 changes: 2 additions & 6 deletions mod/hotpot/mediaplayers/moodle/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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&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';
Expand Down

0 comments on commit 088ccb4

Please sign in to comment.