From a941387a022db75478f467b1812701d094d3c010 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 20 Aug 2009 08:49:11 +0000 Subject: [PATCH] MDL-19820 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno --- question/editlib.php | 17 +++++++++-------- question/type/questiontype.php | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/question/editlib.php b/question/editlib.php index b0dd53e61e0..a598942ae9e 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -1466,7 +1466,7 @@ class question_bank_view { } public function process_actions_needing_ui() { - global $DB; + global $DB, $OUTPUT; if (optional_param('deleteselected', false, PARAM_BOOL)) { // make a list of all the questions that are selected $rawquestions = $_REQUEST; // This code is called by both POST forms and GET links, so cannot use data_submitted. @@ -1495,11 +1495,9 @@ class question_bank_view { if ($inuse) { $questionnames .= '
'.get_string('questionsinuse', 'quiz'); } - notice_yesno(get_string("deletequestionscheck", "quiz", $questionnames), - $this->baseurl->out_action(), - $this->baseurl->out(true), - array('deleteselected'=>$questionlist, 'confirm'=>md5($questionlist)), - $this->baseurl->params(), 'post', 'get'); + echo $OUTPUT->confirm(get_string("deletequestionscheck", "quiz", $questionnames), + $this->baseurl->out_action(array('deleteselected'=>$questionlist, 'confirm'=>md5($questionlist))), + $this->baseurl); return true; } @@ -1913,8 +1911,11 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = ' global $CFG, $PAGE, $OUTPUT; static $choiceformprinted = false; $params['category'] = $categoryid; - print_single_button($CFG->wwwroot . '/question/addquestion.php', $params, - $caption,'get', '', false, $tooltip, $disabled); + $form = html_form::make_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption,'get'); + $form->button->title = $tooltip; + $form->button->disabled = $disabled; + echo $OUTPUT->button($form); + echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question')); $PAGE->requires->yui_lib('dragdrop'); $PAGE->requires->yui_lib('container'); diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 93b91f5f31f..845e11599fc 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -366,8 +366,8 @@ class default_questiontype { } if (!empty($result->noticeyesno)) { - notice_yesno($result->noticeyesno, "question.php?id=$question->id&courseid={$course->id}", - "edit.php?courseid={$course->id}"); + echo $OUTPUT->confirm($result->noticeyesno, "question.php?id=$question->id&courseid={$course->id}", + "edit.php?courseid={$course->id}"); echo $OUTPUT->footer(); exit; } @@ -1066,7 +1066,7 @@ class default_questiontype { * Used by print_question() */ function history($question, $state, $number, $cmoptions, $options) { - global $DB; + global $DB, $OUTPUT; $history = ''; if(isset($options->history) and $options->history) { if ($options->history == 'all') { @@ -1078,7 +1078,7 @@ class default_questiontype { } if (count($states) > 1) { $strreviewquestion = get_string('reviewresponse', 'quiz'); - $table = new stdClass; + $table = new html_table(); $table->width = '100%'; if ($options->scores) { $table->head = array ( @@ -1134,7 +1134,7 @@ class default_questiontype { ); } } - $history = print_table($table, true); + $history = $OUTPUT->table($table); } } return $history;