]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15899 JavaScript error In IE7 when opening SCORM content in a new window. Fix...
authorpiers <piers>
Thu, 31 Jul 2008 22:16:30 +0000 (22:16 +0000)
committerpiers <piers>
Thu, 31 Jul 2008 22:16:30 +0000 (22:16 +0000)
mod/scorm/player.php

index f6d9d543d6ff52f854747fc5c592d75041fc1adf..9b69ebad09c8fabc255d694194b0c6670f632315 100755 (executable)
 
             echo "                <iframe id=\"scoframe1\" class=\"scoframe\" name=\"scoframe1\" src=\"{$fullurl}\"></iframe>\n";   
         } else {
-?>
+            // Clean the name for the window as IE is fussy
+            $name = ereg_replace("[^A-Za-z0-9]", "", $scorm->name);
+            if (!$name) {
+                $name = 'DefaultPlayerWindow';
+            }
+            $name = 'scorm_'.$name;
+            ?>
                     <script type="text/javascript">
                     //<![CDATA[
                                        scorm_resize();
                         url = "loadSCO.php?id=<?php echo $cm->id.$scoidpop ?>";
                         width = <?php p($scorm->width) ?>;
                         height = <?php p($scorm->height) ?>;
-                        var main = openpopup(url, "<?php p($scorm->name) ?>", "<?php p($scorm->options) ?>", width, height);
+                        var main = openpopup(url, "<?php p($name) ?>", "<?php p($scorm->options) ?>", width, height);
                    //]]>
                     </script>
                     <noscript>