Breadcrumbs: course admin changes

- Modified to use build_navigation() for breadcrumb generation.


Author: Matt Clarkson <mattc@catalyst.net.nz>
This commit is contained in:
mattc-catalyst 2007-04-16 22:02:22 +00:00
parent d91f99a655
commit e1d2eb00e2
2 changed files with 20 additions and 12 deletions

View file

@ -646,7 +646,6 @@
} else { } else {
$pageheading = get_string("addinganew", "moodle", $fullmodulename); $pageheading = get_string("addinganew", "moodle", $fullmodulename);
} }
$strnav = '';
$CFG->pagepath = 'mod/'.$module->name; $CFG->pagepath = 'mod/'.$module->name;
if (!empty($type)) { if (!empty($type)) {
@ -673,9 +672,11 @@
$focuscursor = "form.name"; $focuscursor = "form.name";
} }
print_header_simple($streditinga, '', $crumbs[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity');
"<a href=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</a> -> $crumbs[] = array('name' => $streditinga, 'link' => '', 'type' => 'action');
$strnav $streditinga", $focuscursor, "", false); $navigation = build_navigation($crumbs, $course);
print_header_simple($streditinga, '', $navigation, $focuscursor, "", false);
if (!empty($cm->id)) { if (!empty($cm->id)) {
$context = get_context_instance(CONTEXT_MODULE, $cm->id); $context = get_context_instance(CONTEXT_MODULE, $cm->id);

View file

@ -56,7 +56,6 @@
} else { } else {
$pageheading = get_string("addinganew", "moodle", $fullmodulename); $pageheading = get_string("addinganew", "moodle", $fullmodulename);
} }
$strnav = '';
$CFG->pagepath = 'mod/'.$module->name; $CFG->pagepath = 'mod/'.$module->name;
if (!empty($type)) { if (!empty($type)) {
@ -110,7 +109,9 @@
} else { } else {
$pageheading = get_string("updatinga", "moodle", $fullmodulename); $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; $CFG->pagepath = 'mod/'.$module->name;
if (!empty($type)) { if (!empty($type)) {
$CFG->pagepath .= '/'.$type; $CFG->pagepath .= '/'.$type;
@ -297,9 +298,15 @@
$streditinga = get_string("editinga", "moodle", $fullmodulename); $streditinga = get_string("editinga", "moodle", $fullmodulename);
$strmodulenameplural = get_string("modulenameplural", $module->name); $strmodulenameplural = get_string("modulenameplural", $module->name);
print_header_simple($streditinga, '', $crumbs[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity');
"<a href=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</a> -> if (isset($crumbsinstancename)) {
$strnav $streditinga", $mform->focus(), "", false); $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)) { if (!empty($cm->id)) {
$context = get_context_instance(CONTEXT_MODULE, $cm->id); $context = get_context_instance(CONTEXT_MODULE, $cm->id);