summaryrefslogtreecommitdiff
path: root/classes/forms.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-26 16:41:16 +0300
committerValentin Popov <info@valentineus.link>2017-10-26 16:41:16 +0300
commit4f34a6db0f139370544730f539ff981124441f4b (patch)
tree27b7b3ae07581dbbf34c91154de6b860ebbf2fc7 /classes/forms.php
parenta7e41f77d28e2e8add613288988513abf35a87d4 (diff)
downloadlocal_webhooks-4f34a6db0f139370544730f539ff981124441f4b.tar.xz
local_webhooks-4f34a6db0f139370544730f539ff981124441f4b.zip
Refactoring the class displaying the form of the editor
Diffstat (limited to 'classes/forms.php')
-rw-r--r--classes/forms.php33
1 files changed, 10 insertions, 23 deletions
diff --git a/classes/forms.php b/classes/forms.php
index 6fb9972..2e38e70 100644
--- a/classes/forms.php
+++ b/classes/forms.php
@@ -63,46 +63,34 @@ class service_edit_form extends moodleform {
$mform =& $this->_form;
/* Form heading */
- $mform->addElement("header", "editserviceheader",
- new lang_string("service", "webservice"));
+ $mform->addElement("header", "editserviceheader", new lang_string("service", "webservice"));
/* Name of the service */
- $mform->addElement("text", "title",
- new lang_string("name", "moodle"),
- array("size" => 60));
- $mform->setType("title", PARAM_NOTAGS);
+ $mform->addElement("text", "title", new lang_string("name", "moodle"), array("size" => 60));
$mform->addRule("title", null, "required");
+ $mform->setType("title", PARAM_NOTAGS);
/* Callback address */
- $mform->addElement("text", "url",
- new lang_string("url", "moodle"),
- array("size" => 60));
- $mform->setType("url", PARAM_URL);
+ $mform->addElement("text", "url", new lang_string("url", "moodle"), array("size" => 60));
$mform->addRule("url", null, "required");
+ $mform->setType("url", PARAM_URL);
/* Enabling the service */
- $mform->addElement("advcheckbox", "enable",
- new lang_string("enable", "moodle"));
+ $mform->addElement("advcheckbox", "enable", new lang_string("enable", "moodle"));
$mform->setType("enable", PARAM_BOOL);
$mform->setDefault("enable", 1);
$mform->setAdvanced("enable");
/* Token */
- $mform->addElement("text", "token",
- new lang_string("token", "webservice"),
- array("size" => 60));
+ $mform->addElement("text", "token", new lang_string("token", "webservice"), array("size" => 60));
$mform->setType("token", PARAM_NOTAGS);
/* Content type */
- $mform->addElement("select", "type", "Content type",
- array(
- "json" => "application/json",
- "x-www-form-urlencoded" => "application/x-www-form-urlencoded"));
+ $mform->addElement("select", "type", "Content type", array("json" => "application/json", "x-www-form-urlencoded" => "application/x-www-form-urlencoded"));
$mform->setAdvanced("type");
/* Form heading */
- $mform->addElement("header", "editserviceheaderevent",
- new lang_string("edulevel", "moodle"));
+ $mform->addElement("header", "editserviceheaderevent", new lang_string("edulevel", "moodle"));
/* List of events */
$eventlist = report_eventlist_list_generator::get_all_events_list(true);
@@ -110,8 +98,7 @@ class service_edit_form extends moodleform {
/* Formation of the list of elements */
foreach ($eventlist as $event) {
- $events[$event["component"]][] =&
- $mform->createElement("checkbox", $event["eventname"], $event["eventname"]);
+ $events[$event["component"]][] =& $mform->createElement("checkbox", $event["eventname"], $event["eventname"]);
}
/* Displays groups of items */