From cfe1d03998f4fa5e8303925b75208c67b869d1b2 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Mon, 7 Sep 2009 03:55:32 +0000 Subject: [PATCH] mod-hotpot MDL-19810 Updated print_header and build_navigation to OUTPUT and PAGE equivalents --- mod/hotpot/index.php | 13 ++++--------- mod/hotpot/report.php | 14 +++++++------- mod/hotpot/review.php | 11 +++++------ mod/hotpot/show.php | 4 +++- mod/hotpot/view.php | 29 ++++++++++++++--------------- 5 files changed, 33 insertions(+), 38 deletions(-) diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index 46bce06793..b2a1109586 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -28,15 +28,10 @@ $quotes = array("'"=>"\'", '"'=>'"'); // Print the header - - $title = format_string($course->shortname) . ": $strmodulenameplural"; - $heading = $course->fullname; - - $navlinks = array(); - $navlinks[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($navlinks); - - print_header($title, $heading, $navigation, "", "", true, "", navmenu($course)); + $PAGE->navbar->add($strmodulenameplural); + $PAGE->set_title(format_string($course->shortname) . ": $strmodulenameplural"); + $PAGE->set_heading($course->fullname); + echo $OUTPUT->header(); $next_url = "$CFG->wwwroot/course/view.php?id=$course->id"; diff --git a/mod/hotpot/report.php b/mod/hotpot/report.php index 2bb5794b33..b65c681295 100644 --- a/mod/hotpot/report.php +++ b/mod/hotpot/report.php @@ -426,9 +426,6 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) { global $OUTPUT; $strmodulenameplural = get_string("modulenameplural", "hotpot"); $strmodulename = get_string("modulename", "hotpot"); - - $title = format_string($course->shortname) . ": $hotpot->name"; - $heading = $course->fullname; $modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id); if (has_capability('mod/hotpot:viewreport',$modulecontext)) { @@ -438,13 +435,16 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) { $module = "hotpot"; } - $navigation = build_navigation(get_string("report$mode", $module), $cm); + $PAGE->navbar->add(get_string("report$mode", $module)); } else { - $navigation = build_navigation(get_string("report", "quiz"), $cm); + $PAGE->navbar->add(get_string("report", "quiz")); } - $button = update_module_button($cm->id, $course->id, $strmodulename); - print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm)); + $PAGE->set_title(format_string($course->shortname) . ": $hotpot->name"); + $PAGE->set_heading($course->fullname); + $PAGE->set_button(update_module_button($cm->id, $course->id, $strmodulename)); + echo $OUTPUT->header(); + $course_context = get_context_instance(CONTEXT_COURSE, $course->id); if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) { echo '
' diff --git a/mod/hotpot/review.php b/mod/hotpot/review.php index ef194add69..7d82add390 100644 --- a/mod/hotpot/review.php +++ b/mod/hotpot/review.php @@ -51,12 +51,11 @@ $strmodulenameplural = get_string("modulenameplural", "hotpot"); $strmodulename = get_string("modulename", "hotpot"); // print header - $title = format_string($course->shortname) . ": $hotpot->name"; - $heading = $course->fullname; - - $navigation = build_navigation('', $cm); - $button = update_module_button($cm->id, $course->id, $strmodulename); - print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm)); + + $PAGE->set_title(format_string($course->shortname) . ": $hotpot->name"); + $PAGE->set_heading($course->fullname); + $PAGE->set_button(update_module_button($cm->id, $course->id, $strmodulename)); + echo $OUTPUT->header(); print ''; // for overlib echo $OUTPUT->heading($hotpot->name); hotpot_print_attempt_summary($hotpot, $attempt); diff --git a/mod/hotpot/show.php b/mod/hotpot/show.php index b8306b0a7e..e29f3c7a76 100644 --- a/mod/hotpot/show.php +++ b/mod/hotpot/show.php @@ -19,7 +19,9 @@ $params->location = HOTPOT_LOCATION_COURSEFILES; } $title = get_string($params->action, 'hotpot').': '.$params->reference; - print_header($title, $title); + $PAGE->set_title($title); + $PAGE->set_heading($title); + echo $OUTPUT->header(); hotpot_print_show_links($params->course, $params->location, $params->reference); ?> '."\n"; - print_header( - $title, $heading, $navigation, - "", $head.$styles.$scripts.$iframe_js, true, $button, - $loggedinas, false, $body_tags - ); + $PAGE->requires->js('mod/hotpot/iframe.js'); + $PAGE->requires->js_function_call('set_iframe_height', array($iframe_id))->on_dom_ready(); + echo $OUTPUT->header(); if (!empty($available_msg)) { echo $OUTPUT->notification($available_msg); } -- 2.39.5