}
$result->toc .= "\t</ul>\n";
if ($scorm->hidetoc == 0) {
- $result->toc .= '
- <script type="text/javascript">
- //<![CDATA[
- function expandCollide(which,list,item) {
- var el = document.ids ? document.ids[list] : document.getElementById ? document.getElementById(list) : document.all[list];
- which = which.substring(0,(which.length));
- var el2 = document.ids ? document.ids[which] : document.getElementById ? document.getElementById(which) : document.all[which];
- if (el.style.display != "none") {
- el2.src = "'.$scormpixdir.'/plus.gif";
- el.style.display=\'none\';
- new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
- } else {
- el2.src = "'.$scormpixdir.'/minus.gif";
- el.style.display=\'block\';
- new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
- }
- }
- //]]>
- </script>'."\n";
+ $result->toc .= $PAGE->requires->data_for_js('scormdata', Array('scormpixdir'=>$scormpixdir))->asap();
+ $result->toc .= $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js')->asap();
}
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr.'&scoid=';