From: gbateson Date: Tue, 26 Jun 2007 05:05:06 +0000 (+0000) Subject: in XML source files of HP quizzes, convert relative URLs to absolute URLs in links... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bb7c8ac7976d60ddac41e0bf6c269270e08d64ee;p=moodle.git in XML source files of HP quizzes, convert relative URLs to absolute URLs in links using window.open(...) --- diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index 6fd5fab74c..97d9fc6fdf 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -1535,6 +1535,12 @@ class hotpot_xml_quiz extends hotpot_xml_tree { $this->source = preg_replace($search, $replace, $this->source); } else { + + // relative URLs in ... + $search = '|'.'(?<='.'onclick="'."window.open\\('".')'."(.*?)".'(?='."'\\);return false;".'")'.'|ise'; + $replace = "hotpot_convert_url('".$this->get_baseurl()."','".$this->reference."','\\1')"; + $this->source = preg_replace($search, $replace, $this->source); + if ($this->parse_xml) { $this->filetype = 'xml';