]> git.mjollnir.org Git - moodle.git/commitdiff
mod-choice MDL-19805 Added PAGE->set_url calls and removed deprecated functions
authorsamhemelryk <samhemelryk>
Wed, 23 Sep 2009 06:34:39 +0000 (06:34 +0000)
committersamhemelryk <samhemelryk>
Wed, 23 Sep 2009 06:34:39 +0000 (06:34 +0000)
mod/choice/index.php
mod/choice/report.php
mod/choice/view.php

index 75cf6f72be153ea87d22e184916fc4c0e079e2a8..06563c297ad9b710b8c89012be2e78d143646074 100644 (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');
     }
index 542488b611aab4d63e3abf8f55e4b4cc106ce3b5..c15ebce9b19f9d729c7e3780656ee7bca6857f32 100644 (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);
     }
     echo $OUTPUT->footer();
 
-?>
+?>
\ No newline at end of file
index 97fce9e8c6bc6805d7b4eee5f83d23d741e3c199..be7cd8bc98a16bbd6ced80c4c61263e272528184 100644 (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