Breadcrumbs: mod/workshop changes
authormattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 21:35:36 +0000 (21:35 +0000)
committermattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 21:35:36 +0000 (21:35 +0000)
- Modified to use build_navigation() for breadcrumb generation.

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

mod/workshop/assess.php
mod/workshop/assessments.php
mod/workshop/index.php
mod/workshop/submissions.php
mod/workshop/upload.php
mod/workshop/view.php
mod/workshop/viewassessment.php

index ebe11ac977a2d7eb7599d9c0ae5918c793fa2e03..f4cfebec09ea0546fb68e79b06c77ec3c8a8d6c4 100644 (file)
     if ($frameset == "top") {
         // removed <base target="_parent" />
         // because it does not validate MDL-7861
-        print_header_simple(format_string($workshop->name), "",
-                     "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
-                      <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> -> $strassess",
+        $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+        $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+        $crumbs[] = array('name' => $strassess, 'link' => '', 'type' => 'title');
+        $navigation = build_navigation($crumbs, $course);
+        
+        print_header_simple(format_string($workshop->name), "",$navigation,
                       "", '', true);
 
         // there can be an assessment record (for teacher submissions), if there isn't...
index 451b70d4edf38472baf1bd217556dfe542032a8c..e2150838ba68e2d56eb88667b527da035211511c 100644 (file)
     require_login($course->id, false, $cm);
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 
-    $navigation = "";
-    if ($course->id != SITEID) {
-        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
-    }
-
     $strworkshops = get_string("modulenameplural", "workshop");
     $strworkshop  = get_string("modulename", "workshop");
     $strassessments = get_string("assessments", "workshop");
 
     // ... print the header and...
-    print_header_simple(format_string($workshop->name), "",
-                 "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
-                  <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> -> $strassessments",
+    
+    $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strassessments, 'link' => '', 'type' => 'title');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple(format_string($workshop->name), "", $navigation,
                   "", "", true);
 
     /*************** add comment to assessment (by author, assessor or teacher) ***************************/
index 5e9aae0988157ae3de259c86235083f6e528856c..09f3374b642e753cf597435a1cf59aa21d7174d8 100644 (file)
     $strinfo = get_string("grade")."/".$strinfo = get_string("phase", "workshop");
     $strdeadline = get_string("deadline", "workshop");
     $strsubmitted = get_string("submitted", "assignment");
-
-    print_header_simple("$strworkshops", "", "$strworkshops", "", "", true, "", navmenu($course));
+    
+    $crumbs[] = array('name' => $strworkshops, 'link' => '', 'type' => 'activity');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple("$strworkshops", "", $navigation, "", "", true, "", navmenu($course));
 
     if (! $workshops = get_all_instances_in_course("workshop", $course)) {
         notice("There are no workshops", "../../course/view.php?id=$course->id");
index b71a82358e93c6704c0fa37126787bdd05e37588..cdb028049e139574cbc76de9fc483d767ddda755 100644 (file)
     $strsubmissions = get_string("submissions", "workshop");
 
     // ... print the header and...
-    print_header_simple(format_string($workshop->name), "",
-                 "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
-                  <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> -> $strsubmissions",
+    $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple(format_string($workshop->name), "", $navigation,
                   "", "", true);
 
     //...get the action or set up an suitable default
index 8559b92135210955c8941f4a810b1674ba14dd94..3b880aa347def6c0033edb527212bd2485101246 100644 (file)
     $strworkshop = get_string('modulename', 'workshop');
     $strsubmission = get_string('submission', 'workshop');
 
-    print_header_simple(format_string($workshop->name)." : $strsubmission", "",
-                 "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
-                  <a href=\"view.php?a=$workshop->id\">".format_string($workshop->name,true)."</a> -> $strsubmission",
+    $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strsubmission, 'link' => '', 'type' => 'title');
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($workshop->name)." : $strsubmission", "", $navigation,
                   "", "", true);
     $timenow = time();
 
index df70c59bddff7cfb6f3e262aea8f04f95ecabfce..8cca3b6d94cba05c1cfe0eee70fab82b5b1cefb9 100644 (file)
     }
 
     // ...display header...
-    print_header_simple(format_string($workshop->name), "",
-                 "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
-                  <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> $straction",
+    $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    if ($straction) {
+        $crumbs[] = array('name' => $straction, 'link' => '', 'type' => 'title');
+    }
+    $navigation = build_navigation($crumbs, $course);    
+    
+    print_header_simple(format_string($workshop->name), "", $navigation,
                   "", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm));
 
 
index cba5bbd1e49e200eafcd78b1bb22ef11fe1edcc6..7ea7d29171c2302261e8f5733c47736a5c697a6e 100644 (file)
     /// top frame with the navigation bar and the assessment form
 
     if ($frameset == "top") {
-
+        $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+        $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+        $crumbs[] = array('name' => $strassess, 'link' => '', 'type' => 'title');
+        $navigation = build_navigation($crumbs, $course);
+        
         // removed <base target="_parent" /> as it does not validate
-        print_header_simple(format_string($workshop->name), "",
-                     "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
-                      <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> -> $strassess",
+        print_header_simple(format_string($workshop->name), "", $navigation,
                       "", '', true);
 
         // show assessment but don't allow changes