Compare commits

..

11 Commits

Author SHA1 Message Date
niklas.ortmann 9321d09489 Update home.php 2026-06-03 20:00:33 +02:00
niklas.ortmann 7269ea03db Update showCategory-controller.php 2026-06-03 19:58:09 +02:00
niklas.ortmann 2a3a15c92d Update showCategory.php 2026-06-03 19:58:05 +02:00
niklas.ortmann a7f1729e6e Update ArticleManager.php 2026-06-03 19:56:12 +02:00
niklas.ortmann cdccb0bfe8 debugging 2026-06-03 19:51:58 +02:00
niklas.ortmann 48501a9069 Update ArticleManager.php 2026-06-03 19:51:06 +02:00
niklas.ortmann a175765e33 Update main.css 2026-06-03 19:49:45 +02:00
niklas.ortmann 3d57c2e482 Update 404.php 2026-06-03 19:46:25 +02:00
niklas.ortmann bac4334fb8 Update showCategory-controller.php 2026-06-03 19:44:47 +02:00
niklas.ortmann aa3e7c2f36 Update showCategory.php 2026-06-03 19:43:41 +02:00
niklas.ortmann 46cd524f70 Update showCategory-controller.php 2026-06-03 19:43:40 +02:00
6 changed files with 24 additions and 34 deletions
+8
View File
@@ -4,6 +4,14 @@
-->
<main>
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "internal_error"): ?>
<p class="alert-message is-error">
Es ist ein interner Fehler beim Speichern aufgetreten. Bitte versuche es erneut.
</p>
<?php endif; ?>
<?php
unset($_SESSION["message"]);
?>
<h1>404 - Seite nicht vorhanden</h1>
<p>
Später im Projekt sollen über index.php?pfad= ... der Inhalt der index.php dynamisch gesetzt werden.
+3 -3
View File
@@ -39,21 +39,21 @@ include_once 'php/controller/home-controller.php';
<!-- Flexbox -->
<div class="flexbox">
<div class="container">
<a href="index.php?pfad=informatik" class="category-link">Informatik</a>
<a href="index.php?pfad=showCategory&category=informatik" class="category-link">Informatik</a>
<div class="article-link">
<a href="index.php?pfad=showArticle&id=<?php echo $dummy3->getId()?>"><?php if(isset($dummy3)){echo $dummy3->getTitle();}else{echo "Fehler: Beitrag nicht gefunden!";} ?></a>
</div>
</div>
<div class="container">
<a href="index.php?pfad=mathe" class="category-link">Mathe</a>
<a href="index.php?pfad=showCategory&category=mathe" class="category-link">Mathe</a>
<div class="article-link">
<a href="index.php?pfad=showArticle&id=<?php echo $dummy1->getId()?>"><?php if(isset($dummy1)){echo $dummy1->getTitle();}else{echo "Fehler: Beitrag nicht gefunden!";} ?></a>
</div>
</div>
<div class="container">
<a href="index.php?pfad=physik" class="category-link">Physik</a>
<a href="index.php?pfad=showCategory&category=physik" class="category-link">Physik</a>
<div class="article-link">
<a href="index.php?pfad=showArticle&id=<?php echo $dummy2->getId()?>"><?php if(isset($dummy2)){echo $dummy2->getTitle();}else{echo "Fehler: Beitrag nicht gefunden!";} ?></a>
</div>
+3 -4
View File
@@ -13,16 +13,15 @@ include_once "php/controller/showCategory-controller.php";
<div class="s-res-item">
<div class="s-res-content">
<h2 class="s-res-item-title">
<a href="index.php?pfad=showArticle&id=<?php echo $article['id']; ?>" class="s-res-link">
<?php echo htmlspecialchars($article['title']); ?>
<a href="index.php?pfad=showArticle&id=<?php echo $article->getId(); ?>" class="s-res-link">
<?php echo htmlspecialchars($article->getTitle()); ?>
</a>
</h2>
<p class="s-res-author">Von: <span class="s-res-author-name"><?php echo htmlspecialchars($article['author']); ?></span></p>
<p class="s-res-author">Von: <span class="s-res-author-name"><?php echo htmlspecialchars($article->getAuthor()); ?></span></p>
</div>
<div class="s-res-arrow">&rarr;</div>
</div>
<?php endforeach; ?>
<?php
else: ?>
<p> Es sind noch keine Beiträge in dieser Kategorie enthalten.</p>
+4
View File
@@ -22,6 +22,10 @@ a, button, input, select, textarea, label, main{
font-family: Arial, Helvetica, sans-serif;
}
h1 {
text-transform: uppercase;
}
.flexbox {
display: flex;
flex-direction: row;
+3 -3
View File
@@ -1,7 +1,7 @@
<?php
require_once 'model/LocalArticleManager.php';
require_once 'model/ArticleManager.php';
require_once 'validator/article-validator.php';
require_once 'php/model/Article.php';
require_once 'php/model/ArticleManager.php';
require_once 'php/validator/article-validator.php';
if (isset($_GET["category"]) && !empty($_GET["category"]) && articleCategoryValidator($_GET["category"])){
$category = $_GET["category"];
+3 -24
View File
@@ -19,7 +19,7 @@ class ArticleManager extends LocalArticleManager
"Satz des Pythagoras",
"Der Satz des Pythagoras wurde von dem griechischen Philosophen Pythagoras von Samos formuliert und im dritten Jahrhundert vor Christus veröffentlicht. In der beigefügten Abbildung sehen wir ein rechtwinkliges Dreieck...",
"max.mustermann",
"Mathe",
"mathe",
"Dreiecke, Dreiecksseiten berechnen"
);
}
@@ -28,7 +28,7 @@ class ArticleManager extends LocalArticleManager
"Tunneleffekt",
"Der Tunneleffekt ist ein quantenmechanisches Phänomen, bei dem Teilchen...",
"max.mustermann",
"Physik",
"physik",
"Quantenphysik, Energie"
);
}
@@ -37,33 +37,12 @@ class ArticleManager extends LocalArticleManager
"Datenschutz vs Datensicherheit",
"Datenschutz ist in unserer digital vernetzten Welt allgegenwärtig...",
"max.mustermann",
"Informatik",
"informatik",
"Daten, DSGVO"
);
}
return $articleManager;
}
public function getArticlesByCategory($category)
{
$articles = $this->getAllArticles();
$filteredArticles = [];
foreach ($articles as $article) {
if (isset($article['category']) && $article['category'] == $category) {
$filteredArticles[] = new Article(
intval($article['id']),
$article['title'],
$article['content'],
$article['author'],
$article['category'],
$article['tags'],
$article['creationDate']
);
}
}
return $filteredArticles;
}
}