<script type="text/javascript">
<!--
window.onresize = function() {
- scorm_resize();
+ scorm_resize(<?php echo $scorm->width.", ".$scorm->height; ?>);
};
-->
</script>
<?php
if ($scorm->hidetoc == 0) {
?>
-
<div id="tocbox">
-
<?php
-
if ($scorm->hidenav ==0){
-
?>
-
<!-- Bottons nav at left-->
-
<div id="tochead">
-
<form name="tochead" method="post" action="player.php?id=<?php echo $cm->id ?>" target="_top">
-
<?php
-
$orgstr = '&currentorg='.$currentorg;
-
if (($scorm->hidenav == 0) && ($sco->previd != 0) && (!isset($sco->previous) || $sco->previous == 0)) {
-
-
// Print the prev LO button
-
$scostr = '&scoid='.$sco->previd;
-
$url = $CFG->wwwroot.'/mod/scorm/player.php?id='.$cm->id.$orgstr.$modestr.$scostr;
-
?>
-
<input name="prev" type="button" value="<?php print_string('prev','scorm') ?>" onClick="document.location.href=' <?php echo $url; ?> '"/>
-
<?php
-
}
-
-
-
if (($scorm->hidenav == 0) && ($sco->nextid != 0) && (!isset($sco->next) || $sco->next == 0)) {
-
// Print the next LO button
-
$scostr = '&scoid='.$sco->nextid;
-
$url = $CFG->wwwroot.'/mod/scorm/player.php?id='.$cm->id.$orgstr.$modestr.$scostr;
-
?>
-
<input name="next" type="button" value="<?php print_string('next','scorm') ?>" onClick="document.location.href=' <?php echo $url; ?> '"/>
-
<?php
-
}
-
?>
-
</form>
-
</div> <!-- tochead -->
-
<?php
-
}
?>
<div id="toctree" class="generalbox">
<?php echo $result->toc; ?>
</div> <!-- toctree -->
-
</div> <!-- tocbox -->
<?php
$class = ' class="toc"';
<?php
$orgstr = '&currentorg='.$currentorg;
if (($scorm->hidenav == 0) && ($sco->previd != 0) && (!isset($sco->previous) || $sco->previous == 0) && (($scorm->hidetoc == 2) || ($scorm->hidetoc == 1)) ) {
-
// Print the prev LO button
$scostr = '&scoid='.$sco->previd;
$url = $CFG->wwwroot.'/mod/scorm/player.php?id='.$cm->id.$orgstr.$modestr.$scostr;
?>
-
<form name="scormnavprev" method="post" action="player.php?id=<?php echo $cm->id ?>" target="_top" style= "display:inline">
-
<input name="prev" type="button" value="<?php print_string('prev','scorm') ?>" onClick="document.location.href=' <?php echo $url; ?> '"/>
-
</form>
-
<?php
}
if ($scorm->hidetoc == 2) {
echo $result->tocmenu;
}
if (($scorm->hidenav == 0) && ($sco->nextid != 0) && (!isset($sco->next) || $sco->next == 0) && (($scorm->hidetoc == 2) || ($scorm->hidetoc == 1))) {
-
-
// Print the next LO button
$scostr = '&scoid='.$sco->nextid;
$url = $CFG->wwwroot.'/mod/scorm/player.php?id='.$cm->id.$orgstr.$modestr.$scostr;
?>
-
<form name="scormnavnext" method="post" action="player.php?id=<?php echo $cm->id ?>" target="_top" style= "display:inline">
-
<input name="next" type="button" value="<?php print_string('next','scorm') ?>" onClick="document.location.href=' <?php echo $url; ?> '"/>
-
</form>
-
<?php
}
?>
-
</div>
<?php
}
<?php
if ($result->prerequisites) {
if ($scorm->popup == 0) {
- echo " <script type=\"text/javascript\">scorm_resize();</script>\n";
-
+ echo " <script type=\"text/javascript\">scorm_resize(".$scorm->width.", ".$scorm->height.");</script>\n";
$fullurl="loadSCO.php?id=".$cm->id.$scoidstr.$modestr;
-
echo " <iframe id=\"scoframe1\" class=\"scoframe\" name=\"scoframe1\" src=\"{$fullurl}\"></iframe>\n";
} else {
// Clean the name for the window as IE is fussy
?>
<script type="text/javascript">
//<![CDATA[
- scorm_resize();
+ scorm_resize(<?php echo $scorm->width.", ". $scorm->height; ?>);
function openpopup(url,name,options,width,height) {
fullurl = "<?php echo $CFG->wwwroot.'/mod/scorm/' ?>" + url;
windowobj = window.open(fullurl,name,options);
return ret;
}
-function scorm_resize () {
+function scorm_resize (cwidth, cheight) {
var winwidth = 0, winheight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
bottommargin+10; // +10 to save a minor vertical scroll always present!
var totalheighttoc = totalheight+imsnavheight;
+ // override total height with configured height if it is smaller
+ if (cheight >= 400 && winheight > cheight) {
+ winheight = cheight;
+ }
var toctree = document.getElementById('toctree');
if (toctree != null){
var toctreeHeight = toctree.offsetHeight;