Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-38715 SCORM fix missing calls to setType and remove old call to s…

…etMaxFileSize
  • Loading branch information...
commit 1de23b7fdc9ca3c9d0a507e8b964819cdb0d4544 1 parent 373a8e0
Dan Marsden authored March 28, 2013

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  mod/scorm/mod_form.php
6  mod/scorm/mod_form.php
@@ -69,6 +69,7 @@ function definition() {
69 69
         // Reference
70 70
         if (count($scormtypes) > 1) {
71 71
             $mform->addElement('select', 'scormtype', get_string('scormtype', 'scorm'), $scormtypes);
  72
+            $mform->setType('scormtype', PARAM_ALPHA);
72 73
             $mform->addHelpButton('scormtype', 'scormtype', 'scorm');
73 74
             $mform->addElement('text', 'packageurl', get_string('packageurl', 'scorm'), array('size'=>60));
74 75
             $mform->setType('packageurl', PARAM_RAW);
@@ -76,11 +77,10 @@ function definition() {
76 77
             $mform->disabledIf('packageurl', 'scormtype', 'eq', SCORM_TYPE_LOCAL);
77 78
         } else {
78 79
             $mform->addElement('hidden', 'scormtype', SCORM_TYPE_LOCAL);
  80
+            $mform->setType('scormtype', PARAM_ALPHA);
79 81
         }
80 82
 
81 83
         // New local package upload
82  
-        $maxbytes = get_max_upload_file_size($CFG->maxbytes, $COURSE->maxbytes);
83  
-        $mform->setMaxFileSize($maxbytes);
84 84
         $mform->addElement('filepicker', 'packagefile', get_string('package', 'scorm'));
85 85
         $mform->addHelpButton('packagefile', 'package', 'scorm');
86 86
         $mform->disabledIf('packagefile', 'scormtype', 'noteq', SCORM_TYPE_LOCAL);
@@ -243,12 +243,14 @@ function definition() {
243 243
         if (count($scormtypes) > 1) {
244 244
             // Update packages timing
245 245
             $mform->addElement('select', 'updatefreq', get_string('updatefreq', 'scorm'), scorm_get_updatefreq_array());
  246
+            $mform->setType('updatefreq', PARAM_INT);
246 247
             $mform->setDefault('updatefreq', $cfg_scorm->updatefreq);
247 248
             $mform->setAdvanced('updatefreq', $cfg_scorm->updatefreq_adv);
248 249
             $mform->addHelpButton('updatefreq', 'updatefreq', 'scorm');
249 250
             $mform->disabledIf('updatefreq', 'scormtype', 'eq', SCORM_TYPE_LOCAL);
250 251
         } else {
251 252
             $mform->addElement('hidden', 'updatefreq', 0);
  253
+            $mform->setType('updatefreq', PARAM_INT);
252 254
         }
253 255
         //-------------------------------------------------------------------------------
254 256
         // Hidden Settings

0 notes on commit 1de23b7

Please sign in to comment.
Something went wrong with that request. Please try again.