aboutsummaryrefslogtreecommitdiff
path: root/service.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-09-20 17:36:28 +0300
committerValentin Popov <info@valentineus.link>2018-09-20 17:36:28 +0300
commit5115697a62d11157d7878a706f47db599593a203 (patch)
tree92975a6e0e99c6007fcda04b0fd0c108f265c0b1 /service.php
parent68a1928a4cf812b42a10a62d8374ddabf35e08f4 (diff)
downloadlocal_webhooks-5115697a62d11157d7878a706f47db599593a203.tar.xz
local_webhooks-5115697a62d11157d7878a706f47db599593a203.zip
Comments added
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'service.php')
-rw-r--r--service.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/service.php b/service.php
index 202f59f..093936f 100644
--- a/service.php
+++ b/service.php
@@ -40,10 +40,12 @@ $context = context_system::instance();
$mForm = new local_webhooks_service_edit_form( $PAGE->url );
$formData = (array) $mForm->get_data();
+/* Cancel */
if ( $mForm->is_cancelled() ) {
redirect( $mainPage );
}
+/* Updating the data */
if ( !empty( $formData ) && confirm_sesskey() ) {
if ( isset( $formData[ "events" ] ) ) {
$formData[ "events" ] = array_keys( $formData[ "events" ] );
@@ -59,6 +61,7 @@ if ( !empty( $formData ) && confirm_sesskey() ) {
redirect( $mainPage, new lang_string( "changessaved", "moodle" ) );
}
+/* Loading service data */
if ( !empty( $serviceId ) ) {
$service = local_webhooks_api::get_service( $serviceId );
$service->events = array_fill_keys( $service->events, 1 );