]> git.mjollnir.org Git - moodle.git/commitdiff
Breadcrumbs: mod/scorm changes
authormattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 21:27:08 +0000 (21:27 +0000)
committermattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 21:27:08 +0000 (21:27 +0000)
- Modified to use build_navigation() for breadcrumb generation.

Author: Matt Clarkson <mattc@catalyst.net.nz>

mod/scorm/index.php
mod/scorm/player.php
mod/scorm/report.php
mod/scorm/view.php

index 37b7d3e4a753b211cbd33db097440b1d77b4a5a6..49b484a37cd831731b8808b7a180a032e8899ca7 100755 (executable)
     $strsummary = get_string("summary");
     $strreport = get_string("report",'scorm');
     $strlastmodified = get_string("lastmodified");
+    
+    $crumbs[] = array('name' => $strscorms, 'link' => '', 'type' => 'activity');
+    $navigation = build_navigation($crumbs, $course);
 
-    print_header_simple("$strscorms", "", "$strscorms",
+    print_header_simple("$strscorms", "", $navigation,
                  "", "", true, "", navmenu($course));
 
     if ($course->format == "weeks" or $course->format == "topics") {
index 93f37a17652b1452e41d866d4b7afdb44436b7be..8bbf656fbdbeeecac4d34551ae18b098b4be3674 100755 (executable)
     $strpopup = get_string('popup','scorm');
 
     if ($course->id != SITEID) {
-        $navigation = "<a $CFG->frametarget href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
         if ($scorms = get_all_instances_in_course('scorm', $course)) {
             // The module SCORM/AICC activity with the first id is the course  
             $firstscorm = current($scorms);
             if (!(($course->format == 'scorm') && ($firstscorm->id == $scorm->id))) {
-                $navigation .= "<a $CFG->frametarget href=\"index.php?id=$course->id\">$strscorms</a> ->";
+                $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity');
             }
         }
-    } else {
-        $navigation = "<a $CFG->frametarget href=\"index.php?id=$course->id\">$strscorms</a> ->";
     }
 
     $pagetitle = strip_tags("$course->shortname: ".format_string($scorm->name));
 
     if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE,$course->id))) {
-        print_header($pagetitle, $course->fullname,
-                 "$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
+        $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+        $navigation = build_navigation($crumbs, $course);
+        
+        print_header($pagetitle, $course->fullname, $navigation,
                  '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false);
         notice(get_string("activityiscurrentlyhidden"));
     }
     if ($scorm->popup == 1) {
         $bodyscript = 'onunload="main.close();"';
     }
-
+    
+    $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $navigation = build_navigation($crumbs, $course);
+    
     print_header($pagetitle, $course->fullname,
-                 "$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
+                 $navigation,
                  '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false, $bodyscript);
     if ($sco->scormtype == 'sco') {
 ?>
index 136366d23a332c54f0228bc33e81046391ef82e9..d3136c8e395b36744d47ee854713ce1ac374f338 100755 (executable)
 
 /// Print the page header
     if (empty($noheader)) {
-        if ($course->id != SITEID) {
-            $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
-        } else {
-            $navigation = '';
-        }
 
         $strscorms = get_string('modulenameplural', 'scorm');
         $strscorm  = get_string('modulename', 'scorm');
         $strreport  = get_string('report', 'scorm');
         $strattempt  = get_string('attempt', 'scorm');
         $strname  = get_string('name');
+        
+        $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+        $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+        
         if (empty($b)) {
             if (empty($a)) {
-                print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
-                             "$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
-                              -> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a> -> $strreport",
+                $navigation = build_navigation($crumbs, $course);
+                print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,$navigation,
                              '', '', true);
             } else {
+                
+                $crumbs[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title');    
+                $crumbs[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => '', 'type' => 'title');
+                $navigation = build_navigation($crumbs, $course);
+                    
                 print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
-                             "$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
-                              -> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
-                              -> <a href=\"report.php?id=$cm->id\">$strreport</a> -> $strattempt $attempt - ".fullname($userdata),
-                             '', '', true);
+                             $navigation, '', '', true);
             }
         } else {
-            print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
-                     "$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
-                      -> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
-                      -> <a href=\"report.php?id=$cm->id\">$strreport</a>
-                      -> <a href=\"report.php?a=$a&user=$user&attempt=$attempt\">$strattempt $attempt - ".fullname($userdata)."</a> -> $sco->title",
+            
+            $crumbs[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title');    
+            $crumbs[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => "report.php?a=$a&user=$user&attempt=$attempt", 'type' => 'title');
+            $crumbs[] = array('name' => $sco->title, 'link' => '', 'type' => 'title');
+            $navigation = build_navigation($crumbs, $course);
+            
+            print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, $navigation,
                      '', '', true);
         }
         print_heading(format_string($scorm->name));
index 1d547b1be071dbaaa78016990a24fc7af35633ca..cd913c134b9ac350df1e26011bb7ca21f1c236c1 100755 (executable)
     $strscorm  = get_string("modulename", "scorm");
 
     if ($course->id != SITEID) { 
-        $navigation = "<a $CFG->frametarget 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 $CFG->frametarget href=\"index.php?id=$course->id\">$strscorms</a> ->";
+                $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity');
             }       
         }
-    } else {
-        $navigation = "<a $CFG->frametarget href=\"index.php?id=$course->id\">$strscorms</a> ->";
     }
-
     $pagetitle = strip_tags($course->shortname.': '.format_string($scorm->name));
 
     add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id='.$cm->id, "$scorm->id");
     //
     // Print the page header
     //
-    print_header($pagetitle, $course->fullname,
-                 "$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
+    $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header($pagetitle, $course->fullname, $navigation,
                  '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm));
 
     if (empty($cm->visible) and !has_capability('moodle/course:manageactivities', $context)) {