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 '<p>' . $message . '</p><p>' . get_string('windowclosing', 'quiz') . '</p>';
* @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])) {
/// 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);
*
* @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", '<script type="text/javascript">';
/// This used to be in protect_js.php. I really don't understand this bit.
/// I have just moved it here for cleanliness reasons.
if (has_capability('moodle/course:manageactivities', $contexts->lowest())) {
$strupdatemodule = update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'));
}
-$navigation = build_navigation($streditingquiz, $cm);
+$PAGE->navbar->add($streditingquiz);
print_header_simple($streditingquiz, '', $navigation, '', '', true, $strupdatemodule);
if (!$quizname = $DB->get_field($cm->modname, 'name', array('id' => $cm->instance))) {
* parameter.
*/
public function navigation($title) {
- return build_navigation($title, $this->cm);
+ global $PAGE;
+ $PAGE->navbar->add($title);
+ return '';
}
// Private methods =====================================================================
$attemptobj->get_quizid(), $attemptobj->get_cmid());
/// Print the page header
- print_header();
+ echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($attemptobj->get_question($questionid)->name));
/// Process any data that was submitted.
update_module_button($cm->id, $course->id,
get_string('modulename', 'quiz')) :
"";
-$navigation = build_navigation($pagetitle, $cm);
-
+
+$PAGE->navbar->add($pagetitle);
$PAGE->requires->skip_link_to('questionbank', get_string('skipto', 'access', get_string('questionbank', 'question')));
$PAGE->requires->skip_link_to('quizcontentsblock', get_string('skipto', 'access', get_string('questionsinthisquiz', 'quiz')));
</div>
</form>";
}
- $navlinks = array();
- $navlinks[] = array('name' => $strquizzes, 'link' => '', 'type' => 'activity');
- $navigation = build_navigation($navlinks);
-
+ $PAGE->navbar->add($strquizzes);
print_header_simple($strquizzes, '', $navigation,
'', '', true, $streditquestions, navmenu($course));
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
- $navigation = build_navigation('', $cm);
print_header_simple(format_string($quiz->name), "", $navigation,
'', '', true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
$attemptobj->get_quizid(), $attemptobj->get_cmid());
/// Print the page header
- $headtags = $attemptobj->get_question_html_head_contributions($questionid);
- print_header('', '', '', '', $headtags);
+ $attemptobj->get_question_html_head_contributions($questionid);
+ echo $OUTPUT->header();
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
/// Print infobox
}
$buttons .= '</tr></table>';
- $navigation = build_navigation(array(), $cm);
- print_header($title, $course->fullname, $navigation, '', '', true, $buttons, navmenu($course, $cm), false, $bodytags);
+ $PAGE->set_title($title);
+ $PAGE->set_heading($course->fullname);
+ $PAGE->set_button($buttons);
+ echo $OUTPUT->header();
/// Print heading and tabs (if there is more than one).
$currenttab = 'info';