Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-11892 Fixed calls to expand javascript to correctly use quoted st…

…rings in all necessary places.
  • Loading branch information...
commit ca2b78b2d9337e84116c5111136f37a94b53a05e 1 parent 3a23a33
mchurch authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 mod/scorm/datamodels/scorm_13lib.php
13 mod/scorm/datamodels/scorm_13lib.php
View
@@ -115,10 +115,10 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) {
$icon = 'plus';
}
- $result->toc .= '<a href="javascript:expandCollide(img'.$sublist.',s'.$sublist.','.$nextsco->id.');">'.
+ $result->toc .= "\t\t".'<li><a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');">'.
'<img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
} else if ($isvisible) {
- $result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />';
+ $result->toc .= "\t\t".'<li><img src="'.$scormpixdir.'/spacer.gif" />';
}
if (empty($sco->title)) {
$sco->title = $sco->identifier;
@@ -224,15 +224,16 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
function expandCollide(which,list,item) {
var nn=document.ids?true:false
var w3c=document.getElementById?true:false
- var beg=nn?"document.ids.":w3c?"document.getElementById(":"document.all.";
- var mid=w3c?").style":".style";
+ var beg=nn?"document.ids.":w3c?"document.getElementById(\'":"document.all.";
+ var mid=w3c?"\').style":".style";
+ which = which.substring(0,(which.length));
if (eval(beg+list+mid+".display") != "none") {
- which.src = "'.$scormpixdir.'/plus.gif";
+ document.getElementById(which).src = "'.$scormpixdir.'/plus.gif";
eval(beg+list+mid+".display=\'none\';");
new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
} else {
- which.src = "'.$scormpixdir.'/minus.gif";
+ document.getElementById(which).src = "'.$scormpixdir.'/minus.gif";
eval(beg+list+mid+".display=\'block\';");
new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
}
Please sign in to comment.
Something went wrong with that request. Please try again.