MDL-11892 Propogate Fixes for 'calls to expand javascript' to SCORM 1.2 code. Minor syntax alignment in player.php.

This commit is contained in:
piers 2008-07-18 06:03:51 +00:00
parent 4644313b7c
commit 97852875da
3 changed files with 18 additions and 25 deletions

View file

@ -272,8 +272,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) { if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) {
$icon = 'plus'; $icon = 'plus';
} }
$result->toc .= '<a href="javascript:expandCollide(\'img'.$sublist.'\','.$sublist.','.$nextsco->id.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>'; $result->toc .= '<a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
// $result->toc .= '<a href="#" onclick="elementToggleHide(\''.$sublist.'\',true);"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
} else if ($isvisible) { } else if ($isvisible) {
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />'; $result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />';
} }
@ -381,20 +380,16 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
function expandCollide(which,list,item) { function expandCollide(which,list,item) {
var nn=document.ids?true:false var el = document.ids ? document.ids[list] : document.getElementById ? document.getElementById(list) : document.all[list];
var w3c=document.getElementById?true:false
var beg=nn?"document.ids.":w3c?"document.getElementById(":"document.all.";
var mid=w3c?").style":".style";
which = which.substring(0,(which.length)); which = which.substring(0,(which.length));
var el2 = document.ids ? document.ids[which] : document.getElementById ? document.getElementById(which) : document.all[which];
if (eval(beg+list+mid+".display") != "none") { if (el.style.display != "none") {
document.getElementById(which).src = "'.$scormpixdir.'/plus.gif"; el2.src = "'.$scormpixdir.'/plus.gif";
eval(beg+list+mid+".display=\'none\';"); el.style.display=\'none\';
new cookie("hide:SCORMitem" + item, 1, 356, "/").set(); new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
} else { } else {
document.getElementById(which).src = "'.$scormpixdir.'/minus.gif"; el2.src = "'.$scormpixdir.'/minus.gif";
eval(beg+list+mid+".display=\'block\';"); el.style.display=\'block\';
new cookie("hide:SCORMitem" + item, 1, -1, "/").set(); new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
} }
} }

View file

@ -226,19 +226,16 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
function expandCollide(which,list,item) { function expandCollide(which,list,item) {
var nn=document.ids?true:false var el = document.ids ? document.ids[list] : document.getElementById ? document.getElementById(list) : document.all[list];
var w3c=document.getElementById?true:false
var beg=nn?"document.ids.":w3c?"document.getElementById(\'":"document.all.";
var mid=w3c?"\').style":".style";
which = which.substring(0,(which.length)); which = which.substring(0,(which.length));
if (eval(beg+list+mid+".display") != "none") { var el2 = document.ids ? document.ids[which] : document.getElementById ? document.getElementById(which) : document.all[which];
document.getElementById(which).src = "'.$scormpixdir.'/plus.gif"; if (el.style.display != "none") {
eval(beg+list+mid+".display=\'none\';"); el2.src = "'.$scormpixdir.'/plus.gif";
el.style.display=\'none\';
new cookie("hide:SCORMitem" + item, 1, 356, "/").set(); new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
} else { } else {
document.getElementById(which).src = "'.$scormpixdir.'/minus.gif"; el2.src = "'.$scormpixdir.'/minus.gif";
eval(beg+list+mid+".display=\'block\';"); el.style.display=\'block\';
new cookie("hide:SCORMitem" + item, 1, -1, "/").set(); new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
} }
} }

View file

@ -351,6 +351,7 @@
width = <?php p($scorm->width) ?>; width = <?php p($scorm->width) ?>;
height = <?php p($scorm->height) ?>; 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($scorm->name) ?>", "<?php p($scorm->options) ?>", width, height);
//]]>
</script> </script>
<noscript> <noscript>
<iframe id="main" class="scoframe" src="loadSCO.php?id=<?php echo $cm->id.$scoidstr.$modestr ?>"> <iframe id="main" class="scoframe" src="loadSCO.php?id=<?php echo $cm->id.$scoidstr.$modestr ?>">