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

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

mod/survey/index.php
mod/survey/report.php
mod/survey/save.php
mod/survey/view.php

index 27609b7fa9b3c41f619c95d9b20cdf78540eae47..b8238ee919e957adbfd800b27bce6d9da3585250 100644 (file)
     $strstatus = get_string("status");
     $strdone  = get_string("done", "survey");
     $strnotdone  = get_string("notdone", "survey");
-
-    print_header_simple("$strsurveys", "", "$strsurveys", 
+    
+    $crumbs[] = array('name' => $strsurveys, 'link' => '', 'type' => 'activity');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple("$strsurveys", "", $navigation, 
                  "", "", true, "", navmenu($course));
 
     if (! $surveys = get_all_instances_in_course("survey", $course)) {
index 113f107dc257746cd30b0cff2a55067593f4fc1c..1d7e49a15127e5f5a3cdbe50dddef524245d3e1d 100644 (file)
         $navigation = "<a href=\"index.php?id=$course->id\">$strsurveys</a> ->
                        <a href=\"view.php?id=$cm->id\">".format_string($survey->name,true)."</a> -> ";
     }
-
-    print_header("$course->shortname: ".format_string($survey->name), $course->fullname, "$navigation $strreport",
+    
+    $crumbs[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($survey->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strreport, 'link' => '', 'type' => 'title');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header("$course->shortname: ".format_string($survey->name), $course->fullname, $navigation,
                  "", "", true,
                  update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm));
 
index c5a3885a9246e478f707ba1d3933f925e4c9846c..25f075b7e8ca4dcfb429d88a96efc3defa0b6fe1 100644 (file)
 
     add_to_log($course->id, "survey", "submit", "view.php?id=$cm->id", "$survey->id", "$cm->id");
 
+    $strsurveys = get_string("modulenameplural", "survey");
+    $strsurveysaved = get_string("surveysaved", "survey");
+    $crumbs[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strsurveysaved, 'link' => '', 'type' => 'title');
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple("$strsurveysaved", "", $navigation, "");
+
+
     if (survey_already_done($survey->id, $USER->id)) {
         notice(get_string("alreadysubmitted", "survey"), $_SERVER["HTTP_REFERER"]);
         exit;
 
 // Print the page and finish up.
 
-    $strsurveys = get_string("modulenameplural", "survey");
-    $strsurveysaved = get_string("surveysaved", "survey");
-
-    print_header_simple("$strsurveysaved", "",
-        "<a href=\"index.php?id=$course->id\">$strsurveys</a> -> ".format_string($survey->name)." -> $strsurveysaved", "");
-
-
     notice(get_string("thanksforanswers","survey", $USER->firstname), "$CFG->wwwroot/course/view.php?id=$course->id");
 
     exit;
index 18f2eac703bd348dfb71529eb95d297648154cb7..a04a6e750d6b525cfbf481822e7e4b6e29f1b5f3 100644 (file)
     $strsurveys = get_string("modulenameplural", "survey");
     $strsurvey = get_string("modulename", "survey");
 
-    print_header_simple(format_string($survey->name), "",
-                 "<a href=\"index.php?id=$course->id\">$strsurveys</a> -> ".format_string($survey->name), "", "", true,
+    $crumbs[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');;
+    $crumbs[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinistance');
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($survey->name), "", $navigation, "", "", true,
                   update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm));
 
 /// Check to see if groups are being used in this survey