]> git.mjollnir.org Git - moodle.git/commitdiff
question MDL-19820 Replaced deprecated functions
authorsamhemelryk <samhemelryk>
Fri, 25 Sep 2009 04:16:27 +0000 (04:16 +0000)
committersamhemelryk <samhemelryk>
Fri, 25 Sep 2009 04:16:27 +0000 (04:16 +0000)
12 files changed:
question/addquestion.php
question/category.php
question/category_class.php
question/contextmove.php
question/contextmoveq.php
question/edit.php
question/export.php
question/import.php
question/question.php
question/type/calculated/questiontype.php
question/type/questiontype.php
question/type/random/questiontype.php

index 88c8a440c26ecd91bd034a3e927add31c3e85785..7e460bda34d6eb565c28a11340991a15da6d0aa8 100644 (file)
@@ -84,7 +84,7 @@ if ($cm !== null) {
     }
     $PAGE->navbar->add($chooseqtype);
     $PAGE->set_title($chooseqtype);
-    $PAGE->set_button(update_module_button($cm->id, $cm->course, get_string('modulename', $cm->modname)));
+    $PAGE->set_button($OUTPUT->update_module_button($cm->id, $cm->modname));
     echo $OUTPUT->header();
 } else {
     $PAGE->navbar->add(get_string('editquestions', 'question'),$returnurl);
index 8459f96c34cf0ea26240c827bcb724acf36edfca..7c807d25d139e993647815cea8326563f23eac84 100644 (file)
@@ -84,7 +84,7 @@
     if ($cm!==null) {
         // Page header
         $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
-            ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
+            ? $OUTPUT->update_module_button($cm->id, $cm->modname)
             : "";
         $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
         $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
index 10203b27a1453e1d5d03dd1940d5058c2ebbc8d8..190a3bcbe94c24452edde99d4d88195873b0e817 100644 (file)
@@ -256,7 +256,13 @@ class question_category_object {
      */
     public function output_edit_lists() {
         global $OUTPUT;
-        print_heading_with_help(get_string('editcategories', 'quiz'), 'categories', 'question');
+
+        $helpicon = new moodle_help_icon();
+        $helpicon->text = get_string('editcategories', 'quiz');
+        $helpicon->page = 'categories';
+        $helpicon->module = 'question';
+        echo $OUTPUT->heading_with_help($helpicon);
+
         foreach ($this->editlists as $context => $list){
             $listhtml = $list->to_html(0, array('str'=>$this->str));
             if ($listhtml){
index 33f9381d17af4f30bb6c99d7580f5f963fe7e9cd..9a54b859d6f5ee254dc93f9ba589059b389e5f35 100644 (file)
     if ($cm!==null) {
         // Page header
         $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
-            ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
+            ? $OUTPUT->update_module_button($cm->id, $cm->modname)
             : "";
         $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
         $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
index e04adbfb7dc5e0663b40d482e0232949feb7507d..095247b6ea84a0828a515499b9b8e055a4ab3870 100644 (file)
@@ -173,7 +173,7 @@ if ($cmid) {
     // Page header
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     $strupdatemodule = has_capability('moodle/course:manageactivities', $context)
-        ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
+        ? $OUTPUT->update_module_button($cm->id, $cm->modname)
         : "";
     $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
     $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
index 8711cb103aee93204adc3a5b2261f8f35f304f68..984f32990f12af49c82ea9bdd040a4fba785b671 100644 (file)
@@ -66,7 +66,7 @@
     $streditingquestions = get_string('editquestions', "quiz");
     if ($cm!==null) {
         $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
-            ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
+            ? $OUTPUT->update_module_button($cm->id, $cm->modname)
             : "";
         $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
         $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
index 4f0dc72f1209813f9a08b99c6850b8ee090d3cea..0cfac92e676b8e532c8cb2cad305d965426ca470 100644 (file)
@@ -35,7 +35,7 @@
     $PAGE->set_title($strexportquestions);
     if ($cm!==null) {
         $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
-            ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
+            ? $OUTPUT->update_module_button($cm->id, $cm->modname)
             : "";
         $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
         $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
     }
 
     /// Display export form
-    print_heading_with_help($strexportquestions, 'export', 'quiz');
+    $helpicon = new moodle_help_icon();
+    $helpicon->text = $strexportquestions;
+    $helpicon->page = 'export';
+    $helpicon->module = 'quiz';
+    echo $OUTPUT->heading_with_help($helpicon);
 
     $export_form->display();
 
index 775c67f5659d7205a4908b007e91d7cb4aa1fb23..31a893f9411494d3cf5151842af64809c782078c 100644 (file)
@@ -56,7 +56,7 @@
 
     if ($cm!==null) {
         $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id))
-            ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
+            ? $OUTPUT->update_module_button($cm->id, $cm->modname)
             : "";
         $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
         $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
         }
     }
 
-    print_heading_with_help($txt->importquestions, "import", "quiz");
+    $helpicon = new moodle_help_icon();
+    $helpicon->text = $txt->importquestions;
+    $helpicon->page = 'import';
+    $helpicon->module = 'quiz';
+    echo $OUTPUT->heading_with_help($helpicon);
 
     /// Print upload form
     $import_form->display();
index af9b63f79279fe5cc78f2188f8cd3edff812cb90..e477c7589130aed7aa08dc4b440584549c941adb 100644 (file)
@@ -278,7 +278,7 @@ if ($mform->is_cancelled()){
     if ($cm !== null) {
         $strmodule = get_string('modulename', $cm->modname);
         $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id))
-            ? update_module_button($cm->id, $cm->course, $strmodule)
+            ? $OUTPUT->update_module_button($cm->id, $strmodule)
             : "";
 
         $streditingmodule = get_string('editinga', 'moodle', $strmodule);
index 479aff719c601229f9c637aac45ab6183f0a5203..38eab5d047e6239f7e5a1b002eabf7c603cee026 100644 (file)
@@ -546,10 +546,18 @@ class question_calculated_qtype extends default_questiontype {
                 return;
                 break;
             case 'datasetdefinitions':
-                print_heading_with_help(get_string("choosedatasetproperties", "quiz"), "questiondatasets", "quiz");
+                $helpicon = new moodle_help_icon();
+                $helpicon->text = get_string("choosedatasetproperties", "quiz");
+                $helpicon->page = 'questiondatasets';
+                $helpicon->module = 'quiz';
+                echo $OUTPUT->heading_with_help($helpicon);
                 break;
             case 'datasetitems':
-                print_heading_with_help(get_string("editdatasets", "quiz"), 'questiondatasets', "quiz");
+                $helpicon = new moodle_help_icon();
+                $helpicon->text = get_string("editdatasets", "quiz");
+                $helpicon->page = 'questiondatasets';
+                $helpicon->module = 'quiz';
+                echo $OUTPUT->heading_with_help($helpicon);
                 break;
         }
 
index cb9146680cbd247740a38d03f8853f41a3b475f8..837f21545b7064c260991bd00996c9fa120e5f84 100644 (file)
@@ -227,7 +227,13 @@ class default_questiontype {
     function display_question_editing_page(&$mform, $question, $wizardnow){
         global $OUTPUT;
         $heading = $this->get_heading(empty($question->id));
-        print_heading_with_help($heading, $this->name(), $this->plugin_name());
+
+        $helpicon = new moodle_help_icon();
+        $helpicon->text = $heading;
+        $helpicon->page = $this->name();
+        $helpicon->module = $this->plugin_name();
+        echo $OUTPUT->heading_with_help($helpicon);
+
         $permissionstrs = array();
         if (!empty($question->id)){
             if ($question->formoptions->canedit){
index 5ddcb104486acba38195652763fc4a5fc221930e..1af2884061355b5774bc9da0c4f0238162aa46db 100644 (file)
@@ -89,7 +89,11 @@ class random_qtype extends default_questiontype {
 
     function display_question_editing_page(&$mform, $question, $wizardnow){
         $heading = $this->get_heading(empty($question->id));
-        print_heading_with_help($heading, $this->name(), $this->plugin_name());
+        $helpicon = new moodle_help_icon();
+        $helpicon->text = $heading;
+        $helpicon->page = $this->name();
+        $helpicon->module = $this->plugin_name();
+        echo $OUTPUT->heading_with_help($helpicon);
         $mform->display();
     }