Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added string_format to the title print

  • Loading branch information...
commit e1992096aec3d5584d1ea37d17d89a1f4d6409a1 1 parent 24d8f4f
authored August 01, 2005

Showing 1 changed file with 18 additions and 13 deletions. Show diff stats Hide diff stats

  1. 31  mod/scorm/lib.php
31  mod/scorm/lib.php
@@ -1214,10 +1214,13 @@ function scorm_get_toc($scorm,$liststyle,$currentorg='',$scoid='',$mode='normal'
1214 1214
     global $USER, $CFG;
1215 1215
 
1216 1216
     $strexpand = get_string('expcoll','scorm');
1217  
-
  1217
+    
  1218
+    $result = new stdClass();
1218 1219
     $result->toc = "<ul id='0' class='$liststyle'>";
  1220
+    $result->prerequisites = true;
1219 1221
     $incomplete = false;
1220 1222
     $organizationsql = '';
  1223
+    
1221 1224
     if (!empty($currentorg)) {
1222 1225
         $organizationsql = "AND organization='$currentorg'";
1223 1226
     }
@@ -1239,6 +1242,7 @@ function scorm_get_toc($scorm,$liststyle,$currentorg='',$scoid='',$mode='normal'
1239 1242
         $previd = 0;
1240 1243
         $nextid = 0;
1241 1244
         $parents[$level]='/';
  1245
+        
1242 1246
         foreach ($scoes as $sco) {
1243 1247
             if ($parents[$level]!=$sco->parent) {
1244 1248
                 if ($newlevel = array_search($sco->parent,$parents)) {
@@ -1323,7 +1327,7 @@ function scorm_get_toc($scorm,$liststyle,$currentorg='',$scoid='',$mode='normal'
1323 1327
                     if ($sco->id == $scoid) {
1324 1328
                         $result->prerequisites = true;
1325 1329
                     }
1326  
-                    $result->toc .= "&nbsp;$startbold<a href='javascript:playSCO(".$sco->id.");'>$sco->title</a> $score$endbold</li>\n";
  1330
+                    $result->toc .= "&nbsp;$startbold<a href='javascript:playSCO(".$sco->id.");'>".format_string($sco->title)."</a> $score$endbold</li>\n";
1327 1331
                 } else {
1328 1332
                     if ($sco->id == $scoid) {
1329 1333
                         $result->prerequisites = false;
@@ -1337,20 +1341,21 @@ function scorm_get_toc($scorm,$liststyle,$currentorg='',$scoid='',$mode='normal'
1337 1341
         for ($i=0;$i<$level;$i++) {
1338 1342
             $result->toc .= "\t\t</ul></li>\n";
1339 1343
         }
  1344
+        
  1345
+        if ($play) {
  1346
+            $sco = new stdClass();
  1347
+            $sco->id = $scoid;
  1348
+            $sco->prev = $previd;
  1349
+            $sco->next = $nextid;
  1350
+            $sco->showprev = $showprev;
  1351
+            $sco->shownext = $shownext;
  1352
+            $result->sco = $sco;
  1353
+        } else {
  1354
+            $result->incomplete = $incomplete;
  1355
+        }
1340 1356
     }
1341 1357
     $result->toc .= "\t</ul>\n";
1342 1358
     
1343  
-    if ($play) {
1344  
-        unset($sco);
1345  
-        $sco->id = $scoid;
1346  
-        $sco->prev = $previd;
1347  
-        $sco->next = $nextid;
1348  
-        $sco->showprev = $showprev;
1349  
-        $sco->shownext = $shownext;
1350  
-        $result->sco = $sco;
1351  
-    } else {
1352  
-        $result->incomplete = $incomplete;
1353  
-    }
1354 1359
     return $result;
1355 1360
 }
1356 1361
 ?>

0 notes on commit e199209

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