]> git.mjollnir.org Git - moodle.git/commitdiff
change relative URLs to absolute URLs in window.open(...)
authorgbateson <gbateson>
Tue, 26 Jun 2007 02:48:19 +0000 (02:48 +0000)
committergbateson <gbateson>
Tue, 26 Jun 2007 02:48:19 +0000 (02:48 +0000)
mod/hotpot/lib.php

index 9fa07d8e9d3b4bdf62d62a3a1cc87a20db8f32a3..6fd5fab74c7438c998837f10f91662a0461c50d4 100644 (file)
@@ -1529,6 +1529,11 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
                 $replace = "hotpot_convert_navbutton_url('".$this->get_baseurl()."','".$this->reference."','\\1','".$this->course."')";
                 $this->source = preg_replace($search, $replace, $this->source);
 
+                // relative URLs in <a ... onclick="window.open('...')...">...</a>
+                $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);
+
             } else {
                 if ($this->parse_xml) {