Пример #1
0
 /**
  * Creates a new post that quotes an already existing post.
  *
  * @param Post $quotedPost The post that is to be quoted. The post text of this post will be wrapped in [quote] bb codes.
  *
  * @return Post The new post.
  */
 public function createPostWithQuote(Post $quotedPost)
 {
     /** @var $post Post */
     $post = $this->getClassInstance();
     $post->setText('[quote=' . $quotedPost->getUid() . ']' . $quotedPost->getText() . '[/quote]');
     return $post;
 }
 /**
  * @param \Mittwald\Typo3Forum\Domain\Model\Forum\Post $post
  * @param string $countTarget
  * @param string $countUserTarget
  * @param string $title
  * @return string
  */
 public function render(\Mittwald\Typo3Forum\Domain\Model\Forum\Post $post, $countTarget = NULL, $countUserTarget = NULL, $title = '')
 {
     $class = $this->settings['forum']['post']['helpfulBtn']['iconClass'];
     if ($this->hasArgument('class')) {
         $class .= ' ' . $this->arguments['class'];
     }
     if ($post->getAuthor()->getUid() != $this->authenticationService->getUser()->getUid() and !$this->authenticationService->getUser()->isAnonymous()) {
         $class .= ' tx-typo3forum-helpfull-btn';
     }
     if ($post->hasBeenSupportedByUser($this->authenticationService->getUser())) {
         $class .= ' supported';
     }
     $btn = '<div data-toogle="tooltip" title="' . $title . '" data- class="' . $class . '" data-countusertarget="' . $countUserTarget . '" data-counttarget="' . $countTarget . '" data-post="' . $post->getUid() . '" data-pageuid="' . $this->settings['pids']['Forum'] . '" data-eid="' . $this->settings['forum']['post']['helpfulBtn']['eID'] . '"></div>';
     return $btn;
 }