aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-27 11:16:21 +0300
committerValentin Popov <info@valentineus.link>2017-10-27 11:16:21 +0300
commitd6d13338e31896034f69228a396d8cbdce81a97c (patch)
tree0a34a8df93e2a264ff37b0a59e277d53d0a474f8
parent43ee70c01e430729369ff18a71170bf7a2788b06 (diff)
downloadlocal_webhooks-d6d13338e31896034f69228a396d8cbdce81a97c.tar.xz
local_webhooks-d6d13338e31896034f69228a396d8cbdce81a97c.zip
Grinding of the final class
-rw-r--r--classes/editform.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/classes/editform.php b/classes/editform.php
index 5e75050..89786bf 100644
--- a/classes/editform.php
+++ b/classes/editform.php
@@ -47,7 +47,7 @@ class service_edit_form extends moodleform {
}
/**
- * Unpacks data for display.
+ * Preparing data before displaying.
*
* @param object $record
*/
@@ -64,17 +64,18 @@ class service_edit_form extends moodleform {
*/
protected function definition() {
$mform =& $this->_form;
+ $size = array("size" => 60);
/* Form heading */
$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->addElement("text", "title", new lang_string("name", "moodle"), $size);
$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->addElement("text", "url", new lang_string("url", "moodle"), $size);
$mform->addRule("url", null, "required");
$mform->setType("url", PARAM_URL);
@@ -85,11 +86,12 @@ class service_edit_form extends moodleform {
$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"), $size);
$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"));
+ $contenttype = array("json" => "application/json", "x-www-form-urlencoded" => "application/x-www-form-urlencoded");
+ $mform->addElement("select", "type", "Content type", $contenttype);
$mform->setAdvanced("type");
/* Form heading */