$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";
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)) {
$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 '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
$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 '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
echo $OUTPUT->heading($hotpot->name);
hotpot_print_attempt_summary($hotpot, $attempt);
$title = format_string($course->shortname.': '.$hotpot->name, true);
$heading = $course->fullname;
- $navigation = build_navigation('', $cm);
-
$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>';
+
+ $PAGE->set_title($title);
+ $PAGE->set_heading($heading);
+ $PAGE->set_button($button);
+ $PAGE->set_headingmenu($loggedinas);
+
$time = time();
$hppassword = optional_param('hppassword', '', PARAM_RAW);
if (HOTPOT_FIRST_ATTEMPT && !has_capability('mod/hotpot:grade', $context)) {
$error = get_string("nomoreattempts", "quiz");
// get password
} else if ($hotpot->password && empty($hppassword)) {
- print_header($title, $heading, $navigation, "", "", true, $button, $loggedinas, false);
+ echo $OUTPUT->header();
echo $OUTPUT->heading($hotpot->name);
$boxalign = 'center';
$boxwidth = 500;
$error = get_string("quizclosed", "quiz", userdate($hotpot->timeclose))."<br />\n";
}
if ($error) {
- print_header($title, $heading, $navigation, "", "", true, $button, $loggedinas, false);
+ echo $OUTPUT->header();
notice($error, $nextpage);
//
// script stops here, if quiz is unavailable to student
} else if ($frameset) { // HP5 v5
switch ($framename) {
case 'top':
- print_header($title, $heading, $navigation, "", "", true, $button, $loggedinas);
+ echo $OUTPUT->header();
print $footer;
break;
default:
switch ($hotpot->navigation) {
case HOTPOT_NAVIGATION_BAR:
//update_module_button($cm->id, $course->id, $strmodulename.'" style="font-size:0.8em')
- print_header($title, $heading, $navigation, "", $head.$styles.$scripts, true, $button, $loggedinas, false, $body_tags
- );
+ print_header($title, $heading, '', "", $head.$styles.$scripts, true, $button, $loggedinas, false, $body_tags);
if (!empty($available_msg)) {
echo $OUTPUT->notification($available_msg);
}
case HOTPOT_NAVIGATION_FRAME:
switch ($framename) {
case 'top':
- print_header($title, $heading, $navigation, "", "", true, $button, $loggedinas);
+ echo $OUTPUT->header();
print $footer;
break;
case 'main':
break;
default:
$iframe_id = 'hotpot_iframe';
- $body_tags = " onload=\"set_iframe_height('$iframe_id')\"";
- $iframe_js = '<script src="iframe.js" type="text/javascript"></script>'."\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);
}