MDL-14492 Provide feedback to user about redirect delay in loadsco.php. backport to 1.9.
This commit is contained in:
@@ -156,5 +156,5 @@ $string['unziperror'] = 'An error occurs during package unzip';
|
||||
$string['othersettings'] = 'Additional settings';
|
||||
$string['updatefreq'] = 'Auto-update frequency';
|
||||
$string['options'] = 'Options';
|
||||
|
||||
$string['activityloading'] = "You will be automatically redirected to the activity in"; // used in conjunction with numseconds
|
||||
?>
|
||||
|
||||
+19
-5
@@ -112,20 +112,34 @@
|
||||
$result = get_file_url($scorm->course .'/'. $basedir .'/'. $launcher);
|
||||
}
|
||||
}
|
||||
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>LoadSCO</title>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
setTimeout('document.location = "<?php echo $result ?>";',<?php echo $delayseconds ?>000);
|
||||
//]]>
|
||||
function doredirect() {
|
||||
var e = document.getElementById("countdown");
|
||||
var cSeconds = parseInt(e.innerHTML);
|
||||
var timer = setInterval(function() {
|
||||
if( cSeconds ) {
|
||||
e.innerHTML = --cSeconds;
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
document.body.innerHTML = "Activity loading, please wait ....";
|
||||
location = "<?php echo $result ?>";
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="<?php echo $delayseconds ?>;url=<?php echo $result ?>" />
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
<body onload="doredirect();">
|
||||
<p><?php echo get_string('activityloading', 'scorm');?> <span id="countdown"><?php echo $delayseconds ?></span> <?php echo get_string('numseconds');?>. <img src='<?php echo $scormpixdir;?>/wait.gif'><p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user