Permalink
Browse files

MDL-38710 assign: convert selectedusers to PARAM_SEQUENCE

This param type is more appropiate.
  • Loading branch information...
danpoltawski authored and damyon committed Apr 15, 2013
1 parent 68d646f commit 9231cd88265cce550361ab3f1fead288c72129be
@@ -73,7 +73,7 @@ public function definition() {
$mform->addElement('hidden', 'userid', $userid);
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'selectedusers', $batchusers);
$mform->setType('selectedusers', PARAM_TEXT);
$mform->setType('selectedusers', PARAM_SEQUENCE);
$mform->addElement('hidden', 'action', 'saveextension');
$mform->setType('action', PARAM_ALPHA);
$this->add_action_buttons(true, get_string('savechanges', 'assign'));
@@ -78,7 +78,7 @@ public function definition() {
$mform->addElement('hidden', 'pluginsubtype', 'assignfeedback');
$mform->setType('pluginsubtype', PARAM_PLUGIN);
$mform->addElement('hidden', 'selectedusers', implode(',', $params['users']));
$mform->setType('selectedusers', PARAM_TEXT);
$mform->setType('selectedusers', PARAM_SEQUENCE);
$this->add_action_buttons(true, get_string('uploadfiles', 'assignfeedback_file'));
}
@@ -589,7 +589,7 @@ public function view_upload_zip() {
*/
public function view_page($action) {
if ($action == 'uploadfiles') {
$users = required_param('selectedusers', PARAM_TEXT);
$users = required_param('selectedusers', PARAM_SEQUENCE);
return $this->view_batch_upload_files(explode(',', $users));
}
if ($action == 'uploadzip') {
@@ -70,7 +70,7 @@ public function definition() {
$mform->addElement('hidden', 'id', $instance['cm']);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'selectedusers', '', array('class'=>'selectedusers'));
$mform->setType('selectedusers', PARAM_TEXT);
$mform->setType('selectedusers', PARAM_SEQUENCE);
$mform->addElement('hidden', 'returnaction', 'grading');
$mform->setType('returnaction', PARAM_ALPHA);
View
@@ -1730,7 +1730,7 @@ protected function view_grant_extension($mform) {
require_once($CFG->dirroot . '/mod/assign/extensionform.php');
$o = '';
$batchusers = optional_param('selectedusers', '', PARAM_TEXT);
$batchusers = optional_param('selectedusers', '', PARAM_SEQUENCE);
$data = new stdClass();
$data->extensionduedate = null;
$userid = 0;
@@ -4295,7 +4295,7 @@ protected function process_save_extension(& $mform) {
// Need submit permission to submit an assignment.
require_capability('mod/assign:grantextension', $this->context);
$batchusers = optional_param('selectedusers', '', PARAM_TEXT);
$batchusers = optional_param('selectedusers', '', PARAM_SEQUENCE);
$userid = 0;
if (!$batchusers) {
$userid = required_param('userid', PARAM_INT);

0 comments on commit 9231cd8

Please sign in to comment.