Merge branch 'm20_MDL-26176_cleanup' of github.com:danmarsden/moodle
[moodle.git] / mod / scorm / loaddatamodel.php
index e4e0e13..73ebd04 100644 (file)
@@ -9,6 +9,11 @@
     $mode = optional_param('mode', '', PARAM_ALPHA); // navigation mode
     $attempt = required_param('attempt', PARAM_INT); // new attempt
 
+    //IE 6 Bug workaround
+    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false && ini_get('zlib.output_compression') == 'On') {
+        ini_set('zlib.output_compression', 'Off');
+    }
+    
     if (!empty($id)) {
         if (! $cm = get_coursemodule_from_id('scorm', $id)) {
             print_error('invalidcoursemodule');
@@ -33,7 +38,7 @@
         print_error('missingparameter');
     }
 
-    $url = new moodle_url($CFG->wwwroot.'/mod/scorm/loaddatamodel.php', array('scoid'=>$scoid, 'id'=>$cm->id,'attempt'=>$attempt));
+    $url = new moodle_url('/mod/scorm/loaddatamodel.php', array('scoid'=>$scoid, 'id'=>$cm->id,'attempt'=>$attempt));
     if ($mode !== '') {
         $url->param('mode', $mode);
     }
         print_error('cannotfindsco', 'scorm');
     }
     $scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR));   // Just to be safe
-    $PAGE->requires->js('lib/cookies.js')->asap();
     if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) {
-        include_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php');
+        include($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php');
     } else {
-        include_once($CFG->dirroot.'/mod/scorm/datamodels/scorm_12.js.php');
+        include($CFG->dirroot.'/mod/scorm/datamodels/scorm_12.js.php');
     }
-
     // set the start time of this SCO
     scorm_insert_track($USER->id,$scorm->id,$scoid,$attempt,'x.start.time',time());
 ?>