diff --git a/content/updateArticle.php b/content/updateArticle.php index 8555072..cc6fb00 100644 --- a/content/updateArticle.php +++ b/content/updateArticle.php @@ -5,10 +5,25 @@ if (!isset($_SESSION["user"])) { exit(); } include_once 'php/controller/showArticle-controller.php'; + +// Aktuelle Blockliste ermitteln: +$rawContent = '[]'; +if (isset($_SESSION['old_content']) && !empty($_SESSION['old_content'])) { + $rawContent = $_SESSION['old_content']; + unset($_SESSION['old_content']); +} elseif (isset($content) && !empty($content)) { + $rawContent = $content; +} + +$blocks = json_decode($rawContent, true); +if (!is_array($blocks)) { + $blocks = []; +} +$blocks = array_values($blocks); ?>
" id="editor-form" enctype="multipart/form-data" class="article-editor-scope.editor-container article-editor-scope editor-container"> @@ -27,32 +42,49 @@ include_once 'php/controller/showArticle-controller.php'; ?>" placeholder="Titel hier eingeben" required> - -
+ +
+ $block): ?> + +
+ - -
- - + + + + + + + + + + + +
+
- - - - - +
+ +
+ + +
+
@@ -289,4 +321,4 @@ include_once 'php/controller/showArticle-controller.php'; - + \ No newline at end of file