]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed bug mdl-7516
authorcsantossaenz <csantossaenz>
Fri, 15 Jun 2007 09:26:17 +0000 (09:26 +0000)
committercsantossaenz <csantossaenz>
Fri, 15 Jun 2007 09:26:17 +0000 (09:26 +0000)
mod/scorm/datamodels/scorm_12lib.php

index 9a18e7b710c49eab929963b6d9a82744896b8aae..e20da14cc68b0dc2420f4ad69ee64dc1cca6f2a1 100644 (file)
@@ -264,8 +264,8 @@ 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.'\',\''.$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>';
+               $result->toc .= $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="#" onclick="elementToggleHide(\''.$sublist.'\',true);"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
             } else if ($isvisible) {
                 $result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />';
             }
@@ -369,20 +369,21 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $result->toc .= '
           <script type="text/javascript">
           //<![CDATA[
-              function expandCollide(which,list,item) {
+               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 style=w3c?").style":".style";
-                  var mid=w3c?")":"";
+                  
+                  var mid=w3c?").style":".style";
+                                 which = which.substring(0,(which.length));
 
                   if (eval(beg+list+mid+".display") != "none") {
-                      eval(beg+which+mid+".src=\''.$scormpixdir.'/plus.gif\';");
-                      eval(beg+list+style+".display=\'none\';");
+                      document.getElementById(which).src = "'.$scormpixdir.'/plus.gif";
+                      eval(beg+list+mid+".display=\'none\';");
                       new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
                   } else {
-                      eval(beg+which+mid+".src=\''.$scormpixdir.'/minus.gif\';");
-                      eval(beg+list+style+".display=\'block\';");
+                      document.getElementById(which).src = "'.$scormpixdir.'/minus.gif";
+                      eval(beg+list+mid+".display=\'block\';");
                       new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
                   }
               }