]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19820 Converted print_box* to $OUTPUT->box*
authornicolasconnault <nicolasconnault>
Mon, 10 Aug 2009 05:01:23 +0000 (05:01 +0000)
committernicolasconnault <nicolasconnault>
Mon, 10 Aug 2009 05:01:23 +0000 (05:01 +0000)
question/addquestion.php
question/category_class.php
question/contextmove.php
question/contextmoveq.php
question/editlib.php
question/type/questiontype.php

index cdba0607ecc2b7e53dd2be5d6cb161b32d119955..0f6599dde4f28ce59df2b4b6d84b85ba60ebe35b 100644 (file)
@@ -96,9 +96,9 @@ if ($cm !== null) {
 }
 
 // Display a form to choose the question type.
-print_box_start('generalbox boxwidthnormal boxaligncenter', 'chooseqtypebox');
+echo $OUTPUT->box_start('generalbox boxwidthnormal boxaligncenter', 'chooseqtypebox');
 print_choose_qtype_to_add_form($hiddenparams);
-print_box_end();
+echo $OUTPUT->box_end();
 
 echo $OUTPUT->footer();
 ?>
index 65eb1fa4d6fc393fd042ff4081a4339ac0e87323..10203b27a1453e1d5d03dd1940d5058c2ebbc8d8 100644 (file)
@@ -260,10 +260,10 @@ class question_category_object {
         foreach ($this->editlists as $context => $list){
             $listhtml = $list->to_html(0, array('str'=>$this->str));
             if ($listhtml){
-                print_box_start('boxwidthwide boxaligncenter generalbox questioncategories contextlevel' . $list->context->contextlevel);
+                echo $OUTPUT->box_start('boxwidthwide boxaligncenter generalbox questioncategories contextlevel' . $list->context->contextlevel);
                 echo $OUTPUT->heading(get_string('questioncatsfor', 'question', print_context_name(get_context_instance_by_id($context))), 3);
                 echo $listhtml;
-                print_box_end();
+                echo $OUTPUT->box_end();
             }
         }
         echo $list->display_page_numbers();
@@ -369,10 +369,11 @@ class question_category_object {
     }
 
     public function display_move_form($questionsincategory, $category){
+        global $OUTPUT;
         $vars = new stdClass;
         $vars->name = $category->name;
         $vars->count = $questionsincategory;
-        print_box(get_string('categorymove', 'quiz', $vars), 'generalbox boxaligncenter');
+        echo $OUTPUT->box(get_string('categorymove', 'quiz', $vars), 'generalbox boxaligncenter');
         $this->moveform->display();
     }
 
index f742b2db2fb96d3b41856a31e679a8d02ad9ec80..1662132b76b69e4ed646040a9613bc446886113e 100644 (file)
         $cattomove->toareaname = $toareaname;
         $cattomove->fromareaname = $fromareaname;
 
-        print_box(get_string('movingcategoryandfiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox');
+        echo $OUTPUT->box(get_string('movingcategoryandfiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox');
     } else {
-        print_box(get_string('movingcategorynofiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox');
+        echo $OUTPUT->box(get_string('movingcategorynofiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox');
     }
     $contextmoveform->display();
     echo $OUTPUT->footer();
index f2fa3fefe9073426dbda86ca1a5c932172ec99e6..6620e0785624426a6aeacdf299ec28bb7d3ad3a7 100644 (file)
@@ -235,9 +235,9 @@ if (count($urls)){
 
     $questionsstr->toareaname = $toareaname;
 
-    print_box(get_string('movingquestionsandfiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox');
+    echo $OUTPUT->box(get_string('movingquestionsandfiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox');
 } else {
-    print_box(get_string('movingquestionsnofiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox');
+    echo $OUTPUT->box(get_string('movingquestionsnofiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox');
 }
 $contextmoveform->display();
 echo $OUTPUT->footer();
index 97dca302d5ca66fdb927ebfd0d9ae287a25b8bf2..f833bc72bf21a5621cc8d63003c1e03c1785c8a5 100644 (file)
@@ -1130,7 +1130,7 @@ class question_bank_view {
     }
 
     protected function get_current_category($categoryandcontext) {
-        global $DB;
+        global $DB, $OUTPUT;
         list($categoryid, $contextid) = explode(',', $categoryandcontext);
         if (!$categoryid) {
             $this->print_choose_category_message($categoryandcontext);
@@ -1139,9 +1139,9 @@ class question_bank_view {
 
         if (!$category = $DB->get_record('question_categories',
                 array('id' => $categoryid, 'contextid' => $contextid))) {
-            print_box_start('generalbox questionbank');
+            echo $OUTPUT->box_start('generalbox questionbank');
             notify('Category not found!');
-            print_box_end();
+            echo $OUTPUT->box_end();
             return false;
         }
 
index c6935cbfd94be251dbe7e53d3858d1036bbbafcf..abf79ef754807da73c7702496fa1d227b4569722 100644 (file)
@@ -247,7 +247,7 @@ class default_questiontype {
                 $html .= '<li>'.$permissionstr.'</li>';
             }
             $html .= '</ul>';
-            print_box($html, 'boxwidthnarrow boxaligncenter generalbox');
+            echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox');
         }
         $mform->display();
     }
@@ -710,7 +710,7 @@ class default_questiontype {
         }
         return array($question->id => $responses[$question->id]->responses);
     }
-    
+
     /**
      * @param object $question
      * @return mixed either a integer score out of 1 that the average random
@@ -934,7 +934,7 @@ class default_questiontype {
                 if ($isgraded) {
                     $grade = question_format_grade($cmoptions, $state->last_graded->grade).'/';
                 } else {
-                    $grade = '--/'; 
+                    $grade = '--/';
                 }
             }
             $grade .= question_format_grade($cmoptions, $question->maxgrade);
@@ -983,7 +983,7 @@ class default_questiontype {
                 $checksum = question_get_toggleflag_checksum($aid, $qid, $qsid);
                 $postdata = "qsid=$qsid&aid=$aid&qid=$qid&checksum=$checksum&sesskey=" . sesskey();
                 $flagcontent = '<input type="checkbox" id="' . $id . '" name="' . $id .
-                        '" value="1" ' . $checked . ' />' . 
+                        '" value="1" ' . $checked . ' />' .
                         '<label id="' . $id . 'label" for="' . $id . '">' . $this->get_question_flag_tag(
                         $state->flagged, $id . 'img') . '</label>' . "\n";
                 $PAGE->requires->js_function_call('question_flag_changer.init_flag', array($id, $postdata));
@@ -1000,7 +1000,7 @@ class default_questiontype {
      * Work out the actual img tag needed for the flag
      *
      * @param boolean $flagged whether the question is currently flagged.
-     * @param string $id an id to be added as an attribute to the img (optional). 
+     * @param string $id an id to be added as an attribute to the img (optional).
      * @return string the img tag.
      */
     protected function get_question_flag_tag($flagged, $id = '') {
@@ -1178,7 +1178,7 @@ class default_questiontype {
                 $grade->raw = question_format_grade($cmoptions, $state->last_graded->raw_grade);
 
                 // let student know wether the answer was correct
-                $class = question_get_feedback_class($state->last_graded->raw_grade / 
+                $class = question_get_feedback_class($state->last_graded->raw_grade /
                         $question->maxgrade);
                 echo '<div class="correctness ' . $class . '">' . get_string($class, 'quiz') . '</div>';