- Modified to use build_navigation() for breadcrumb generation.
Author: Matt Clarkson <mattc@catalyst.net.nz>
$strglossaries = get_string('modulenameplural', 'glossary');
$strglossary = get_string('modulename', 'glossary');
$strcomments = get_string('comments', 'glossary');
-
- print_header_simple(format_string($glossary->name), '',
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> <a href=\"view.php?id=$cm->id\">".format_string($glossary->name,true)."</a> -> <a href=\"comments.php?id=$cm->id&eid=$entry->id\">$strcomments</a> -> " . $straction,
+
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+ $crumbs[] = array('name' => $strcomments, 'link' => "comments.php?id=$cm->id&eid=$entry->id", 'type' => 'title');
+ $crumbs[] = array('name' => $straction, 'link' => '', 'type' => 'action');
+
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), '', $navigation,
'', '', true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
/// print original glossary entry for any comment action (add, update, delete)
$strcomments = get_string("comments", "glossary");
$straddcomment = get_string("addcomment", "glossary");
- print_header_simple(strip_tags("$strcomments: $entry->concept"), "",
- "<a href=index.php?id=$course->id>$strglossaries</a> -> <a href=view.php?id=$cm->id>".format_string($glossary->name,true)."</a> -> $strcomments",
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+ $crumbs[] = array('name' => $strcomments, 'link' => '', 'type' => 'title');
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(strip_tags("$strcomments: $entry->concept"), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$strareyousuredelete = get_string("areyousuredelete","glossary");
- print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> ".format_string($glossary->name),
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+
+$navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$strglossaries = get_string("modulenameplural", "glossary");
$stredit = empty($e) ? get_string('addentry', 'glossary') : get_string("edit");
+$crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+$crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+$crumbs[] = array('name' => $stredit, 'link' => '', 'type' => 'title');
-print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> ->
- <a href=\"view.php?id=$cm->id\">".format_string($glossary->name,true)."</a> -> $stredit", "",
+$navigation = build_navigation($crumbs, $course);
+
+print_header_simple(format_string($glossary->name), "", $navigation, "",
"", true, "", navmenu($course, $cm));
$strglossaries = get_string("modulenameplural", "glossary");
$strglossary = get_string("modulename", "glossary");
- print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> <a href=\"view.php?id=$cm->id&tab=GLOSSARY_CATEGORY_VIEW\">".format_string($glossary->name,true)."</a> -> " . get_string("categories","glossary"),
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id&tab=GLOSSARY_CATEGORY_VIEW", 'type' => 'activityinstance');
+ $crumbs[] = array('name' => get_string("categories","glossary"), 'link' => '', 'type' => 'title');
+
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$strexportfile = get_string("exportfile", "glossary");
$strexportentries = get_string('exportentries', 'glossary');
- print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
- "<a href=\"view.php?id=$id\">" .format_string($glossary->name) . "</a> -> " .
- $strexportentries,
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), "",$navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$entryalreadyexist = get_string('entryalreadyexist','glossary');
$entryexported = get_string('entryexported','glossary');
- print_header_simple(format_string($glossary->name), '',
- '<a href="index.php?id='.$course->id.'">'.$strglossaries.'</a> -> '.format_string($glossary->name),
- '', '', true, '',
- navmenu($course, $cm));
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm));
if ( $PermissionGranted ) {
$entry = get_record('glossary_entries', 'id', $entry);
$strmodulename = get_string("modulename", "glossary");
$strdisplayformats = get_string("displayformats","glossary");
- print_header("$strmodulename: $strconfiguration", $site->fullname,
- "<a href=\"../../$CFG->admin/index.php\">$stradmin</a> -> ".
- "<a href=\"../../$CFG->admin/configure.php\">$strconfiguration</a> -> ".
- "<a href=\"../../$CFG->admin/modules.php\">$strmanagemodules</a> -> <a href=\"../../$CFG->admin/module.php?module=glossary&sesskey=$USER->sesskey\">$strmodulename</a> -> $strdisplayformats");
+ $crumbs[] = array('name' => $stradmin, 'link' => "../../$CFG->admin/index.php", 'type' => 'core');
+ $crumbs[] = array('name' => $strconfiguration, 'link' => "../../$CFG->admin/configure.php", 'type' => 'core');
+ $crumbs[] = array('name' => $strmanagemodules, 'link' => "../../$CFG->admin/modules.php", 'type' => 'core');
+ $crumbs[] = array('name' => $strmodulename, 'link' => "../../$CFG->admin/module.php?module=glossary&sesskey=$USER->sesskey", 'type' => 'core');
+ $crumbs[] = array('name' => $strdisplayformats, 'link' => '', 'type' => 'core');
+
+ $navigation = build_navigation($crumbs);
+
+ print_header("$strmodulename: $strconfiguration", $site->fullname, $navigation);
print_heading($strmodulename . ': ' . get_string("displayformats","glossary"));
$strsearch = get_string("search");
$strimportentries = get_string('importentriesfromxml', 'glossary');
- print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
- "<a href=\"view.php?id=$id\">" .format_string($glossary->name) . "</a> -> " .
- $strimportentries,
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+ $crumbs[] = array('name' => $strimportentries, 'link' => '', 'type' => 'title');
+
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
/// Print the header
-
- print_header_simple("$strglossarys", "", "$strglossarys", "", "", true, "", navmenu($course));
+ $crumbs[] = array('name' => $strglossarys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple("$strglossarys", "", $navigation, "", "", true, "", navmenu($course));
/// Get all the appropriate data
$CFG->framename = "newwindow";
if ($course->id != SITEID) {
- print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
- "<a target=\"newwindow\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $strglossaries -> $strsearch", "", "", true, " ", " ");
+ $crumbs[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity');
+ $crumbs[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
+
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, " ", " ");
} else {
print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
"$strglossaries -> $strsearch", "", "", true, " ", " ");
$strsearch = get_string("search");
$strwaitingapproval = get_string('waitingapproval', 'glossary');
+ $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$id", 'type' => 'activityinstance');
+
/// If we are in approval mode, prit special header
if ($tab == GLOSSARY_APPROVAL_VIEW) {
require_capability('mod/glossary:approve', $context);
- print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
- "<a href=\"view.php?id=$id\">" .format_string($glossary->name) . "</a> -> " .
- $strwaitingapproval,
- "", "", true,
+
+ $crumbs[] = array('name' => $strwaitingapproval, 'link' => '', 'type' => 'title');
+ $navigation = build_navigation($crumbs, $course);
+
+ print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
print_heading($strwaitingapproval);
} else { /// Print standard header
- print_header_simple(format_string($glossary->name), "",
- "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
- format_string($glossary->name),
- "", "", true,
+ $navigation = build_navigation($crumbs, $course);
+ print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
}