Ejemplo n.º 1
0
 public function onSuccessCommentRemoval(Comment $comment, $id)
 {
     /** @var \Users\User $user */
     $user = $this->user->getIdentity();
     $pageLink = $this->linkGenerator->link('Pages:Front:Page:show', ['internal_id' => $comment->getPageId()]);
     $this->appEventLogger->saveLog(sprintf('User [%s#%s] <b>has REMOVED</b> the Comment [%s#] of Author [%s] on the <a href="%s">Page [%s#%s]</a>', $user->getId(), $user->getUsername(), $id, $comment->getAuthor(), $pageLink, $comment->getPageId(), $comment->getPageTitle()), 'page_comment_release', $user->getId());
 }
Ejemplo n.º 2
0
 private function refresh($message, $type, array $snippets = null)
 {
     if ($this->presenter->isAjax()) {
         if ($snippets === null) {
             return;
         }
         if (empty($snippets)) {
             $this->redrawControl();
             return;
         }
         foreach ($snippets as $snippet) {
             $this->redrawControl($snippet);
         }
     } else {
         $this->flashMessage($message, $type);
         $this->redirect('this#comment-' . $this->comment->getId());
     }
 }
Ejemplo n.º 3
0
 /**
  * @param Comment $comment
  * @throws ActionFailedException
  */
 public function remove(Comment $comment)
 {
     $id = $comment->getId();
     $this->commentRemover->remove($comment);
     $this->onSuccessCommentRemoval($comment, $id);
 }
Ejemplo n.º 4
0
 public function getList()
 {
     $comments = Comment::all();
     $theme = "Admin";
     return $this->View->make("CommentModule::CommentList", compact("theme", 'comments'));
 }
Ejemplo n.º 5
0
 /**
  * @param Comment $reaction
  */
 public function addReaction(Comment $reaction)
 {
     if ($reaction->getPageId() !== $this->page->getId()) {
         throw new WrongPageCommentReaction();
     }
     $this->reactions->add($reaction);
 }