Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Breadcrumbs: mod/hotpot changes

- Modified to use build_navigation() for breadcrumb generation.


Author: Matt Clarkson <mattc@catalyst.net.nz>
  • Loading branch information...
commit ec55218d984ae8b00b60d521e5e838865b6ba3c8 1 parent a46ed6f
mattc-catalyst authored
View
8 mod/hotpot/index.php
@@ -36,10 +36,10 @@
$title = format_string($course->shortname) . ": $strmodulenameplural";
$heading = $course->fullname;
- $navigation = $strmodulenameplural;
- if ($course->id != SITEID) {
- $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
- }
+
+ $crumbs[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity');
+ $navigation = build_navigation($crumbs, $course);
+
print_header($title, $heading, $navigation, "", "", true, "", navmenu($course));
$next_url = "$CFG->wwwroot/course/view.php?id=$course->id";
View
18 mod/hotpot/report.php
@@ -401,9 +401,10 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;
+
+ $crumbs[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity');
+ $crumbs[] = array('name' => $hotpot->name, 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navigation = "<a href=index.php?id=$course->id>$strmodulenameplural</a> -> ";
- $navigation .= "<a href=\"view.php?id=$cm->id\">$hotpot->name</a> -> ";
$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
@@ -412,16 +413,17 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
} else {
$module = "hotpot";
}
- $navigation .= get_string("report$mode", $module);
+
+ $crumbs[] = array('name' => get_string("report$mode", $module), 'link' => '', 'type' => 'title');
+
} else {
- $navigation .= get_string("report", "quiz");
- }
- if ($course->id != SITEID) {
- $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
+
+ $crumbs[] = array('name' => get_string("report", "quiz"), 'link' => '', 'type' => 'title');
}
- $button = update_module_button($cm->id, $course->id, $strmodulename);
+ $button = update_module_button($cm->id, $course->id, $strmodulename);
+ $navigation = build_navigation($crumbs, $course);
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
print_heading($hotpot->name);
View
10 mod/hotpot/review.php
@@ -52,10 +52,12 @@
// print header
$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;
- $navigation = "<a href=\"index.php?id=$course->id\">$strmodulenameplural</a> -> ".get_string("review", "quiz");
- if ($course->id != SITEID) {
- $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
- }
+
+ $crumbs[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity');
+ $crumbs[] = array('name' => get_string("review", "quiz"), 'link' => '', 'type' => 'activityinstance');
+ $navigation = build_navigation($crumbs, $course);
+
+
$button = update_module_button($cm->id, $course->id, $strmodulename);
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
View
9 mod/hotpot/view.php
@@ -42,10 +42,11 @@
// header strings
$title = format_string($course->shortname.': '.$hotpot->name, true);
$heading = $course->fullname;
- $navigation = '<a '.$CFG->frametarget.' href="'.$CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id.'">'.get_string("modulenameplural", "hotpot")."</a> -> $hotpot->name";
- if ($course->id != SITEID) {
- $navigation = '<a '.$CFG->frametarget.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$navigation;
- }
+ $crumbs[] = array('name' => get_string("modulenameplural", "hotpot"), 'link' => $CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id, 'type' => 'activity');
+ $crumbs[] = array('name' => $hotpot->name, 'link' => '', 'type' => 'activityinstance');
+
+ $navigation = build_navigation($crumbs, $course);
+
$button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot"));
$button = '<div style="font-size:0.75em;">'.$button.'</div>';
$loggedinas = '<span class="logininfo">'.user_login_string($course, $USER).'</span>';
Please sign in to comment.
Something went wrong with that request. Please try again.