diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index b341a8a..707e2b3 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " diff --git a/content/showArticle.php b/content/showArticle.php index aea506c..10c09f0 100644 --- a/content/showArticle.php +++ b/content/showArticle.php @@ -5,6 +5,34 @@ $repliesByParent = []; $articleObj = null; include_once 'php/controller/showArticle-controller.php'; +/* + * Ermittelt, ob ohne JavaScript auf einen Kommentar + * geantwortet werden soll. + */ +$replyTo = filter_input( + INPUT_GET, + "reply_to", + FILTER_VALIDATE_INT +); + +$replyAuthor = null; + +if ($replyTo !== false && $replyTo !== null) { + foreach ($mainComments as $mainComment) { + if ($mainComment->getId() === $replyTo) { + $replyAuthor = $mainComment->getAuthor(); + break; + } + } +} + +/* + * Eine Antwort darf nur auf einen existierenden + * Hauptkommentar geschrieben werden. + */ +if ($replyAuthor === null) { + $replyTo = null; +} ?>
-
-
@@ -106,9 +132,24 @@ include_once 'php/controller/showArticle-controller.php';
-
+

Kommentare

+ +
"> + +
+ + + +
@@ -121,12 +162,22 @@ include_once 'php/controller/showArticle-controller.php';

getContent())); ?>

- +
@@ -153,17 +204,46 @@ include_once 'php/controller/showArticle-controller.php';
-
+ + "> + value=""> + value=""> - +

+ style="display: none;" + > + + + Antwort auf + + &id=#comment-form"> + Abbrechen + + +

+ +