]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-6826 Removed the optional_param lines at the top, and set the submit buttons...
authornicolasconnault <nicolasconnault>
Wed, 6 Feb 2008 10:25:45 +0000 (10:25 +0000)
committernicolasconnault <nicolasconnault>
Wed, 6 Feb 2008 10:25:45 +0000 (10:25 +0000)
course/modedit.php
course/moodleform_mod.php

index 48f2e55094e6aa3807c12264b12741df445946e1..f9f022dc55023fa72d2c06711dc04ed87f9280db 100644 (file)
@@ -8,12 +8,10 @@
 
     require_login();
 
-    $add    = optional_param('add', 0, PARAM_ALPHA);
-    $update = optional_param('update', 0, PARAM_INT);
-    $return = optional_param('return', 0, PARAM_BOOL); //return to course/view.php if false or mod/modname/view.php if true
-    $type   = optional_param('type', '', PARAM_ALPHANUM);
-    $submitbutton  = optional_param('submitbutton', null, PARAM_ALPHANUM);
-    $submitbutton2 = optional_param('submitbutton2', null, PARAM_ALPHANUM);
+    $add           = optional_param('add', 0, PARAM_ALPHA);
+    $update        = optional_param('update', 0, PARAM_INT);
+    $return        = optional_param('return', 0, PARAM_BOOL); //return to course/view.php if false or mod/modname/view.php if true
+    $type          = optional_param('type', '', PARAM_ALPHANUM);
 
     if (!empty($add)) {
         $section = required_param('section', PARAM_INT);
 
         rebuild_course_cache($course->id);
         
-        if (!empty($fromform->submitbutton)) { 
+        if (isset($fromform->submitbutton)) { 
             redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$fromform->coursemodule");
         } else {
             redirect("$CFG->wwwroot/course/view.php?id=$course->id");
index 0c6ee6c94897c711581dbd7bb0c3af97ff40cba2..ea32390a797b90d6cc5982498322f628a1db6c66 100644 (file)
@@ -324,6 +324,7 @@ class moodleform_mod extends moodleform {
         }
 
         $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
+        $mform->setType('buttonar', PARAM_RAW);
         $mform->closeHeaderBefore('buttonar');
     }
 }