From 5115697a62d11157d7878a706f47db599593a203 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 20 Sep 2018 18:36:28 +0400 Subject: Comments added Signed-off-by: Valentin Popov --- service.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'service.php') 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 ); -- cgit v1.2.3