mod-choice MDL-19805 Added PAGE->set_url calls and removed deprecated functions

This commit is contained in:
samhemelryk 2009-09-23 06:34:39 +00:00
parent 4158fc6883
commit 97dcb8f88e
3 changed files with 26 additions and 6 deletions

View File

@ -1,10 +1,12 @@
<?php // $Id$
<?php
require_once("../../config.php");
require_once("lib.php");
$id = required_param('id',PARAM_INT); // course
$PAGE->set_url($CFG->wwwroot.'/mod/choice/index.php', array('id'=>$id));
if (!$course = $DB->get_record('course', array('id'=>$id))) {
print_error('invalidcourseid');
}

View File

@ -1,4 +1,4 @@
<?php // $Id$
<?php
require_once("../../config.php");
require_once("lib.php");
@ -9,6 +9,18 @@
$action = optional_param('action', '', PARAM_ALPHA);
$attemptids = optional_param('attemptid', array(), PARAM_INT); //get array of responses to delete.
$url = new moodle_url($CFG->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();
?>
?>

View File

@ -1,4 +1,4 @@
<?php // $Id$
<?php
require_once("../../config.php");
require_once("lib.php");
@ -8,6 +8,12 @@
$action = optional_param('action', '', PARAM_ALPHA);
$attemptids = optional_param('attemptid', array(), PARAM_INT); // array of attempt ids for delete action
$url = new moodle_url($CFG->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