From 95602678336cfefc4ffbded82fa103b2d89c5ae0 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 21 Dec 2017 11:30:16 +0400 Subject: Refactoring the editor code --- editservice.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'editservice.php') diff --git a/editservice.php b/editservice.php index 8a7d4f6..6e46e6f 100644 --- a/editservice.php +++ b/editservice.php @@ -59,12 +59,12 @@ if ($editing = boolval($serviceid)) { if ($data = $mform->get_data()) { if ($editing) { $data->id = $serviceid; - local_webhooks_update_record($data, false); - redirect($managerservice, new lang_string("eventwebserviceserviceupdated", "webservice")); + local_webhooks_update_record($data); } else { - local_webhooks_update_record($data, true); - redirect($managerservice, new lang_string("eventwebserviceservicecreated", "webservice")); + local_webhooks_create_record($data); } + + redirect($managerservice, new lang_string("changessaved", "moodle")); } /* The page title */ @@ -77,4 +77,5 @@ echo $OUTPUT->header(); /* Displays the form */ $mform->display(); +/* Footer */ echo $OUTPUT->footer(); \ No newline at end of file -- cgit v1.2.3