From 719a5e1fc8ff46045cb9324864acfe0de530cadf Mon Sep 17 00:00:00 2001 From: danpros Date: Tue, 2 Mar 2021 19:14:53 +0700 Subject: [PATCH] Add simple message --- system/admin/views/menu.html.php | 6 ++++-- system/htmly.php | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/system/admin/views/menu.html.php b/system/admin/views/menu.html.php index 211da36..db70661 100644 --- a/system/admin/views/menu.html.php +++ b/system/admin/views/menu.html.php @@ -103,8 +103,10 @@ function parseMenu($menu) { type: 'POST', url: 'admin/menu', dataType: 'json', - data: {'json': js} - + data: {'json': js}, + success: function (response) { + alert(response.message); + }, }); }); diff --git a/system/htmly.php b/system/htmly.php index c303fc0..74c0767 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -1766,6 +1766,9 @@ post('/admin/menu', function () { if (login()) { $json = from($_REQUEST, 'json'); file_put_contents('content/data/menu.json', json_encode($json, JSON_UNESCAPED_UNICODE)); + echo json_encode(array( + 'message' => 'Menu saved successfully!', + )); } });