Added feedback when saving page content

This commit is contained in:
Andy Dixon
2024-10-03 08:07:54 +01:00
committed by Andy Dixon
parent b47b0917ed
commit 1e5b8fea62
3 changed files with 45 additions and 5 deletions
+3 -2
View File
@@ -4,11 +4,12 @@ require_once "../init.php";
switch ($_REQUEST["action"]) {
case "save":
header('Content-type: application/json');
if (!empty($_POST['uri']) && !empty($_POST['content'])) {
$_SESSION['core']->saveContent($_POST['uri'], $_POST['content']);
echo 'Page Updated.';
echo json_encode(array('message'=>'Page has been saved'));
} else {
echo 'Unable to save page';
echo json_encode(array('error'=>'Unable to save page'));
}
break;