From: mattc-catalyst Date: Mon, 16 Apr 2007 22:02:22 +0000 (+0000) Subject: Breadcrumbs: course admin changes X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e1d2eb00e268ce5c5f891f70a7f2df7c0e8041b9;p=moodle.git Breadcrumbs: course admin changes - Modified to use build_navigation() for breadcrumb generation. Author: Matt Clarkson --- diff --git a/course/mod.php b/course/mod.php index be25298f18..548fde2571 100644 --- a/course/mod.php +++ b/course/mod.php @@ -646,8 +646,7 @@ } else { $pageheading = get_string("addinganew", "moodle", $fullmodulename); } - $strnav = ''; - + $CFG->pagepath = 'mod/'.$module->name; if (!empty($type)) { $CFG->pagepath .= '/' . $type; @@ -672,10 +671,12 @@ } else { $focuscursor = "form.name"; } - - print_header_simple($streditinga, '', - "wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural -> - $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); diff --git a/course/modedit.php b/course/modedit.php index 56e2b50c75..a09a3fdb14 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -56,7 +56,6 @@ } else { $pageheading = get_string("addinganew", "moodle", $fullmodulename); } - $strnav = ''; $CFG->pagepath = 'mod/'.$module->name; if (!empty($type)) { @@ -110,7 +109,9 @@ } else { $pageheading = get_string("updatinga", "moodle", $fullmodulename); } - $strnav = "wwwroot/mod/$module->name/view.php?id=$cm->id\">".format_string($form->name,true)." ->"; + + $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; @@ -296,10 +297,16 @@ $streditinga = get_string("editinga", "moodle", $fullmodulename); $strmodulenameplural = get_string("modulenameplural", $module->name); - - print_header_simple($streditinga, '', - "wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural -> - $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);