diff --git a/content/createArticle.php b/content/createArticle.php new file mode 100644 index 0000000..d447043 --- /dev/null +++ b/content/createArticle.php @@ -0,0 +1,36 @@ + +
+ +
+ + +
+ + + + +
diff --git a/css/article.css b/css/article.css new file mode 100644 index 0000000..5a859a7 --- /dev/null +++ b/css/article.css @@ -0,0 +1,99 @@ +/* editor in Flexbox */ +.wp-editor-scope.editor-container { + display: flex; + min-height: 100vh; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; + color: #1e1e1e; + background-color: #f0f2f5; + box-sizing: border-box; +} + +.wp-editor-scope * { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +/* Hauptbereich */ +.wp-editor-scope .editor-main { + flex: 1; + padding: 40px; + display: flex; + flex-direction: column; + gap: 20px; + background: #ffffff; +} + +.wp-editor-scope #post-title { + font-size: 2.5rem; + font-weight: 700; + border: none; + outline: none; + width: 100%; + background: transparent; +} + +.wp-editor-scope #post-content { + flex: 1; + font-size: 1.1rem; + line-height: 1.6; + border: none; + outline: none; + resize: none; + width: 100%; + background: transparent; +} + +/* Seitenleiste */ +.wp-editor-scope .editor-sidebar { + width: 300px; + background-color: #ffffff; + border-left: 1px solid #e0e0e0; + padding: 20px; + display: flex; + flex-direction: column; + gap: 24px; +} + +.wp-editor-scope .sidebar-block { + display: flex; + flex-direction: column; + gap: 8px; +} + +.wp-editor-scope .sidebar-block label { + font-weight: 600; + font-size: 0.9rem; +} + +.wp-editor-scope .required { + color: #d94f4f; +} + +/* Formularelemente innerhalb der Editor-Sidebar */ +.wp-editor-scope .editor-sidebar select, +.wp-editor-scope .editor-sidebar input[type="text"] { + width: 100%; + padding: 8px; + border: 1px solid #ccc; + border-radius: 4px; + font-size: 0.9rem; + background: #ffffff; +} + +/* Button-Zeugs */ +.wp-editor-scope .btn-publish { + background-color: #007cba; + color: white; + border: none; + padding: 12px; + border-radius: 4px; + font-weight: 600; + cursor: pointer; + font-size: 1rem; + width: 100%; +} + +.wp-editor-scope .btn-publish:hover { + background-color: #006ba1; +} diff --git a/includes/navbar.php b/includes/navbar.php index 564e929..2fa3bbb 100644 --- a/includes/navbar.php +++ b/includes/navbar.php @@ -126,7 +126,8 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden include_once 'search.php'; ?> - Anmelden - Registrieren + Anmelden + Registrieren + Beitrag erstellen \ No newline at end of file diff --git a/index.php b/index.php index 98209de..94f55a2 100644 --- a/index.php +++ b/index.php @@ -14,6 +14,7 @@ + EduForge diff --git a/php/model/article.php b/php/model/article.php index 656d22d..1169464 100644 --- a/php/model/article.php +++ b/php/model/article.php @@ -1,10 +1,53 @@ $title, + "content" => $content, + "author" => $author, + "email" => $_POST["Email"], + "date" => date("d.m.Y, H:i") + ); + $newData = base64_encode(serialize($newData)); + if (!file_exists("articles.txt")) { + $newData = fopen("articles.txt", "xb"); + fclose($newData); + } + $previousData = file_get_contents("gaestebuch.txt"); + if (file_put_contents("gaestebuch.txt", "$newData\n$previousData")) { + // TODO: Vernünftige Rückmeldung implementieren. + echo "Artikel erfolgreich gespeichert!"; + } else { + // TODO: passende Exceptions werfen. + echo "Fehler!"; + } + } + + public function updateArticle($id, $title, $content, $author) + { + // TODO: Implement updateArticle() method. + } + + public function deleteArticle($id) + { + // TODO: Implement deleteArticle() method. + } + + public function getArticle($id) + { + // TODO: Implement getArticle() method. + } + + public function getAllArticles() + { + // TODO: Implement getAllArticles() method. + } } ?> \ No newline at end of file diff --git a/php/model/articleDAO.php b/php/model/articleDAO.php index 568c950..6d66256 100644 --- a/php/model/articleDAO.php +++ b/php/model/articleDAO.php @@ -1,4 +1,7 @@