From: samhemelryk Date: Wed, 23 Sep 2009 06:34:39 +0000 (+0000) Subject: mod-choice MDL-19805 Added PAGE->set_url calls and removed deprecated functions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=97dcb8f88ee820cf64aa429a002dabb79fa99614;p=moodle.git mod-choice MDL-19805 Added PAGE->set_url calls and removed deprecated functions --- diff --git a/mod/choice/index.php b/mod/choice/index.php index 75cf6f72be..06563c297a 100644 --- a/mod/choice/index.php +++ b/mod/choice/index.php @@ -1,10 +1,12 @@ -set_url($CFG->wwwroot.'/mod/choice/index.php', array('id'=>$id)); + if (!$course = $DB->get_record('course', array('id'=>$id))) { print_error('invalidcourseid'); } diff --git a/mod/choice/report.php b/mod/choice/report.php index 542488b611..c15ebce9b1 100644 --- a/mod/choice/report.php +++ b/mod/choice/report.php @@ -1,4 +1,4 @@ -wwwroot.'/mod/choice/report.php', array('id'=>$id)); + if ($format !== CHOICE_PUBLISH_NAMES) { + $url->param('format', $format); + } + if ($download !== '') { + $url->param('download', $download); + } + if ($action !== '') { + $url->param('action', $action); + } + $PAGE->set_url($url); + if (! $cm = get_coursemodule_from_id('choice', $id)) { print_error("invalidcoursemodule"); } @@ -41,7 +53,7 @@ if (!$download) { $PAGE->navbar->add($strresponses); $PAGE->set_title(format_string($choice->name).": $strresponses"); - $PAGE->set_button(update_module_button($cm->id, $course->id, $strchoice)); + $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'choice')); echo $OUTPUT->header(); /// Check to see if groups are being used in this choice $groupmode = groups_get_activity_groupmode($cm); @@ -225,4 +237,4 @@ } echo $OUTPUT->footer(); -?> +?> \ No newline at end of file diff --git a/mod/choice/view.php b/mod/choice/view.php index 97fce9e8c6..be7cd8bc98 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -1,4 +1,4 @@ -wwwroot.'/mod/choice/view.php', array('id'=>$id)); + if ($action !== '') { + $url->param('action', $action); + } + $PAGE->set_url($url); + if (! $cm = get_coursemodule_from_id('choice', $id)) { print_error('invalidcoursemodule'); } @@ -37,7 +43,7 @@ } $PAGE->set_title(format_string($choice->name)); - $PAGE->set_button(update_module_button($cm->id, $course->id, $strchoice)); + $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'choice')); echo $OUTPUT->header(); /// Submit any new data if there is any