Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
authored June 05, 2008

Showing 1 changed file with 7 additions and 6 deletions. Show diff stats Hide diff stats

  1. 13  mod/scorm/datamodels/scorm_13lib.php
13  mod/scorm/datamodels/scorm_13lib.php
@@ -115,10 +115,10 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
115 115
                 if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) {
116 116
                     $icon = 'plus';
117 117
                 }
118  
-                $result->toc .= '<a href="javascript:expandCollide(img'.$sublist.',s'.$sublist.','.$nextsco->id.');">'.
  118
+                $result->toc .= "\t\t".'<li><a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');">'.
119 119
                                 '<img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
120 120
             } else if ($isvisible) {
121  
-                $result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />';
  121
+                $result->toc .= "\t\t".'<li><img src="'.$scormpixdir.'/spacer.gif" />';
122 122
             }
123 123
             if (empty($sco->title)) {
124 124
                 $sco->title = $sco->identifier;
@@ -224,15 +224,16 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
224 224
               function expandCollide(which,list,item) {
225 225
                   var nn=document.ids?true:false
226 226
                   var w3c=document.getElementById?true:false
227  
-                  var beg=nn?"document.ids.":w3c?"document.getElementById(":"document.all.";
228  
-                  var mid=w3c?").style":".style";
  227
+                  var beg=nn?"document.ids.":w3c?"document.getElementById(\'":"document.all.";
  228
+                  var mid=w3c?"\').style":".style";
229 229
 
  230
+                  which = which.substring(0,(which.length));
230 231
                   if (eval(beg+list+mid+".display") != "none") {
231  
-                      which.src = "'.$scormpixdir.'/plus.gif";
  232
+                      document.getElementById(which).src = "'.$scormpixdir.'/plus.gif";
232 233
                       eval(beg+list+mid+".display=\'none\';");
233 234
                       new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
234 235
                   } else {
235  
-                      which.src = "'.$scormpixdir.'/minus.gif";
  236
+                      document.getElementById(which).src = "'.$scormpixdir.'/minus.gif";
236 237
                       eval(beg+list+mid+".display=\'block\';");
237 238
                       new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
238 239
                   }

0 notes on commit ca2b78b

Please sign in to comment.
Something went wrong with that request. Please try again.