コード例 #1
0
 /**
  * show's the hidden category
  *
  * @param \Lelesys\Plugin\News\Domain\Model\Comment $comment
  * @return void
  */
 public function publishAction(\Lelesys\Plugin\News\Domain\Model\Comment $comment)
 {
     try {
         $this->commentService->publishComment($comment);
         $packageKey = $this->settings['flashMessage']['packageKey'];
         $header = 'Comment is published.';
         $message = $this->translator->translateById('lelesys.plugin.news.publish.comment', array(), NULL, NULL, 'Main', $packageKey);
         $this->addFlashMessage($message, $header, \TYPO3\Flow\Error\Message::SEVERITY_OK);
         $this->redirect('index');
     } catch (Lelesys\NeoNews\Domain\Service\Exception $exception) {
         $packageKey = $this->settings['flashMessage']['packageKey'];
         $header = 'Sorry, error occured. Please try again later.';
         $message = $this->translator->translateById('lelesys.plugin.news.try.again', array(), NULL, NULL, 'Main', $packageKey);
         $this->addFlashMessage($message, $header, \TYPO3\Flow\Error\Message::SEVERITY_ERROR);
     }
 }