mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
fix MDL-12318: from Moodle 1.8 onward, the HotPot module has its own mediaplugin filter, because teh standard Moodle "filter/mediaplugin" can no longer insert media players into Javascript.
This commit is contained in:
parent
f548abb84c
commit
1cd4d9dffe
1 changed files with 4 additions and 3 deletions
|
@ -1730,7 +1730,8 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
|
||||||
|
|
||||||
// make sure the Moodle media plugin is available
|
// make sure the Moodle media plugin is available
|
||||||
global $CFG;
|
global $CFG;
|
||||||
include_once "$CFG->dirroot/filter/mediaplugin/filter.php";
|
//include_once "$CFG->dirroot/filter/mediaplugin/filter.php";
|
||||||
|
include_once "$CFG->dirroot/mod/hotpot/mediaplayers/moodle/filter.php";
|
||||||
|
|
||||||
// exclude swf files from the filter
|
// exclude swf files from the filter
|
||||||
//$CFG->filter_mediaplugin_ignore_swf = true;
|
//$CFG->filter_mediaplugin_ignore_swf = true;
|
||||||
|
@ -1757,7 +1758,7 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
|
||||||
$link_url = "/{$tagopen}a{$space}href=$quote($filepath)$quote.*?$tagclose.*?$tagreopen\/A$tagclose/is";
|
$link_url = "/{$tagopen}a{$space}href=$quote($filepath)$quote.*?$tagclose.*?$tagreopen\/A$tagclose/is";
|
||||||
|
|
||||||
// extract <object> tags
|
// extract <object> tags
|
||||||
preg_match_all("/{$tagopen}object\s.*?{$tagclose}(.*?){$tagreopen}\/object{$tagclose}/is", $this->html, $objects);
|
preg_match_all("/{$tagopen}object\s.*?{$tagclose}(.*?)(?:{$tagreopen}\/object{$tagclose})+/is", $this->html, $objects);
|
||||||
|
|
||||||
$i_max = count($objects[0]);
|
$i_max = count($objects[0]);
|
||||||
for ($i=0; $i<$i_max; $i++) {
|
for ($i=0; $i<$i_max; $i++) {
|
||||||
|
@ -1776,7 +1777,7 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
|
||||||
$url = preg_replace('/^[^?]*\?([^=]+=[^&]*&)*[^=]+=([^&]*)$/', '$2', $url, 1);
|
$url = preg_replace('/^[^?]*\?([^=]+=[^&]*&)*[^=]+=([^&]*)$/', '$2', $url, 1);
|
||||||
$link = '<a href="'.$url.'">'.$txt.'</a>';
|
$link = '<a href="'.$url.'">'.$txt.'</a>';
|
||||||
|
|
||||||
$new_object = mediaplugin_filter($this->filedir, $link);
|
$new_object = hotpot_mediaplayer_moodle($this, $link);
|
||||||
$new_object = str_replace($link, '', $new_object);
|
$new_object = str_replace($link, '', $new_object);
|
||||||
$new_object = str_replace('&', '&', $new_object);
|
$new_object = str_replace('&', '&', $new_object);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue