From: mattc-catalyst Date: Mon, 16 Apr 2007 21:16:38 +0000 (+0000) Subject: Breadcrumbs: mod/glossary changes X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f3c8392617873c1fd43ecd9fdbb5892894437412;p=moodle.git Breadcrumbs: mod/glossary changes - Modified to use build_navigation() for breadcrumb generation. Author: Matt Clarkson --- diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index c329807c87..5f13dfb085 100644 --- a/mod/glossary/comment.php +++ b/mod/glossary/comment.php @@ -222,9 +222,15 @@ function glossary_comment_print_header($course, $cm, $glossary, $entry, $action) $strglossaries = get_string('modulenameplural', 'glossary'); $strglossary = get_string('modulename', 'glossary'); $strcomments = get_string('comments', 'glossary'); - - print_header_simple(format_string($glossary->name), '', - "id\">$strglossaries -> id\">".format_string($glossary->name,true)." -> id&eid=$entry->id\">$strcomments -> " . $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) diff --git a/mod/glossary/comments.php b/mod/glossary/comments.php index 6af15e1cb0..3f5994472e 100644 --- a/mod/glossary/comments.php +++ b/mod/glossary/comments.php @@ -42,8 +42,12 @@ $strcomments = get_string("comments", "glossary"); $straddcomment = get_string("addcomment", "glossary"); - print_header_simple(strip_tags("$strcomments: $entry->concept"), "", - "id>$strglossaries -> id>".format_string($glossary->name,true)." -> $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)); diff --git a/mod/glossary/deleteentry.php b/mod/glossary/deleteentry.php index fc89e74d0d..0f1180e6e2 100644 --- a/mod/glossary/deleteentry.php +++ b/mod/glossary/deleteentry.php @@ -39,8 +39,12 @@ $strareyousuredelete = get_string("areyousuredelete","glossary"); - print_header_simple(format_string($glossary->name), "", - "id\">$strglossaries -> ".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)); diff --git a/mod/glossary/edit.php b/mod/glossary/edit.php index 0e44b8bee6..13c2228dc6 100644 --- a/mod/glossary/edit.php +++ b/mod/glossary/edit.php @@ -192,10 +192,13 @@ $strglossary = get_string("modulename", "glossary"); $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), "", - "id\">$strglossaries -> - id\">".format_string($glossary->name,true)." -> $stredit", "", +$navigation = build_navigation($crumbs, $course); + +print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, "", navmenu($course, $cm)); diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index 5c81b59549..9c207c7594 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -47,8 +47,13 @@ $strglossaries = get_string("modulenameplural", "glossary"); $strglossary = get_string("modulename", "glossary"); - print_header_simple(format_string($glossary->name), "", - "id\">$strglossaries -> id&tab=GLOSSARY_CATEGORY_VIEW\">".format_string($glossary->name,true)." -> " . 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)); diff --git a/mod/glossary/export.php b/mod/glossary/export.php index f37dad575b..003613d913 100644 --- a/mod/glossary/export.php +++ b/mod/glossary/export.php @@ -37,10 +37,12 @@ $strexportfile = get_string("exportfile", "glossary"); $strexportentries = get_string('exportentries', 'glossary'); - print_header_simple(format_string($glossary->name), "", - "id\">$strglossaries -> " . - "" .format_string($glossary->name) . " -> " . - $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)); diff --git a/mod/glossary/exportentry.php b/mod/glossary/exportentry.php index d441ce9a1b..0213ecefae 100644 --- a/mod/glossary/exportentry.php +++ b/mod/glossary/exportentry.php @@ -38,10 +38,12 @@ $entryalreadyexist = get_string('entryalreadyexist','glossary'); $entryexported = get_string('entryexported','glossary'); - print_header_simple(format_string($glossary->name), '', - ''.$strglossaries.' -> '.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); diff --git a/mod/glossary/formats.php b/mod/glossary/formats.php index ffe721b6e3..bba5a0057b 100644 --- a/mod/glossary/formats.php +++ b/mod/glossary/formats.php @@ -51,10 +51,15 @@ $strmodulename = get_string("modulename", "glossary"); $strdisplayformats = get_string("displayformats","glossary"); - print_header("$strmodulename: $strconfiguration", $site->fullname, - "admin/index.php\">$stradmin -> ". - "admin/configure.php\">$strconfiguration -> ". - "admin/modules.php\">$strmanagemodules -> admin/module.php?module=glossary&sesskey=$USER->sesskey\">$strmodulename -> $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")); diff --git a/mod/glossary/import.php b/mod/glossary/import.php index 0a83eef4d2..4ef0c49747 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -45,10 +45,13 @@ $strsearch = get_string("search"); $strimportentries = get_string('importentriesfromxml', 'glossary'); - print_header_simple(format_string($glossary->name), "", - "id\">$strglossaries -> " . - "" .format_string($glossary->name) . " -> " . - $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)); diff --git a/mod/glossary/index.php b/mod/glossary/index.php index a6758df813..f17f5b6f89 100644 --- a/mod/glossary/index.php +++ b/mod/glossary/index.php @@ -27,8 +27,10 @@ /// 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 diff --git a/mod/glossary/showentry.php b/mod/glossary/showentry.php index 496ce9c2ba..dd74a706de 100644 --- a/mod/glossary/showentry.php +++ b/mod/glossary/showentry.php @@ -49,8 +49,12 @@ $CFG->framename = "newwindow"; if ($course->id != SITEID) { - print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, - "wwwroot/course/view.php?id=$course->id\">$course->shortname -> $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, " ", " "); diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 3e8b944cfb..ddd34ef285 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -224,22 +224,23 @@ $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), "", - "id\">$strglossaries -> " . - "" .format_string($glossary->name) . " -> " . - $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), "", - "id\">$strglossaries -> " . - 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)); }