Added feedback notifications for successful edits to pages aside from users and settings (iss0000159).

This commit is contained in:
Joshua Ramon Enslin 2018-06-18 15:20:24 +02:00 committed by Stefan Rohde-Enslin
parent c6f481ffcb
commit e73262a649
3 changed files with 9 additions and 1 deletions

View File

@ -51,6 +51,7 @@ if (isset($task) and $task == "update") {
file_put_contents(targetFile, $content, LOCK_EX); file_put_contents(targetFile, $content, LOCK_EX);
$_SESSION["editHistory"] = ["changesStored", $translations['storedEditsToPageElement'] . " $title"];
header('Location: editHTMLPage.php?id=' . $id); header('Location: editHTMLPage.php?id=' . $id);
return; return;

View File

@ -51,7 +51,9 @@ if (isset($task)) {
if (!isset($id)) $id = "0"; if (!isset($id)) $id = "0";
$targetID = storePage($pages, ["title" => (string)$title, "content" => (string)$content, "higher" => $higher, "public" => (bool)$public], (int)$id); $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); header('Location: page.php?id=' . $targetID);
return;
} }
@ -63,12 +65,14 @@ if (isset($task)) {
unlink(__DIR__ . "/../data/static/$id.json"); unlink(__DIR__ . "/../data/static/$id.json");
generateStaticPgCaches(); generateStaticPgCaches();
$_SESSION["editHistory"] = ["changesAborted", $translations['deletedPage'] . " $title"];
header('Location: pages.php'); header('Location: pages.php');
return;
} }
} }
/* /*
* Output * Output
*/ */

View File

@ -27,6 +27,9 @@ $translations = [
"integrationWithMD" => "Integration with Museum-Digital", "integrationWithMD" => "Integration with Museum-Digital",
"languageUnavailable" => "This language is not available.", "languageUnavailable" => "This language is not available.",
"settingsUpdated" => "Updated settings.", "settingsUpdated" => "Updated settings.",
"storedEditsToPage" => "Stored edits to page.",
"storedEditsToPageElement" => "Stored edits to page element.",
"deletedPage" => "Removed page.",
"staticPageTitle" => "Page title", "staticPageTitle" => "Page title",
"staticPageContent" => "Page content", "staticPageContent" => "Page content",
"staticPagePublic" => "Draft / Public", "staticPagePublic" => "Draft / Public",