From: mattc-catalyst Date: Mon, 16 Apr 2007 21:27:08 +0000 (+0000) Subject: Breadcrumbs: mod/scorm changes X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=afd97d1c9d68fb08fd41c609aa9177c70ae31981;p=moodle.git Breadcrumbs: mod/scorm changes - Modified to use build_navigation() for breadcrumb generation. Author: Matt Clarkson --- diff --git a/mod/scorm/index.php b/mod/scorm/index.php index 37b7d3e4a7..49b484a37c 100755 --- a/mod/scorm/index.php +++ b/mod/scorm/index.php @@ -24,8 +24,11 @@ $strsummary = get_string("summary"); $strreport = get_string("report",'scorm'); $strlastmodified = get_string("lastmodified"); + + $crumbs[] = array('name' => $strscorms, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($crumbs, $course); - print_header_simple("$strscorms", "", "$strscorms", + print_header_simple("$strscorms", "", $navigation, "", "", true, "", navmenu($course)); if ($course->format == "weeks" or $course->format == "topics") { diff --git a/mod/scorm/player.php b/mod/scorm/player.php index 93f37a1765..8bbf656fbd 100755 --- a/mod/scorm/player.php +++ b/mod/scorm/player.php @@ -46,23 +46,22 @@ $strpopup = get_string('popup','scorm'); if ($course->id != SITEID) { - $navigation = "frametarget href=\"../../course/view.php?id=$course->id\">$course->shortname ->"; if ($scorms = get_all_instances_in_course('scorm', $course)) { // The module SCORM/AICC activity with the first id is the course $firstscorm = current($scorms); if (!(($course->format == 'scorm') && ($firstscorm->id == $scorm->id))) { - $navigation .= "frametarget href=\"index.php?id=$course->id\">$strscorms ->"; + $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); } } - } else { - $navigation = "frametarget href=\"index.php?id=$course->id\">$strscorms ->"; } $pagetitle = strip_tags("$course->shortname: ".format_string($scorm->name)); if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE,$course->id))) { - print_header($pagetitle, $course->fullname, - "$navigation frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."", + $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navigation = build_navigation($crumbs, $course); + + print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false); notice(get_string("activityiscurrentlyhidden")); } @@ -124,9 +123,12 @@ if ($scorm->popup == 1) { $bodyscript = 'onunload="main.close();"'; } - + + $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navigation = build_navigation($crumbs, $course); + print_header($pagetitle, $course->fullname, - "$navigation frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."", + $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false, $bodyscript); if ($sco->scormtype == 'sco') { ?> diff --git a/mod/scorm/report.php b/mod/scorm/report.php index 136366d23a..d3136c8e39 100755 --- a/mod/scorm/report.php +++ b/mod/scorm/report.php @@ -57,36 +57,38 @@ /// Print the page header if (empty($noheader)) { - if ($course->id != SITEID) { - $navigation = "id\">$course->shortname ->"; - } else { - $navigation = ''; - } $strscorms = get_string('modulenameplural', 'scorm'); $strscorm = get_string('modulename', 'scorm'); $strreport = get_string('report', 'scorm'); $strattempt = get_string('attempt', 'scorm'); $strname = get_string('name'); + + $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + if (empty($b)) { if (empty($a)) { - print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, - "$navigation id\">$strscorms - -> id\">".format_string($scorm->name,true)." -> $strreport", + $navigation = build_navigation($crumbs, $course); + print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,$navigation, '', '', true); } else { + + $crumbs[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); + $crumbs[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => '', 'type' => 'title'); + $navigation = build_navigation($crumbs, $course); + print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, - "$navigation id\">$strscorms - -> id\">".format_string($scorm->name,true)." - -> id\">$strreport -> $strattempt $attempt - ".fullname($userdata), - '', '', true); + $navigation, '', '', true); } } else { - print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, - "$navigation id\">$strscorms - -> id\">".format_string($scorm->name,true)." - -> id\">$strreport - -> $strattempt $attempt - ".fullname($userdata)." -> $sco->title", + + $crumbs[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); + $crumbs[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => "report.php?a=$a&user=$user&attempt=$attempt", 'type' => 'title'); + $crumbs[] = array('name' => $sco->title, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($crumbs, $course); + + print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, $navigation, '', '', true); } print_heading(format_string($scorm->name)); diff --git a/mod/scorm/view.php b/mod/scorm/view.php index 1d547b1be0..cd913c134b 100755 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -43,18 +43,15 @@ $strscorm = get_string("modulename", "scorm"); if ($course->id != SITEID) { - $navigation = "frametarget href=\"../../course/view.php?id=$course->id\">$course->shortname ->"; + if ($scorms = get_all_instances_in_course('scorm', $course)) { // The module SCORM activity with the least id is the course $firstscorm = current($scorms); if (!(($course->format == 'scorm') && ($firstscorm->id == $scorm->id))) { - $navigation .= "frametarget href=\"index.php?id=$course->id\">$strscorms ->"; + $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); } } - } else { - $navigation = "frametarget href=\"index.php?id=$course->id\">$strscorms ->"; } - $pagetitle = strip_tags($course->shortname.': '.format_string($scorm->name)); add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id='.$cm->id, "$scorm->id"); @@ -66,8 +63,10 @@ // // Print the page header // - print_header($pagetitle, $course->fullname, - "$navigation frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."", + $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navigation = build_navigation($crumbs, $course); + + print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm)); if (empty($cm->visible) and !has_capability('moodle/course:manageactivities', $context)) {