Skip to content

Commit 15db45a

Browse files
author
Marvin Kuhn
committed
added option for comments hidden by default
1 parent 96690cf commit 15db45a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Classes/Form/Finisher/AddCommentFormFinisher.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ class AddCommentFormFinisher extends AbstractFinisher
1515
*/
1616
protected $commentService;
1717

18+
/**
19+
* @var bool
20+
* @Flow\InjectConfiguration(path="hidden")
21+
*/
22+
protected $defaultHidden;
23+
1824
/**
1925
* this finisher adds a comment to a given node
2026
*/
@@ -42,7 +48,7 @@ protected function getCommentDto(): CommentDto
4248
$comment->setName($this->parseOption('name'));
4349
$comment->setEmail($this->parseOption('email'));
4450
$comment->setContent($this->parseOption('content'));
45-
$comment->setIsHidden(true);
51+
$comment->setIsHidden($this->defaultHidden);
4652

4753
return $comment;
4854
}

Configuration/Settings.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
Breadlesscode:
22
Commentable:
3+
# should the comment be added to the top?
34
addToTop: true
5+
# should comments be hidden by default
6+
hidden: true

0 commit comments

Comments
 (0)