]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed navigation bar links for SCORM course format
authorbobopinna <bobopinna>
Wed, 12 Apr 2006 06:13:29 +0000 (06:13 +0000)
committerbobopinna <bobopinna>
Wed, 12 Apr 2006 06:13:29 +0000 (06:13 +0000)
mod/scorm/view.php

index 414daa661066e1679331b5dc8485426a2666a361..64dd861fa7858615327658853d9f64e81e70bb95 100755 (executable)
     $strscorms = get_string("modulenameplural", "scorm");
     $strscorm  = get_string("modulename", "scorm");
 
-    if ($course->category) {
-        $navigation = "<a target=\"{$CFG->framename}\" href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
-                       <a target=\"{$CFG->framename}\" href=\"index.php?id=$course->id\">$strscorms</a> ->";
+    if ($course->category != 0) { 
+        $navigation = "<a target=\"{$CFG->framename}\" href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
+        if ($scorms = get_all_instances_in_course('scorm', $course)) {
+            // The module SCORM activity with the least id is the course  
+            $firstscorm = current($scorms);
+            if (!(($course->format == 'scorm') && ($firstscorm->id == $scorm->id))) {
+                $navigation .= "<a target=\"{$CFG->framename}\" href=\"index.php?id=$course->id\">$strscorms</a> ->";
+            }       
+        }
     } else {
         $navigation = "<a target=\"{$CFG->framename}\" href=\"index.php?id=$course->id\">$strscorms</a> ->";
     }