From ec55218d984ae8b00b60d521e5e838865b6ba3c8 Mon Sep 17 00:00:00 2001 From: mattc-catalyst Date: Mon, 16 Apr 2007 21:40:46 +0000 Subject: [PATCH] Breadcrumbs: mod/hotpot changes - Modified to use build_navigation() for breadcrumb generation. Author: Matt Clarkson --- mod/hotpot/index.php | 8 ++++---- mod/hotpot/report.php | 18 ++++++++++-------- mod/hotpot/review.php | 10 ++++++---- mod/hotpot/view.php | 9 +++++---- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index 04bd0e1495..faf07c2158 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -36,10 +36,10 @@ $title = format_string($course->shortname) . ": $strmodulenameplural"; $heading = $course->fullname; - $navigation = $strmodulenameplural; - if ($course->id != SITEID) { - $navigation = "id\">$course->shortname -> $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"; diff --git a/mod/hotpot/report.php b/mod/hotpot/report.php index 53871214e0..bdb77f5c92 100644 --- a/mod/hotpot/report.php +++ b/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 = "id>$strmodulenameplural -> "; - $navigation .= "id\">$hotpot->name -> "; $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 = "id\">$course->shortname -> $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); diff --git a/mod/hotpot/review.php b/mod/hotpot/review.php index d0f7f39878..578049f8a3 100644 --- a/mod/hotpot/review.php +++ b/mod/hotpot/review.php @@ -52,10 +52,12 @@ // print header $title = format_string($course->shortname) . ": $hotpot->name"; $heading = $course->fullname; - $navigation = "id\">$strmodulenameplural -> ".get_string("review", "quiz"); - if ($course->id != SITEID) { - $navigation = "id\">$course->shortname -> $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 ''; // for overlib diff --git a/mod/hotpot/view.php b/mod/hotpot/view.php index 375d9fab63..4197aec39f 100644 --- a/mod/hotpot/view.php +++ b/mod/hotpot/view.php @@ -42,10 +42,11 @@ // header strings $title = format_string($course->shortname.': '.$hotpot->name, true); $heading = $course->fullname; - $navigation = 'frametarget.' href="'.$CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id.'">'.get_string("modulenameplural", "hotpot")." -> $hotpot->name"; - if ($course->id != SITEID) { - $navigation = 'frametarget.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.' -> '.$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 = '
'.$button.'
'; $loggedinas = ''.user_login_string($course, $USER).''; -- 2.39.5