From e73262a649fe9b0225d7383699f46e071a7547ae Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Mon, 18 Jun 2018 15:20:24 +0200 Subject: [PATCH] Added feedback notifications for successful edits to pages aside from users and settings (iss0000159). --- edit/editHTMLPage.php | 1 + edit/page.php | 6 +++++- edit/translations/en.php | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/edit/editHTMLPage.php b/edit/editHTMLPage.php index ccc9bc6..c161fad 100644 --- a/edit/editHTMLPage.php +++ b/edit/editHTMLPage.php @@ -51,6 +51,7 @@ if (isset($task) and $task == "update") { file_put_contents(targetFile, $content, LOCK_EX); + $_SESSION["editHistory"] = ["changesStored", $translations['storedEditsToPageElement'] . " $title"]; header('Location: editHTMLPage.php?id=' . $id); return; diff --git a/edit/page.php b/edit/page.php index 2326faa..2950034 100644 --- a/edit/page.php +++ b/edit/page.php @@ -51,7 +51,9 @@ if (isset($task)) { if (!isset($id)) $id = "0"; $targetID = storePage($pages, ["title" => (string)$title, "content" => (string)$content, "higher" => $higher, "public" => (bool)$public], (int)$id); + $_SESSION["editHistory"] = ["changesStored", $translations['storedEditsToPage'] . " $title"]; header('Location: page.php?id=' . $targetID); + return; } @@ -63,12 +65,14 @@ if (isset($task)) { unlink(__DIR__ . "/../data/static/$id.json"); generateStaticPgCaches(); + + $_SESSION["editHistory"] = ["changesAborted", $translations['deletedPage'] . " $title"]; header('Location: pages.php'); + return; } } - /* * Output */ diff --git a/edit/translations/en.php b/edit/translations/en.php index 7ed1c07..f5f4652 100644 --- a/edit/translations/en.php +++ b/edit/translations/en.php @@ -27,6 +27,9 @@ $translations = [ "integrationWithMD" => "Integration with Museum-Digital", "languageUnavailable" => "This language is not available.", "settingsUpdated" => "Updated settings.", + "storedEditsToPage" => "Stored edits to page.", + "storedEditsToPageElement" => "Stored edits to page element.", + "deletedPage" => "Removed page.", "staticPageTitle" => "Page title", "staticPageContent" => "Page content", "staticPagePublic" => "Draft / Public",