summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-25 10:32:28 +0300
committerValentin Popov <info@valentineus.link>2017-10-25 11:09:23 +0300
commit0d8cb8688d1aedf5498b08863f271ce8f77f8912 (patch)
tree638476ca972b558acdc98bad18b2e86031dd93fa
parent430c9fa09a4fc1995b8b7751f7b41aeec18298b4 (diff)
downloadlocal_webhooks-0d8cb8688d1aedf5498b08863f271ce8f77f8912.tar.xz
local_webhooks-0d8cb8688d1aedf5498b08863f271ce8f77f8912.zip
Displays the list of events
-rw-r--r--classes/forms.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/forms.php b/classes/forms.php
index c95b280..2fbd8cc 100644
--- a/classes/forms.php
+++ b/classes/forms.php
@@ -28,6 +28,7 @@ defined("MOODLE_INTERNAL") || die();
require_once($CFG->libdir . "/formslib.php");
+use report_eventlist_list_generator;
use lang_string;
use moodleform;
@@ -76,6 +77,21 @@ class service_edit_form extends moodleform {
$mform->setDefault("enable", 1);
$mform->setAdvanced("enable");
+ /* Form heading */
+ $mform->addElement("header", "editserviceheaderevent",
+ new lang_string("edulevel", "moodle"));
+
+ /* List of events */
+ $eventlist = report_eventlist_list_generator::get_all_events_list(true);
+ foreach ($eventlist as $event) {
+ $eventname = $event["eventname"];
+ $mform->addElement("advcheckbox", "events[$eventname]",
+ $eventname, $event["component"],
+ array("group" => "events"));
+ $mform->setType($eventname, PARAM_BOOL);
+ }
+ $this->add_checkbox_controller("events", null, null, 1);
+
/* Control Panel */
$this->add_action_buttons(true);
}