aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-12-03 17:29:52 +0300
committerValentin Popov <info@valentineus.link>2017-12-03 17:29:52 +0300
commit44a4729bab82e8bae3990ca9ca815257ca64374b (patch)
tree389f78f855f15b513b7ac79d9961b9014b5eacc4
parent9d65bf2c2c30a06b625ce74f23fff56a131396d6 (diff)
downloadtool_managertokens-44a4729bab82e8bae3990ca9ca815257ca64374b.tar.xz
tool_managertokens-44a4729bab82e8bae3990ca9ca815257ca64374b.zip
Added new selection items to the form
-rw-r--r--classes/standard_forms.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/classes/standard_forms.php b/classes/standard_forms.php
index 2b863a6..4bccfef 100644
--- a/classes/standard_forms.php
+++ b/classes/standard_forms.php
@@ -50,12 +50,16 @@ class token_editor_form extends moodleform {
/* Defines roles */
$targettypetypes = array(
+ "null" => new lang_string("none", "moodle"),
"user" => new lang_string("user", "moodle")
);
/* Defines additional actions */
$extendedactiontypes = array(
- "null" => new lang_string("none", "moodle"),
+ "cohort" => new lang_string("cohort", "cohort"),
+ "course" => new lang_string("course", "moodle"),
+ "group" => new lang_string("group", "moodle"),
+ "null" => new lang_string("none", "moodle"),
"redirect" => new lang_string("redirect", "moodle")
);
@@ -76,14 +80,13 @@ class token_editor_form extends moodleform {
/* The role selection element */
$mform->addElement("select", "targettype", new lang_string("role", "moodle"), $targettypetypes);
- $mform->addRule("targettype", null, "required");
$mform->setDefault("targettype", "user");
$mform->setType("targettype", PARAM_TAG);
/* The identifier element */
$mform->addElement("text", "targetid", new lang_string("idnumbermod", "moodle"));
- $mform->addRule("targetid", null, "required");
- $mform->setType("targetid", PARAM_RAW_TRIMMED);
+ $mform->setDefault("targetid", 1);
+ $mform->setType("targetid", PARAM_INT);
/* The header of constraints */
$mform->addElement("header", "statsuserlogins", new lang_string("statsuserlogins", "moodle"));