/// 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++;
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;
+ }
}
* @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
*/
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">';
/// 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(.*?)href=\"([^<]+)\.mp3\"([^>]*)>(.*?)<\/a>/is';