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

index cb3e56fd997d1302029d3c496c1e0bdb5225e006..2a4b7d55d512671c0f0a9b30b9e2e5e56dad1fc1 100755 (executable)
     $strscorm  = get_string('modulename', 'scorm');
     $strpopup = get_string('popup','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> ->";
     }