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

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

mod/choice/index.php
mod/choice/report.php
mod/choice/view.php

index 66681a7f9812a5cb93b5f413c5a5b5ef4f07d1b4..77dc4314bb8c89a978e3c624c9ce4496da0aa620 100644 (file)
 
     $strchoice = get_string("modulename", "choice");
     $strchoices = get_string("modulenameplural", "choice");
+    $crumbs[] = array('name' => $strchoices, 'link' => '', 'type' => 'activity');
+    $navigation = build_navigation($crumbs, $course);
 
-    print_header_simple("$strchoices", "",
-                 "$strchoices", "", "", true, "", navmenu($course));
+    print_header_simple("$strchoices", "", $navigation, "", "", true, "", navmenu($course));
 
 
     if (! $choices = get_all_instances_in_course("choice", $course)) {
index ac9355175da0dc7bdd67d403a7030c724863099e..bba22546e59381665f50879ac9ee3ccfa4ffbc17 100644 (file)
     }
         
     if ($download <> "xls" and $download <> "txt" and $download <> "ods") {
-        print_header_simple(format_string($choice->name).": $strresponses", "",
-                 "<a href=\"index.php?id=$course->id\">$strchoices</a> ->
-                  <a href=\"view.php?id=$cm->id\">".format_string($choice->name,true)."</a> -> $strresponses", "", '', true,
+       
+        $crumbs[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+        $crumbs[] = array('name' => format_string($choice->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+        $crumbs[] = array('name' => $strresponses, 'link' => '', 'type' => 'title');
+
+        $navigation = build_navigation($crumbs, $course);    
+    
+        print_header_simple(format_string($choice->name).": $strresponses", "", $navigation, "", '', true,
                   update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
     }
 
index 5673836771947a49c9e9a6053608a8340984bb0d..387fdaf3d8a10e49c1a85953356c7b04fcec6467 100644 (file)
 
 
 /// Display the choice and possibly results
+    $crumbs[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($choice->name), 'link' => '', 'type' => 'activityinstance');
+    
+    $navigation = build_navigation($crumbs, $course);
 
-
-    print_header_simple(format_string($choice->name), "",
-                 "<a href=\"index.php?id=$course->id\">$strchoices</a> -> ".format_string($choice->name), "", "", true,
+    print_header_simple(format_string($choice->name), "", $navigation, "", "", true,
                   update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
 
     add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", $choice->id, $cm->id);