in XML source files of HP quizzes, convert relative URLs to absolute URLs in links using window.open(...)

This commit is contained in:
gbateson
2007-06-26 05:02:03 +00:00
parent 9036033b8a
commit ce197abbef
+7
View File
@@ -1535,6 +1535,13 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
$this->source = preg_replace($search, $replace, $this->source);
} else {
// relative URLs in <a ... onclick="window.open('...')...">...</a>
$search = '|'.'(?<='.'onclick=&quot;'."window.open\\(&apos;".')'."(.*?)".'(?='."&apos;\\);return false;".'&quot;)'.'|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';