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

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

course/mod.php
course/modedit.php

index be25298f18610f3aa5fca57225aad46292b974b8..548fde2571535611bd2e2a9e3f7e5bbfc0ea7faa 100644 (file)
         } else {
             $pageheading = get_string("addinganew", "moodle", $fullmodulename);
         }
-        $strnav = '';
-
+        
         $CFG->pagepath = 'mod/'.$module->name;
         if (!empty($type)) {
             $CFG->pagepath .= '/' . $type;
     } else {
         $focuscursor = "form.name";
     }
-
-    print_header_simple($streditinga, '',
-     "<a href=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</a> ->
-     $strnav $streditinga", $focuscursor, "", false);
+    
+    $crumbs[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => $streditinga, 'link' => '', 'type' => 'action');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple($streditinga, '', $navigation, $focuscursor, "", false);
 
     if (!empty($cm->id)) {
         $context = get_context_instance(CONTEXT_MODULE, $cm->id);
index 56e2b50c754ce499bad3611601ded261b952d37f..a09a3fdb1435156cd4dc654c4467f737ed8727ae 100644 (file)
@@ -56,7 +56,6 @@
         } else {
             $pageheading = get_string("addinganew", "moodle", $fullmodulename);
         }
-        $strnav = '';
 
         $CFG->pagepath = 'mod/'.$module->name;
         if (!empty($type)) {
         } else {
             $pageheading = get_string("updatinga", "moodle", $fullmodulename);
         }
-        $strnav = "<a href=\"$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id\">".format_string($form->name,true)."</a> ->";
+        
+        $crumbsinstancename = array('name' => format_string($form->name,true), 'link' => "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id", 'type' => 'activityinstance');
+       
         $CFG->pagepath = 'mod/'.$module->name;
         if (!empty($type)) {
             $CFG->pagepath .= '/'.$type;
         
         $streditinga = get_string("editinga", "moodle", $fullmodulename);
         $strmodulenameplural = get_string("modulenameplural", $module->name);
-
-        print_header_simple($streditinga, '',
-         "<a href=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</a> ->
-         $strnav $streditinga", $mform->focus(), "", false);
+        
+        $crumbs[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity');
+        if (isset($crumbsinstancename)) {
+            $crumbs[] = $crumbsinstancename;
+        }
+        $crumbs[] = array('name' => $streditinga, 'link' => '', 'type' => 'title');
+        
+        $navigation = build_navigation($crumbs, $course);
+        
+        print_header_simple($streditinga, '', $navigation, $mform->focus(), "", false);
 
         if (!empty($cm->id)) {
             $context = get_context_instance(CONTEXT_MODULE, $cm->id);