]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19820 upgraded calls to print_table, print_single_button, print_user_picture...
authornicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:49:11 +0000 (08:49 +0000)
committernicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:49:11 +0000 (08:49 +0000)
question/editlib.php
question/type/questiontype.php

index b0dd53e61e0a646c922dc3841d9fd00c314cfec3..a598942ae9e826a306875e39611ae276cb859f1d 100644 (file)
@@ -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 .= '<br />'.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');
index 93b91f5f31f8956e046bfe3ab29fb81a3223a727..845e11599fcb397684c993e21d4407a7a2230bcf 100644 (file)
@@ -366,8 +366,8 @@ class default_questiontype {
         }
 
         if (!empty($result->noticeyesno)) {
-            notice_yesno($result->noticeyesno, "question.php?id=$question->id&amp;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;