From 1d58b567be8688a1769297b5d0ced0bed9c16299 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Fri, 25 Sep 2009 04:16:27 +0000 Subject: [PATCH] question MDL-19820 Replaced deprecated functions --- question/addquestion.php | 2 +- question/category.php | 2 +- question/category_class.php | 8 +++++++- question/contextmove.php | 2 +- question/contextmoveq.php | 2 +- question/edit.php | 2 +- question/export.php | 8 ++++++-- question/import.php | 8 ++++++-- question/question.php | 2 +- question/type/calculated/questiontype.php | 12 ++++++++++-- question/type/questiontype.php | 8 +++++++- question/type/random/questiontype.php | 6 +++++- 12 files changed, 47 insertions(+), 15 deletions(-) diff --git a/question/addquestion.php b/question/addquestion.php index 88c8a440c2..7e460bda34 100644 --- a/question/addquestion.php +++ b/question/addquestion.php @@ -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); diff --git a/question/category.php b/question/category.php index 8459f96c34..7c807d25d1 100644 --- a/question/category.php +++ b/question/category.php @@ -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))); diff --git a/question/category_class.php b/question/category_class.php index 10203b27a1..190a3bcbe9 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -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){ diff --git a/question/contextmove.php b/question/contextmove.php index 33f9381d17..9a54b859d6 100644 --- a/question/contextmove.php +++ b/question/contextmove.php @@ -190,7 +190,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))); diff --git a/question/contextmoveq.php b/question/contextmoveq.php index e04adbfb7d..095247b6ea 100644 --- a/question/contextmoveq.php +++ b/question/contextmoveq.php @@ -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))); diff --git a/question/edit.php b/question/edit.php index 8711cb103a..984f32990f 100644 --- a/question/edit.php +++ b/question/edit.php @@ -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))); diff --git a/question/export.php b/question/export.php index 4f0dc72f12..0cfac92e67 100644 --- a/question/export.php +++ b/question/export.php @@ -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))); @@ -124,7 +124,11 @@ } /// 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(); diff --git a/question/import.php b/question/import.php index 775c67f565..31a893f941 100644 --- a/question/import.php +++ b/question/import.php @@ -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))); @@ -155,7 +155,11 @@ } } - 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(); diff --git a/question/question.php b/question/question.php index af9b63f792..e477c75891 100644 --- a/question/question.php +++ b/question/question.php @@ -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); diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index 479aff719c..38eab5d047 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -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; } diff --git a/question/type/questiontype.php b/question/type/questiontype.php index cb9146680c..837f21545b 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -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){ diff --git a/question/type/random/questiontype.php b/question/type/random/questiontype.php index 5ddcb10448..1af2884061 100644 --- a/question/type/random/questiontype.php +++ b/question/type/random/questiontype.php @@ -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(); } -- 2.39.5