Beitrag erstellen #13

Merged
niklas.ortmann merged 164 commits from Beitrag-erstellen into dev 2026-05-29 13:22:11 +02:00
3 changed files with 9 additions and 9 deletions
Showing only changes of commit 04195f5d92 - Show all commits
+4 -4
View File
@@ -1,9 +1,9 @@
<?php
if (!isset($abs_path)) {
require_once "../../path.php";
require_once "path.php";
}
require_once $abs_path . '/php/model/LocalArticleManager.php';
require_once '/php/model/LocalArticleManager.php';
try {
$articleManager = ArticleManager::getInstance();
@@ -14,7 +14,7 @@ try {
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if(!isset($_POST["title"]) ||!isset($_POST["content"]) || !isset($_POST["category"])){
$_SESSION["message"] = "missing_parameters";
header("location:" . $abs_path . "/index.php?pfad=createArticle");
header("location: index.php?pfad=createArticle");
}
$title = $_POST["title"];
@@ -26,7 +26,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$articleManager->addArticle($title, $content, $category, $author, $tags);
// Weiterleitung zur Homepage
header("location:". $abs_path . "/index.php");
header("location: index.php");
exit();
}
?>
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
if (!isset($abs_path)) {
require_once "../../path.php";
require_once "path.php";
}
require_once $abs_path . '/php/model/LocalArticleManager.php';
require_once '/php/model/LocalArticleManager.php';
/**
* Die Klasse beinhaltet alle Methoden für die Operation mit den Artikel-Daten.
+3 -3
View File
@@ -1,8 +1,8 @@
<?php
if (!isset($abs_path)) {
require_once "../../path.php";
require_once "path.php";
}
require_once $abs_path . '/php/model/ArticleManagerDAO.php';
require_once '/php/model/ArticleManagerDAO.php';
/**
* Klasse: Eine lokale Lösung des ArticleManagerDAO.
* Schreibt zunächst Daten lokal in das Verzeichnis und kann diese wieder auslesen.
@@ -11,7 +11,7 @@ require_once $abs_path . '/php/model/ArticleManagerDAO.php';
*/
class LocalArticleManager implements ArticleManagerDAO {
private string $file = "../../data/articles.json";
private string $file = "data/articles.json";
/**
* Gibt die LocalArticleManager-Instanz zurück.