From 2698e9c1ace11ba48979e281562c150060e37c2f Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Mon, 7 Sep 2009 02:11:54 +0000 Subject: [PATCH] mod-quiz MDL-19813 Updated print_header and build_navigation to OUTPUT and PAGE equivalents --- mod/quiz/accessrules.php | 15 ++++++++++----- mod/quiz/addrandom.php | 2 +- mod/quiz/attemptlib.php | 4 +++- mod/quiz/comment.php | 2 +- mod/quiz/edit.php | 4 ++-- mod/quiz/index.php | 5 +---- mod/quiz/report/default.php | 1 - mod/quiz/reviewquestion.php | 4 ++-- mod/quiz/view.php | 6 ++++-- 9 files changed, 24 insertions(+), 19 deletions(-) diff --git a/mod/quiz/accessrules.php b/mod/quiz/accessrules.php index 0d5c3aa1550..36e3d8b2527 100644 --- a/mod/quiz/accessrules.php +++ b/mod/quiz/accessrules.php @@ -226,7 +226,7 @@ class quiz_access_manager { global $CFG, $OUTPUT; $url = $this->_quizobj->view_url(); if ($this->securewindow_required($canpreview)) { - print_header(); + echo $OUTPUT->header(); echo $OUTPUT->box_start(); if ($message) { echo '

' . $message . '

' . get_string('windowclosing', 'quiz') . '

'; @@ -599,7 +599,7 @@ class password_access_rule extends quiz_access_rule_base { * @return mixed return null, unless $return is true, and a form needs to be displayed. */ public function do_password_check($canpreview, $accessmanager, $return = false) { - global $CFG, $SESSION, $OUTPUT; + global $CFG, $SESSION, $OUTPUT, $PAGE; /// We have already checked the password for this quiz this session, so don't ask again. if (!empty($SESSION->passwordcheckedquizzes[$this->_quiz->id])) { @@ -623,7 +623,8 @@ class password_access_rule extends quiz_access_rule_base { /// Start the page and print the quiz intro, if any. if (!$return) { - print_header('', '', '', 'quizpassword'); + $PAGE->set_focuscontrol('quizpassword'); + echo $OUTPUT->header(); } if (trim(strip_tags($this->_quiz->intro))) { $cm = get_coursemodule_from_id('quiz', $this->_quiz->id); @@ -744,11 +745,15 @@ class securewindow_access_rule extends quiz_access_rule_base { * * @param string $title HTML title tag content, passed to printheader. * @param string $headtags extra stuff to go in the HTML head tag, passed to printheader. + * $headtags has been deprectaed since Moodle 2.0 */ - public function setup_secure_page($title, $headtags) { + public function setup_secure_page($title, $headtags=null) { + global $OUTPUT, $PAGE; /// This prevents the message window coming up. define('MESSAGE_WINDOW', true); - print_header($title, '', '', '', $headtags, false, '', '', false, ''); + $PAGE->set_title($title); + $PAGE->set_cacheable(false); + echo $OUTPUT->header(); echo "\n\n", '