From 2a765b979405b82ef58ab3833d370e4152ec60ba Mon Sep 17 00:00:00 2001 From: David Chalupsky Date: Tue, 12 Sep 2023 13:54:28 +0200 Subject: [PATCH] [FEATURE #34623] Extend Extension - Editing of Comments by Author - Deleting of Comments by Author - Send Mail to News Author on Comment Submit --- Classes/Controller/CommentController.php | 208 +++++++++++++++++- Classes/Domain/Model/Comment.php | 29 +++ Classes/Utility/Mail.php | 26 ++- Configuration/FlexForms/Plugin.xml | 6 +- .../tx_pwcomments_domain_model_comment.php | 7 + Configuration/TypoScript/Styling/setup.txt | 56 +++-- Configuration/TypoScript/constants.txt | 17 ++ Configuration/TypoScript/setup.txt | 20 +- Documentation/Configuration/Anchors/Index.rst | 16 ++ .../Configuration/Deleting/Index.rst | 32 +++ Documentation/Configuration/Editing/Index.rst | 32 +++ Documentation/Configuration/Index.rst | 8 +- Documentation/Configuration/Mails/Index.rst | 87 +++++++- .../Configuration/Moderation/Index.rst | 17 ++ Resources/Private/Language/de.locallang.xlf | 64 +++++- Resources/Private/Language/locallang.xlf | 46 +++- .../Private/Language/locallang_constants.xlf | 54 +++-- Resources/Private/Partials/Comment.html | 37 +++- Resources/Private/Templates/Comment/Edit.html | 55 +++++ .../Private/Templates/Comment/Index.html | 8 +- Resources/Private/Templates/Comment/New.html | 14 +- .../mailToAuthorAfterUpdateSubmit.html | 10 + .../Templates/MailNotification/newsMail.html | 15 ++ .../MailNotification/updateMail.html | 18 ++ .../MailNotification/updateNewsMail.html | 15 ++ Resources/Public/Icons/delete.svg | 1 + Resources/Public/Icons/edit.svg | 1 + ext_localconf.php | 4 +- 28 files changed, 800 insertions(+), 103 deletions(-) create mode 100644 Documentation/Configuration/Deleting/Index.rst create mode 100644 Documentation/Configuration/Editing/Index.rst create mode 100644 Resources/Private/Templates/Comment/Edit.html create mode 100644 Resources/Private/Templates/MailNotification/mailToAuthorAfterUpdateSubmit.html create mode 100644 Resources/Private/Templates/MailNotification/newsMail.html create mode 100644 Resources/Private/Templates/MailNotification/updateMail.html create mode 100644 Resources/Private/Templates/MailNotification/updateNewsMail.html create mode 100644 Resources/Public/Icons/delete.svg create mode 100644 Resources/Public/Icons/edit.svg diff --git a/Classes/Controller/CommentController.php b/Classes/Controller/CommentController.php index 20f5c08..5bdff15 100644 --- a/Classes/Controller/CommentController.php +++ b/Classes/Controller/CommentController.php @@ -8,6 +8,8 @@ * | 2015 Dennis Roemmich * | 2016-2017 Christian Wolfram */ + +use GeorgRinger\News\Domain\Repository\NewsRepository; use T3\PwComments\Domain\Model\Comment; use T3\PwComments\Domain\Model\Vote; use T3\PwComments\Domain\Repository\CommentRepository; @@ -17,10 +19,14 @@ use T3\PwComments\Utility\Mail; use T3\PwComments\Utility\Settings; use T3\PwComments\Utility\StringUtility; +use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Domain\Model\FrontendUser; use TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository; +use TYPO3\CMS\Extbase\Mvc\Exception\StopActionException; +use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; +use TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException; use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; @@ -208,12 +214,14 @@ public function indexAction(Comment $commentToReplyTo = null) } } } + $this->view->assign('upvotedCommentUids', $upvotedCommentUids); $this->view->assign('downvotedCommentUids', $downvotedCommentUids); $this->view->assign('comments', $comments); $this->view->assign('commentCount', $this->calculateCommentCount($comments)); $this->view->assign('commentToReplyTo', $commentToReplyTo); + $this->view->assign('userIdent', $this->currentAuthorIdent); } /** @@ -254,8 +262,8 @@ public function createAction(Comment $newComment = null) $newComment->setAuthor($author); } else { $newComment->setAuthor(null); - $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_pwcomments_unregistredUserName', $newComment->getAuthorName()); - $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_pwcomments_unregistredUserMail', $newComment->getAuthorMail()); + $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_pwcomments_unregisteredUserName', $newComment->getAuthorName()); + $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_pwcomments_unregisteredUserMail', $newComment->getAuthorMail()); } $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_pwcomments_lastComment', time()); @@ -280,6 +288,16 @@ public function createAction(Comment $newComment = null) $this->commentRepository->add($newComment); $this->getPersistenceManager()->persistAll(); + if (isset($this->settings['sendMailOnNewCommentsToNewsAuthor']) && $this->settings['sendMailOnNewCommentsToNewsAuthor']) { + $newsRepository = GeneralUtility::makeInstance(NewsRepository::class); + $news = $newsRepository->findByUid($newComment->getEntryUid()); + $this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject()); + $this->mailUtility->setControllerContext($this->controllerContext); + $this->mailUtility->setReceivers($news->getAuthorEmail()); + $this->mailUtility->setTemplatePath($this->settings['sendMailNewsAuthorTemplate']); + $this->mailUtility->sendMail($newComment, HashEncryptionUtility::createHashForComment($newComment)); + } + if (isset($this->settings['sendMailOnNewCommentsTo']) && $this->settings['sendMailOnNewCommentsTo']) { $this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject()); $this->mailUtility->setControllerContext($this->controllerContext); @@ -326,22 +344,192 @@ public function newAction(Comment $newComment = null, Comment $commentToReplyTo } $this->view->assign('commentToReplyTo', $commentToReplyTo); - // Get name of unregistred user + // Get name of unregistered user if ($newComment !== null && $newComment->getAuthorName()) { - $unregistredUserName = $newComment->getAuthorName(); + $unregisteredUserName = $newComment->getAuthorName(); } else { - $unregistredUserName = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_pwcomments_unregistredUserName'); + $unregisteredUserName = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_pwcomments_unregisteredUserName'); } - // Get mail of unregistred user + // Get mail of unregistered user if ($newComment !== null && $newComment->getAuthorMail()) { - $unregistredUserMail = $newComment->getAuthorMail(); + $unregisteredUserMail = $newComment->getAuthorMail(); + } else { + $unregisteredUserMail = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_pwcomments_unregisteredUserMail'); + } + + $this->view->assign('unregisteredUserName', $unregisteredUserName); + $this->view->assign('unregisteredUserMail', $unregisteredUserMail); + } + + /** + * Edit action + * + * @param Comment|null $updateComment Comment + * @return void + * + * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("updateComment") + */ + public function editAction(Comment $updateComment = null): void + { + if ($updateComment !== null) { + $this->view->assign('updateComment', $updateComment); + } + + // Get name of unregistered user + if ($updateComment !== null && $updateComment->getAuthorName()) { + $unregisteredUserName = $updateComment->getAuthorName(); } else { - $unregistredUserMail = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_pwcomments_unregistredUserMail'); + $unregisteredUserName = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_pwcomments_unregisteredUserName'); } - $this->view->assign('unregistredUserName', $unregistredUserName); - $this->view->assign('unregistredUserMail', $unregistredUserMail); + // Get mail of unregistered user + if ($updateComment !== null && $updateComment->getAuthorMail()) { + $unregisteredUserMail = $updateComment->getAuthorMail(); + } else { + $unregisteredUserMail = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_pwcomments_unregisteredUserMail'); + } + + $this->view->assign('unregisteredUserName', $unregisteredUserName); + $this->view->assign('unregisteredUserMail', $unregisteredUserMail); + } + + /** + * Update action + * + * @param Comment|null $updateComment + * @return bool + * @throws StopActionException + * @throws IllegalObjectTypeException + * @throws UnknownObjectException + * @TYPO3\CMS\Extbase\Annotation\Validate("T3\PwComments\Domain\Validator\CommentValidator", param="updateComment") + */ + public function updateAction(Comment $updateComment = null): bool + { + // Hidden field Spam-Protection + if (isset($this->settings['hiddenFieldSpamProtection']) && $this->settings['hiddenFieldSpamProtection'] + && $this->request->hasArgument($this->settings['hiddenFieldName']) + && $this->request->getArgument($this->settings['hiddenFieldName'])) { + $this->redirectToUri($this->buildUriByUid($this->pageUid) . '#' . $this->settings['updateCommentAnchor']); + return false; + } + if ($updateComment === null) { + $this->redirectToUri($this->buildUriByUid($this->pageUid)); + return false; + } + $this->createAuthorIdent(); + + $updateComment->setMessage( + StringUtility::prepareCommentMessage($updateComment->getMessage(), $this->settings['linkUrlsInComments']) + ); + + $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_pwcomments_lastComment', time()); + + $translateArguments = [ + 'name' => $updateComment->getAuthorName(), + 'email' => $updateComment->getCommentAuthorMailAddress(), + 'message' => $updateComment->getMessage(), + ]; + + // Modify comment if moderation is active + if (isset($this->settings['moderateNewComments']) && $this->settings['moderateNewComments']) { + $updateComment->setHidden(true); + $this->addFlashMessage( + LocalizationUtility::translate('tx_pwcomments.moderationNotice', 'PwComments', $translateArguments) + ); + } else { + $this->addFlashMessage( + LocalizationUtility::translate('tx_pwcomments.updateSuccess', 'PwComments', $translateArguments) + ); + } + + $this->commentRepository->update($updateComment); + $this->getPersistenceManager()->persistAll(); + $newsRepository = GeneralUtility::makeInstance(NewsRepository::class); + $news = $newsRepository->findByUid($updateComment->getEntryUid()); + + + if (isset($this->settings['sendMailOnNewCommentsToNewsAuthor']) && $this->settings['sendMailOnNewCommentsToNewsAuthor']) { + $newsRepository = GeneralUtility::makeInstance(NewsRepository::class); + $news = $newsRepository->findByUid($updateComment->getEntryUid()); + $this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject()); + $this->mailUtility->setControllerContext($this->controllerContext); + $this->mailUtility->setReceivers($news->getAuthorEmail()); + $this->mailUtility->setTemplatePath($this->settings['sendMailNewsAuthorUpdateTemplate']); + $this->mailUtility->setSubjectLocallangKey('tx_pwcomments.notificationMail.update.subject'); + $this->mailUtility->sendMail($updateComment, HashEncryptionUtility::createHashForComment($updateComment)); + } + + if (isset($this->settings['sendMailOnNewCommentsTo']) && $this->settings['sendMailOnNewCommentsTo']) { + $this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject()); + $this->mailUtility->setControllerContext($this->controllerContext); + $this->mailUtility->setReceivers($this->settings['sendMailOnNewCommentsTo']); + $this->mailUtility->setTemplatePath($news === null ? $this->settings['sendMailUpdateTemplate'] : $this->settings['sendMailNewsAuthorUpdateTemplate']); + $this->mailUtility->setSubjectLocallangKey('tx_pwcomments.notificationMail.update.subject'); + $this->mailUtility->sendMail($updateComment, HashEncryptionUtility::createHashForComment($updateComment)); + } + + if (isset($this->settings['sendMailToAuthorAfterSubmit']) && + $this->settings['sendMailToAuthorAfterSubmit'] && + $updateComment->hasCommentAuthorMailAddress() + ) { + $this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject()); + $this->mailUtility->setControllerContext($this->controllerContext); + $this->mailUtility->setReceivers($updateComment->getCommentAuthorMailAddress()); + $this->mailUtility->setTemplatePath($news === null ? $this->settings['sendMailToAuthorAfterSubmitUpdateTemplate'] : $this->settings['sendMailNewsAuthorUpdateTemplate']); + $this->mailUtility->setSubjectLocallangKey('tx_pwcomments.notificationMail.update.subject'); + $this->mailUtility->sendMail($updateComment); + } + + if (isset($this->settings['moderateNewComments']) && $this->settings['moderateNewComments']) { + $anchor = '#' . $this->settings['successfulAnchor']; + } else { + $anchor = '#' . $this->settings['commentAnchorPrefix'] . $updateComment->getUid(); + } + + $this->redirectToUri($this->buildUriByUid($this->pageUid, true) . $anchor); + } + + /** + * Delete action + * + * @param string $commentUid Comment + * @return void + * + * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("commentUid") + */ + public function deleteAction(string $commentUid): void + { + $commentWithReplies = $this->commentRepository->findByCommentUid($commentUid); + $dataHandler = GeneralUtility::makeInstance(DataHandler::class); + if (null !== $commentWithReplies) { + $votes = $commentWithReplies->getVotes()->toArray(); + if (!empty($votes)) { + foreach ($votes as $vote) { + $cmd['tx_pwcomments_domain_model_vote'][$vote->getUid()]['delete'] = 1; + } + } + $replies = $commentWithReplies->getReplies()->toArray(); + if ($replies !== null) { + foreach ($replies as $reply) { + $cmd['tx_pwcomments_domain_model_comment'][$reply->getUid()]['delete'] = 1; + $replyVotes = $reply->getVotes()->toArray(); + if (!empty($replyVotes)) { + foreach ($replyVotes as $replyVote) { + $cmd['tx_pwcomments_domain_model_vote'][$replyVote->getUid()]['delete'] = 1; + } + } + } + } + $cmd['tx_pwcomments_domain_model_comment'][$commentWithReplies->getUid()]['delete'] = 1; + $dataHandler->start([], $cmd); + $dataHandler->process_cmdmap(); + $this->addFlashMessage( + LocalizationUtility::translate('tx_pwcomments.custom.deletedComment', 'PwComments') + ); + } + + $this->redirectToUri($this->buildUriByUid($this->pageUid, true)); } /** diff --git a/Classes/Domain/Model/Comment.php b/Classes/Domain/Model/Comment.php index a047a10..9d83207 100644 --- a/Classes/Domain/Model/Comment.php +++ b/Classes/Domain/Model/Comment.php @@ -39,6 +39,13 @@ class Comment extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity */ protected $crdate; + /** + * tstamp as unix timestamp + * + * @var int + */ + protected $tstamp; + /** * hidden state * @@ -182,6 +189,27 @@ public function setCrdate($crdate) $this->crdate = $crdate; } + /** + * Getter for tstamp + * + * @return int tstamp + */ + + public function getTstamp() + { + return $this->tstamp; + } + /** + * Setter for tstamp + * + * @param int $tstamp tstamp + * @return void + */ + public function setTstamp($tstamp) + { + $this->tstamp = $tstamp; + } + /** * Getter for crdate * @@ -192,6 +220,7 @@ public function getCrdate() return $this->crdate; } + /** * Setter for hidden state * diff --git a/Classes/Utility/Mail.php b/Classes/Utility/Mail.php index 27d0691..f8bca69 100644 --- a/Classes/Utility/Mail.php +++ b/Classes/Utility/Mail.php @@ -8,6 +8,8 @@ * | 2015 Dennis Roemmich * | 2016-2017 Christian Wolfram */ + +use GeorgRinger\News\Domain\Repository\NewsRepository; use TYPO3\CMS\Core\Mail\MailMessage; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext; @@ -156,15 +158,23 @@ protected function getMailMessage(Comment $comment, $hash) if (!file_exists($mailTemplate)) { throw new \Exception('Mail template (' . $mailTemplate . ') not found. '); } - $this->fluidTemplate->setTemplatePathAndFilename($mailTemplate); - $this->fluidTemplate->assignMultiple( - [ - 'hash' => $hash, - 'comment' => $comment, - 'settings' => $this->settings - ] - ); + $params = [ + 'hash' => $hash, + 'comment' => $comment, + 'settings' => $this->settings + ]; + + if (isset($this->settings['sendMailOnNewCommentsToNewsAuthor'])) { + $newsRepository = GeneralUtility::makeInstance(NewsRepository::class); + $news = $newsRepository->findByUid($comment->getEntryUid()); + if (null !== $news) { + $params['news'] = $news; + $params['site'] = GeneralUtility::getIndpEnv('HTTP_HOST'); + } + } + $this->fluidTemplate->assignMultiple($params); + return $this->fluidTemplate->render(); } diff --git a/Configuration/FlexForms/Plugin.xml b/Configuration/FlexForms/Plugin.xml index 2b48181..3eb059a 100644 --- a/Configuration/FlexForms/Plugin.xml +++ b/Configuration/FlexForms/Plugin.xml @@ -16,11 +16,11 @@ LLL:EXT:pw_comments/Resources/Private/Language/locallang_db.xlf:plugin.mode.index - Comment->index;Comment->upvote;Comment->downvote + Comment->index;Comment->upvote;Comment->downvote;Comment->delete - LLL:EXT:pw_comments/Resources/Private/Language/locallang_db.xlf:plugin.mode.new - Comment->new;Comment->create;Comment->confirmComment + LLL:EXT:pw_comments/Resources/Private/Language/locallang_db.xlf:plugin.mode.new + Comment->new;Comment->create;Comment->edit;Comment->update;Comment->confirmComment diff --git a/Configuration/TCA/tx_pwcomments_domain_model_comment.php b/Configuration/TCA/tx_pwcomments_domain_model_comment.php index 83affba..4da5148 100644 --- a/Configuration/TCA/tx_pwcomments_domain_model_comment.php +++ b/Configuration/TCA/tx_pwcomments_domain_model_comment.php @@ -94,6 +94,13 @@ 'type' => 'input' ] ], + 'tstamp' => [ + 'exclude' => 0, + 'label' => $ll . 'general.tstamp', + 'config' => [ + 'type' => 'input' + ] + ], 'hidden' => [ 'exclude' => 0, 'label' => $ll . 'general.hidden', diff --git a/Configuration/TypoScript/Styling/setup.txt b/Configuration/TypoScript/Styling/setup.txt index 0def207..c11d9be 100644 --- a/Configuration/TypoScript/Styling/setup.txt +++ b/Configuration/TypoScript/Styling/setup.txt @@ -217,6 +217,11 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } +.comment-box .comment-content .comment-tstamp { + font-size: 13px; + color: #999; + padding-top: 24px; +} .comment-box .comment-name.by-author, .comment-box .comment-name.by-author a {color: #03658c;} .comment-box .comment-name.by-author:after { @@ -246,11 +251,15 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( .comment-actions a.upvote, .comment-actions a.downvote, -.comment-actions a.reply { +.comment-actions a.reply, +.comment-actions a.edit, +.comment-actions a.delete { margin: 0 2px; } -.comment-actions a.reply { +.comment-actions a.reply, +.comment-actions a.edit, +.comment-actions a.delete { margin-left: 25px; vertical-align: text-bottom; } @@ -266,7 +275,9 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( .comment-actions a.upvote:before, .comment-actions a.downvote:before, -.comment-actions a.reply:before { +.comment-actions a.reply:before, +.comment-actions a.edit:before, +.comment-actions a.delete:before { content: ''; background: url('../../../typo3conf/ext/pw_comments/Resources/Public/Icons/thumbs-up.svg') no-repeat; background-size: cover; @@ -280,7 +291,9 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( .comment-actions a.upvote:hover:before, .comment-actions a.downvote:hover:before, -.comment-actions a.reply:hover:before { +.comment-actions a.reply:hover:before, +.comment-actions a.edit:hover:before, +.comment-actions a.delete:hover:before { opacity: 1; } @@ -292,6 +305,15 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( background-image: url('../../../typo3conf/ext/pw_comments/Resources/Public/Icons/reply.svg'); } +.comment-actions a.edit:before { + background-image: url('../../../typo3conf/ext/pw_comments/Resources/Public/Icons/edit.svg'); +} + +.comment-actions a.delete:before { + background-image: url('../../../typo3conf/ext/pw_comments/Resources/Public/Icons/delete.svg'); +} + + .comment-actions a.upvote.voted:before { opacity: 1; background-image: url('../../../typo3conf/ext/pw_comments/Resources/Public/Icons/thumbs-up-active.svg'); @@ -304,33 +326,39 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( .comment-actions .voted-positive { color: green !important; } .comment-actions .voted-negative { color: red !important; } -#writeComment { +#writeComment, #updateComment { max-width: 768px; margin: 20px auto; } -#writeComment h3 { +#writeComment h3, +#updateComment h3{ padding: 20px 0 8px; } -#writeComment div.hide_initally { +#writeComment div.hide_initally, +#updateComment div.hide_initally { display: none; } -#writeComment label { +#writeComment label, +#updateComment label { display: block; } -#writeComment label span { +#writeComment label span, +#updateComment label span { font-size: 10px; color: #777; } -#writeComment label span a { +#writeComment label span a, +#updateComment label span a { text-decoration: none; color: #777; } -#writeComment input[type=text] { +#writeComment input[type=text], +#updateComment input[type=text]{ font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 15px; width: 66%; @@ -338,7 +366,8 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( margin-bottom: 14px; } -#writeComment textarea { +#writeComment textarea, +#updateComment textarea { width: 100%; line-height: 16px; padding: 5px; @@ -347,7 +376,8 @@ plugin.tx_pwcomments._CSS_DEFAULT_STYLE ( margin-bottom: 10px; } -#writeComment input.button { +#writeComment input.button, +#updateComment input.button { padding: 2px 10px; margin-top: 15px; margin-bottom: 0; diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt index 7d3c8c5..c613e86 100644 --- a/Configuration/TypoScript/constants.txt +++ b/Configuration/TypoScript/constants.txt @@ -31,6 +31,8 @@ plugin.tx_pwcomments { showCommentAnchor = comments # cat=plugin.tx_pwcomments/anchors; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.writeCommentAnchor writeCommentAnchor = writeComment + # cat=plugin.tx_pwcomments/anchors; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.updateCommentAnchor + updateCommentAnchor = updateComment # cat=plugin.tx_pwcomments/anchors; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.successfulAnchor successfulAnchor = thanksForYourComment # cat=plugin.tx_pwcomments/anchors; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.customMessagesAnchor @@ -57,6 +59,11 @@ plugin.tx_pwcomments { # cat=plugin.tx_pwcomments/replying; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.countReplies countReplies = 1 + # cat=plugin.tx_pwcomments/replying; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.enableEditingComments + enableEditingComments = 0 + # cat=plugin.tx_pwcomments/replying; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.enableDeletingComments + enableDeletingComments = 0 + # cat=plugin.tx_pwcomments/sorting; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.invertCommentSorting invertCommentSorting = 0 # cat=plugin.tx_pwcomments/sorting; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.invertReplySorting @@ -66,8 +73,16 @@ plugin.tx_pwcomments { moderateNewComments = 1 # cat=plugin.tx_pwcomments/moderation; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailOnNewCommentsTo sendMailOnNewCommentsTo = + # cat=plugin.tx_pwcomments/moderation; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailOnNewCommentsToNewsAuthor + sendMailOnNewCommentsToNewsAuthor = 0 # cat=plugin.tx_pwcomments/moderation; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailTemplate sendMailTemplate = EXT:pw_comments/Resources/Private/Templates/MailNotification/mail.html + # cat=plugin.tx_pwcomments/moderation; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailUpdateTemplate + sendMailUpdateTemplate = EXT:pw_comments/Resources/Private/Templates/MailNotification/updateMail.html + # cat=plugin.tx_pwcomments/moderation; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailNewsAuthorTemplate + sendMailNewsAuthorTemplate = EXT:pw_comments/Resources/Private/Templates/MailNotification/newsMail.html + # cat=plugin.tx_pwcomments/moderation; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailNewsAuthorUpdateTemplate + sendMailNewsAuthorUpdateTemplate = EXT:pw_comments/Resources/Private/Templates/MailNotification/updateNewsMail.html # cat=plugin.tx_pwcomments/moderation; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailMimeType sendMailMimeType = text/plain @@ -90,6 +105,8 @@ plugin.tx_pwcomments { sendMailToAuthorAfterSubmit = 0 # cat=plugin.tx_pwcomments/mails; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailToAuthorAfterSubmitTemplate sendMailToAuthorAfterSubmitTemplate = EXT:pw_comments/Resources/Private/Templates/MailNotification/mailToAuthorAfterSubmit.html + # cat=plugin.tx_pwcomments/mails; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailToAuthorAfterSubmitUpdateTemplate + sendMailToAuthorAfterSubmitUpdateTemplate = EXT:pw_comments/Resources/Private/Templates/MailNotification/mailToAuthorAfterUpdateSubmit.html # cat=plugin.tx_pwcomments/mails; type=boolean; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailToAuthorAfterPublish sendMailToAuthorAfterPublish = 0 # cat=plugin.tx_pwcomments/mails; type=string; label= LLL:EXT:pw_comments/Resources/Private/Language/locallang_constants.xlf:settings.sendMailToAuthorAfterPublishTemplate diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt index 46c337d..a03a9e0 100644 --- a/Configuration/TypoScript/setup.txt +++ b/Configuration/TypoScript/setup.txt @@ -22,6 +22,7 @@ plugin.tx_pwcomments { commentAnchorPrefix = {$plugin.tx_pwcomments.settings.commentAnchorPrefix} showCommentAnchor = {$plugin.tx_pwcomments.settings.showCommentAnchor} writeCommentAnchor = {$plugin.tx_pwcomments.settings.writeCommentAnchor} + updateCommentAnchor = {$plugin.tx_pwcomments.settings.updateCommentAnchor} successfulAnchor = {$plugin.tx_pwcomments.settings.successfulAnchor} customMessagesAnchor = {$plugin.tx_pwcomments.settings.customMessagesAnchor} @@ -38,12 +39,19 @@ plugin.tx_pwcomments { showRepliesToComments = {$plugin.tx_pwcomments.settings.showRepliesToComments} countReplies = {$plugin.tx_pwcomments.settings.countReplies} + enableEditingComments = {$plugin.tx_pwcomments.settings.enableEditingComments} + enableDeletingComments = {$plugin.tx_pwcomments.settings.enableDeletingComments} + invertCommentSorting = {$plugin.tx_pwcomments.settings.invertCommentSorting} invertReplySorting = {$plugin.tx_pwcomments.settings.invertReplySorting} moderateNewComments = {$plugin.tx_pwcomments.settings.moderateNewComments} sendMailOnNewCommentsTo = {$plugin.tx_pwcomments.settings.sendMailOnNewCommentsTo} + sendMailOnNewCommentsToNewsAuthor = {$plugin.tx_pwcomments.settings.sendMailOnNewCommentsToNewsAuthor} sendMailTemplate = {$plugin.tx_pwcomments.settings.sendMailTemplate} + sendMailUpdateTemplate = {$plugin.tx_pwcomments.settings.sendMailUpdateTemplate} + sendMailNewsAuthorTemplate = {$plugin.tx_pwcomments.settings.sendMailNewsAuthorTemplate} + sendMailNewsAuthorUpdateTemplate = {$plugin.tx_pwcomments.settings.sendMailNewsAuthorUpdateTemplate} sendMailMimeType = {$plugin.tx_pwcomments.settings.sendMailMimeType} enableCommentVotes = {$plugin.tx_pwcomments.settings.enableCommentVotes} @@ -56,6 +64,7 @@ plugin.tx_pwcomments { senderName = {$plugin.tx_pwcomments.settings.senderName} sendMailToAuthorAfterSubmit = {$plugin.tx_pwcomments.settings.sendMailToAuthorAfterSubmit} sendMailToAuthorAfterSubmitTemplate = {$plugin.tx_pwcomments.settings.sendMailToAuthorAfterSubmitTemplate} + sendMailToAuthorAfterSubmitUpdateTemplate = {$plugin.tx_pwcomments.settings.sendMailToAuthorAfterSubmitUpdateTemplate} sendMailToAuthorAfterPublish = {$plugin.tx_pwcomments.settings.sendMailToAuthorAfterPublish} sendMailToAuthorAfterPublishTemplate = {$plugin.tx_pwcomments.settings.sendMailToAuthorAfterPublishTemplate} sitenameUsedInMails = {$plugin.tx_pwcomments.settings.sitenameUsedInMails} @@ -120,6 +129,7 @@ lib.pwCommentsIndex { 1 = index 2 = upvote 3 = downvote + 5 = delete } } @@ -128,14 +138,16 @@ lib.pwCommentsIndex { settings =< plugin.tx_pwcomments.settings } -# Lib for form to post new comments -lib.pwCommentsNew < lib.pwCommentsIndex -lib.pwCommentsNew { +# Lib for form to post new comments or edit existing comments +lib.pwComments < lib.pwCommentsIndex +lib.pwComments { switchableControllerActions { Comment { 1 = new 2 = create - 3 = confirmComment + 3 = edit + 4 = update + 5 = confirmComment } } } diff --git a/Documentation/Configuration/Anchors/Index.rst b/Documentation/Configuration/Anchors/Index.rst index 590e15a..a6b3811 100644 --- a/Documentation/Configuration/Anchors/Index.rst +++ b/Documentation/Configuration/Anchors/Index.rst @@ -16,6 +16,7 @@ Property Type commentAnchorPrefix_ string showCommentAnchor_ string writeCommentAnchor_ string +updateCommentAnchor_ string successfulAnchor_ string customMessagesAnchor_ string ===================================== ======== @@ -66,6 +67,21 @@ writeCommentAnchor Description This anchor will appear in front of the comment form. +.. _updateCommentAnchor: + +updateCommentAnchor +"""""""""""""""""" +.. container:: table-row + + Property + updateCommentAnchor + Data type + string + Default + updateComment + Description + This anchor will appear in front of the editing comment form. + .. _successfulAnchor: successfulAnchor diff --git a/Documentation/Configuration/Deleting/Index.rst b/Documentation/Configuration/Deleting/Index.rst new file mode 100644 index 0000000..cf9e268 --- /dev/null +++ b/Documentation/Configuration/Deleting/Index.rst @@ -0,0 +1,32 @@ +.. ================================================== +.. FOR YOUR INFORMATION +.. -------------------------------------------------- +.. -*- coding: utf-8 -*- with BOM. + +.. include:: ../../Includes.txt + +.. _deleting: + +Deleting of comments +==================== + +===================================== ======== +Property Type +===================================== ======== +enableDeletingComments_ boolean +===================================== ======== + +.. _enableDeletingComments: + +enableDeletingComments +""""""""""""""""""""""" +.. container:: table-row + + Property + enableDeletingComments + Data type + boolean + Default + 0 + Description + Enables or disables the deleting of comments by the comment author. \ No newline at end of file diff --git a/Documentation/Configuration/Editing/Index.rst b/Documentation/Configuration/Editing/Index.rst new file mode 100644 index 0000000..e811299 --- /dev/null +++ b/Documentation/Configuration/Editing/Index.rst @@ -0,0 +1,32 @@ +.. ================================================== +.. FOR YOUR INFORMATION +.. -------------------------------------------------- +.. -*- coding: utf-8 -*- with BOM. + +.. include:: ../../Includes.txt + +.. _editing: + +Editing of comments +==================== + +===================================== ======== +Property Type +===================================== ======== +enableEditingComments_ boolean +===================================== ======== + +.. _enableEditingComments: + +enableEditingComments +""""""""""""""""""""""" +.. container:: table-row + + Property + enableEditingComments + Data type + boolean + Default + 0 + Description + Enables or disables the editing of comments by the comment author. \ No newline at end of file diff --git a/Documentation/Configuration/Index.rst b/Documentation/Configuration/Index.rst index c350cb1..8566bfe 100644 --- a/Documentation/Configuration/Index.rst +++ b/Documentation/Configuration/Index.rst @@ -26,7 +26,7 @@ add the following TypoScript lines to your main column output in order to output 20 < lib.pwCommentsIndex # Write new comment - 30 < lib.pwCommentsNew + 30 < lib.pwComments } This will display the comments on every page. You can use any conditions you want @@ -130,7 +130,7 @@ In TypoScript this could look like this: # And add comments if not done yet lib.content.80 < lib.pwCommentsIndex - lib.content.85 < lib.pwCommentsNew + lib.content.85 < lib.pwComments [global] First you check the condition "Am I currently on a news detail view?". If this is the case, the GET-parameter @@ -154,7 +154,7 @@ lib.pwCommentsIndex ^^^^^^^^^^^^^^^^^^^ This displays the comments with the Fluid template engine. -lib.pwCommentsNew +lib.pwComments ^^^^^^^^^^^^^^^^^ This displays the form for posting comments. You can disclaim this form if you want to make the comments read only. @@ -189,7 +189,7 @@ The static setup provides some basic CSS styles. If you want to disable them sim Author or authorName? --------------------- -The author of a comment is saved in two diffent ways: If an unregistred user writes a comment the fields authorName +The author of a comment is saved in two diffent ways: If an unregistered user writes a comment the fields authorName and authorMail are filled. If the user is registered the model of the user is linked to the comment in the field author. authorIdent diff --git a/Documentation/Configuration/Mails/Index.rst b/Documentation/Configuration/Mails/Index.rst index 5092da5..b27b75e 100644 --- a/Documentation/Configuration/Mails/Index.rst +++ b/Documentation/Configuration/Mails/Index.rst @@ -14,17 +14,21 @@ Mails to comment author When you want to work with mail notifications, you should configure an absolute URL (like ``https://my-domain.com/``) in TYPO3's **site configuration** instead of a plain ``/``. This is required by TypoLink to create absolute URLs in mails. -===================================== ======== -Property Type -===================================== ======== -senderAddress_ string -senderName_ string -sendMailToAuthorAfterSubmit_ boolean -sendMailToAuthorAfterSubmitTemplate_ string -sendMailToAuthorAfterPublish_ boolean -sendMailToAuthorAfterPublishTemplate_ string -sitenameUsedInMails_ string -===================================== ======== +===================================== ======== +Property Type +===================================== ======== +senderAddress_ string +senderName_ string +sendMailToAuthorAfterSubmit_ boolean +sendMailToAuthorAfterSubmitTemplate_ string +sendMailToAuthorAfterSubmitUpdateTemplate_ string +sendMailToAuthorAfterPublish_ boolean +sendMailToAuthorAfterPublishTemplate_ string +sendMailOnNewCommentsToNewsAuthor_ boolean +sendMailNewsAuthorTemplate_ string +sendMailNewsAuthorUpdateTemplate_ string +sitenameUsedInMails_ string +===================================== ======== .. _senderAddress: @@ -82,6 +86,21 @@ sendMailToAuthorAfterSubmitTemplate Description Defines the path to the Fluid template which should be used for the e-mail to comment author. +.. _sendMailToAuthorAfterSubmitUpdateTemplate: + +sendMailToAuthorAfterSubmitUpdateTemplate +""""""""""""""""""""""""""""""""""" +.. container:: table-row + + Property + sendMailToAuthorAfterSubmitUpdateTemplate + Data type + string + Default + EXT:pw_comments/[...]/mailToAuthorAfterUpdateSubmit.html + Description + Defines the path to the Fluid template which should be used for the e-mail to comment author on editing. + .. _sendMailToAuthorAfterPublish: sendMailToAuthorAfterPublish @@ -113,6 +132,51 @@ sendMailToAuthorAfterPublishTemplate Description Defines the path to the Fluid template which should be used for the e-mail to comment author. +.. _sendMailOnNewCommentsToNewsAuthor: + +sendMailOnNewCommentsToNewsAuthor +""""""""""""""""""" +.. container:: table-row + + Property + sendMailOnNewCommentsToNewsAuthor + Data type + boolean + Description + If this option is enabled, the author of the news article commented on receives a mail after a comment has been published. + +.. _sendMailNewsAuthorTemplate: + +sendMailNewsAuthorTemplate +"""""""""""""""""""""""""" +.. container:: table-row + + Property + sendMailNewsAuthorTemplate + Data type + string + Default + EXT:pw_comments/[...]/newsMail.html + Description + Defines the path to the Fluid template which should be used for the e-mail to comment author. + +.. _sendMailNewsAuthorUpdateTemplate: + +sendMailToAuthorAfterSubmitTemplate +""""""""""""""""""""""""""""""""""" +.. container:: table-row + + Property + sendMailNewsAuthorUpdateTemplate + Data type + string + Default + EXT:pw_comments/[...]/updateNewsMail.html + Description + Defines the path to the Fluid template which should be used for the e-mail to comment author. + + + .. _sitenameUsedInMails: sitenameUsedInMails @@ -125,3 +189,4 @@ sitenameUsedInMails string Description When this option is set, it replaces the getHostname() output, used in mail subject. + diff --git a/Documentation/Configuration/Moderation/Index.rst b/Documentation/Configuration/Moderation/Index.rst index 4d98d20..f722ff3 100644 --- a/Documentation/Configuration/Moderation/Index.rst +++ b/Documentation/Configuration/Moderation/Index.rst @@ -20,6 +20,7 @@ Property Type moderateNewComments_ boolean sendMailOnNewCommentsTo_ string sendMailTemplate_ string +sendMailUpdateTemplate_ string sendMailMimeType_ string ===================================== ======== @@ -68,6 +69,22 @@ sendMailTemplate Description Defines the path to the Fluid template which should be used for notification e-mails + +.. _sendMailUpdateTemplate: + +sendMailUpdateTemplate +"""""""""""""""" +.. container:: table-row + + Property + sendMailUpdateTemplate + Data type + string + Default + EXT:pw_comments/[...]/updateMail.html + Description + Defines the path to the Fluid template which should be used for notification e-mails on editing + .. _sendMailMimeType: sendMailMimeType diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 83ed533..9b19692 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -47,35 +47,35 @@ You are logged in as: Angemeldet als: - + Your name: Name: - + Your e-mail address: E-Mail-Adresse: - + Do not fill out! Nicht ausfüllen! - + Comment: Kommentar: - + I understand and accept the Ich verstehe und akzeptiere die - + terms Bedingungen - + . . - + Submit Absenden @@ -83,6 +83,14 @@ Reply Antworten + + Edit + Bearbeiten + + + Delete + Löschen + No comments found! Keine Kommentare gefunden! @@ -99,6 +107,14 @@ Thanks for your comment! Vielen Dank für Deinen Kommentar! + + Your comment has been successfully edited! + Dein Kommentar wurde erfolgreich bearbeitet! + + + Edit your comment + Deinen Kommentar bearbeiten + Your comment has to be checked before publishing. Thank you for your patience! Vielen Dank für Deinen Kommentar! Wir werden ihn vor der Veröffentlichung prüfen. Danke für Deine Geduld! @@ -111,6 +127,14 @@ at %s am %s + + Edited %s ago + Bearbeitet vor %s + + + Edited at %s + Bearbeitet am %s + few seconds wenigen Sekunden @@ -151,6 +175,10 @@ New comment on %s Neuer Kommentar auf %s + + Updated comment on %s + Aktualisierter Kommentar auf %s + Hello, Hallo, @@ -163,6 +191,14 @@ a new comment has been submitted. ein neuer Kommentar wurde eingesendet. + + a updated comment has been submitted and awaits your approval. + ein bearbeiteter Kommentar wurde eingesendet und wartet auf Freigabe. + + + a updated comment has been submitted. + ein bearbeiteter Kommentar wurde eingesendet. + Link to article: Link zum Artikel: @@ -199,6 +235,14 @@ you have posted a new comment on this page: Sie haben auf dieser Seite einen neuen Kommentar eingesendet: + + you have edited comment which awaits our approval on this page: + Sie haben einen Kommentar bearbeitet, welcher durch uns freigeschaltet wird, auf der Seite: + + + you have edited a comment on this page: + Sie haben auf dieser Seite einen Kommentar bearbeitet: + Your comment on %s has been published Ihr Kommentar auf %s wurde veröffentlicht @@ -239,6 +283,10 @@ To vote for comments, please login. Um Kommentare zu bewerten, bitte anmelden. + + Your Comment was successful deleted. + Ihr Kommentar wurde erfolgreich gelöscht. + Could not find comment to publish Zu veröffentlichender Kommentar konnte nicht gefunden werden diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 6f870c1..4dc3cce 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -36,33 +36,39 @@ You are logged in as: - + Your name: - + Your e-mail address: - + Do not fill out! - + Comment: - + I understand and accept the - + terms - + . - + Submit Reply + + Edit + + + Delete + No comments found! @@ -75,6 +81,12 @@ Thanks for your comment! + + Your comment has been successfully edited! + + + Edit your comment + Your comment has to be checked before publishing. Thank you for your patience! @@ -84,6 +96,12 @@ at %s + + Edited %s ago + + + Edited at %s + few seconds @@ -114,6 +132,9 @@ New comment on %s + + Updated comment on %s + Hello, @@ -123,6 +144,12 @@ a new comment has been submitted. + + a updated comment has been submitted and awaits your approval. + + + a updated comment has been submitted. + Link to article: @@ -180,6 +207,9 @@ To vote for comments, please login. + + Your Comment was successful deleted. + Could not find comment to publish diff --git a/Resources/Private/Language/locallang_constants.xlf b/Resources/Private/Language/locallang_constants.xlf index f5746f6..8005bf0 100644 --- a/Resources/Private/Language/locallang_constants.xlf +++ b/Resources/Private/Language/locallang_constants.xlf @@ -1,41 +1,41 @@ -
- - +
+ + Anchors - + Gravatar - + Entry Uid - + Replying to comments - + Sorting - + Voting - + Moderation - + Mails - + Spam protection - + Miscellaneous - + Comment anchor prefix: Every comment gets an own anchor which contains the uid of the comment. In the default case the anchor will look something like that: #comment1337. @@ -176,6 +176,30 @@ Typolink parameters to terms (in string, next to checkbox to click) - - + + Edit Comment Anchor: This label will appear above the comment editing form. + + + Allow Authors to Edit Their Own Comments + + + Allow Authors to Delete Their Own Comments + + + Notify News Article Author via Email When Commented On + + + Email Template for News Author: Specifies the Fluid template path for notification emails. + + + Email Template After Comment Editing: Specifies the Fluid template path for post-submission notification emails. + + + Email Template After Comment Editing: Specifies the Fluid template path for updated notification emails. + + + Email Template After Comment Editing: Specifies the Fluid template path for generic notification emails. + + + diff --git a/Resources/Private/Partials/Comment.html b/Resources/Private/Partials/Comment.html index c1c95fa..39c60ef 100644 --- a/Resources/Private/Partials/Comment.html +++ b/Resources/Private/Partials/Comment.html @@ -1,14 +1,20 @@ {namespace pw=T3\PwComments\ViewHelpers} -
- + - + + + + + + - + + +
@@ -17,7 +23,7 @@
{f:if(condition: '{comment.author}', then: '{comment.author.username}', else: '{comment.authorName}')}
- +
@@ -48,9 +54,28 @@
{f:if(condition: '{comment.author}', then: '{comment.au + + + + + + + + + + + + + +
{comment.message} + +
+ () +
+
diff --git a/Resources/Private/Templates/Comment/Edit.html b/Resources/Private/Templates/Comment/Edit.html new file mode 100644 index 0000000..8c13cee --- /dev/null +++ b/Resources/Private/Templates/Comment/Edit.html @@ -0,0 +1,55 @@ +{namespace pw=T3\PwComments\ViewHelpers} + + + +
+

+ + +
+ + + +
+ + + + {settings.replaceUsernameWith} + + +
+
+
+ + + + {settings.replaceMailWith} + + +
+
+
+ + +
+ +
+ + +
+ +
+
+ + + + + + + +
+
+
diff --git a/Resources/Private/Templates/Comment/Index.html b/Resources/Private/Templates/Comment/Index.html index d90d4f0..ba35eb8 100644 --- a/Resources/Private/Templates/Comment/Index.html +++ b/Resources/Private/Templates/Comment/Index.html @@ -2,10 +2,10 @@ -
+

({commentCount})

- + @@ -14,7 +14,7 @@

({commentCount})

  • - +
    @@ -22,7 +22,7 @@

    ({commentCount})

    • - +
    diff --git a/Resources/Private/Templates/Comment/New.html b/Resources/Private/Templates/Comment/New.html index 24cb5f3..100b6e9 100644 --- a/Resources/Private/Templates/Comment/New.html +++ b/Resources/Private/Templates/Comment/New.html @@ -14,7 +14,7 @@

    - +
    @@ -24,7 +24,7 @@

    {settings.replaceUsernameWith} -
    +
    @@ -33,20 +33,20 @@

    {settings.replaceMailWith} -
    +
    -
    +
    -
    +
    @@ -56,7 +56,7 @@

    - +

  • diff --git a/Resources/Private/Templates/MailNotification/mailToAuthorAfterUpdateSubmit.html b/Resources/Private/Templates/MailNotification/mailToAuthorAfterUpdateSubmit.html new file mode 100644 index 0000000..e50e8d5 --- /dev/null +++ b/Resources/Private/Templates/MailNotification/mailToAuthorAfterUpdateSubmit.html @@ -0,0 +1,10 @@ +{namespace pw=T3\PwComments\ViewHelpers} + + +--------------------------------------------------- + +{f:if(condition: '{comment.author}', then: '{comment.author.username} {f:translate(key:\'tx_pwcomments.notificationMail.registred\')}', else: '{comment.authorName}')} +{f:if(condition: '{comment.author}', then: '{comment.author.email}', else: '{comment.authorMail}')} + + +{comment.message} diff --git a/Resources/Private/Templates/MailNotification/newsMail.html b/Resources/Private/Templates/MailNotification/newsMail.html new file mode 100644 index 0000000..462901f --- /dev/null +++ b/Resources/Private/Templates/MailNotification/newsMail.html @@ -0,0 +1,15 @@ +{namespace pw=T3\PwComments\ViewHelpers} +{namespace n=GeorgRinger\News\ViewHelpers} + + + + +{site}{news.title}#{settings.commentAnchorPrefix}{comment.uid} + +--------------------------------------------------- + +{f:if(condition: '{comment.author}', then: '{comment.author.username} {f:translate(key:\'tx_pwcomments.notificationMail.registred\')}', else: '{comment.authorName}')} +{f:if(condition: '{comment.author}', then: '{comment.author.email}', else: '{comment.authorMail}')} + + +{comment.message} diff --git a/Resources/Private/Templates/MailNotification/updateMail.html b/Resources/Private/Templates/MailNotification/updateMail.html new file mode 100644 index 0000000..859e7bb --- /dev/null +++ b/Resources/Private/Templates/MailNotification/updateMail.html @@ -0,0 +1,18 @@ +{namespace pw=T3\PwComments\ViewHelpers} + + + + + + + + +--------------------------------------------------- + +{f:if(condition: '{comment.author}', then: '{comment.author.username} {f:translate(key:\'tx_pwcomments.notificationMail.registred\')}', else: '{comment.authorName}')} +{f:if(condition: '{comment.author}', then: '{comment.author.email}', else: '{comment.authorMail}')} + + +{comment.message} diff --git a/Resources/Private/Templates/MailNotification/updateNewsMail.html b/Resources/Private/Templates/MailNotification/updateNewsMail.html new file mode 100644 index 0000000..94ce211 --- /dev/null +++ b/Resources/Private/Templates/MailNotification/updateNewsMail.html @@ -0,0 +1,15 @@ +{namespace pw=T3\PwComments\ViewHelpers} +{namespace n=GeorgRinger\News\ViewHelpers} + + + + +{site}{news.title}#{settings.commentAnchorPrefix}{comment.uid} + +--------------------------------------------------- + +{f:if(condition: '{comment.author}', then: '{comment.author.username} {f:translate(key:\'tx_pwcomments.notificationMail.registred\')}', else: '{comment.authorName}')} +{f:if(condition: '{comment.author}', then: '{comment.author.email}', else: '{comment.authorMail}')} + + +{comment.message} diff --git a/Resources/Public/Icons/delete.svg b/Resources/Public/Icons/delete.svg new file mode 100644 index 0000000..d92bd6e --- /dev/null +++ b/Resources/Public/Icons/delete.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/Public/Icons/edit.svg b/Resources/Public/Icons/edit.svg new file mode 100644 index 0000000..8ae209e --- /dev/null +++ b/Resources/Public/Icons/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ext_localconf.php b/ext_localconf.php index 2739e55..46ec527 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -17,10 +17,10 @@ $extensionKey, 'Pi1', [ - \T3\PwComments\Controller\CommentController::class => 'index,new,create,upvote,downvote,confirmComment', + \T3\PwComments\Controller\CommentController::class => 'index,new,create,upvote,downvote,confirmComment,edit,update,delete', ], [ - \T3\PwComments\Controller\CommentController::class => 'index,new,create,upvote,downvote,confirmComment', + \T3\PwComments\Controller\CommentController::class => 'index,new,create,upvote,downvote,confirmComment,edit,update,delete', ] );