コード例 #1
0
ファイル: BreadcrumbExtension.php プロジェクト: symbb/symbb
 protected function createForTopic(\Symbb\Core\ForumBundle\Entity\Topic $object, $breadcrumb)
 {
     if ($object->getId() > 0) {
         $uri = $this->router->generate('symbb_forum_topic_show', array('id' => $object->getId(), 'name' => $object->getSeoName(), 'page' => 1));
         $breadcrumb[] = array('name' => $object->getName(), 'link' => $uri);
     }
     $forum = $object->getForum();
     $breadcrumb = $this->createForForum($forum, $breadcrumb);
     return $breadcrumb;
 }
コード例 #2
0
ファイル: TopicManager.php プロジェクト: symbb/symbb
 public function getBreadcrumbData(\Symbb\Core\ForumBundle\Entity\Topic $object, ForumManager $forumManager)
 {
     $breadcrumb = array();
     $forum = $object->getForum();
     if (\is_object($forum) && $forum->getId() > 0) {
         $breadcrumb = $forumManager->getBreadcrumbData($forum);
         $breadcrumb[] = array('type' => 'topic', 'name' => $object->getName(), 'seoName' => $object->getSeoName(), 'id' => $object->getId());
     }
     return $breadcrumb;
 }
コード例 #3
0
ファイル: TopicManager.php プロジェクト: symbb/symbb
 protected function getTopicAsStruct(Topic $topic)
 {
     $forum = $topic->getForum();
     $author = $topic->getAuthor();
     $closed = $topic->isLocked();
     $new = $this->topicManager->checkFlag($topic, "new");
     return new \Zend\XmlRpc\Value\Struct(array('forum_id' => new \Zend\XmlRpc\Value\String($forum->getId()), 'forum_name' => new \Zend\XmlRpc\Value\Base64($forum->getName()), 'topic_id' => new \Zend\XmlRpc\Value\String($topic->getId()), 'topic_title' => new \Zend\XmlRpc\Value\Base64($topic->getName()), 'prefix' => new \Zend\XmlRpc\Value\Base64(""), 'post_author_id' => new \Zend\XmlRpc\Value\String($author->getId()), 'post_author_name' => new \Zend\XmlRpc\Value\Base64($author->getUsername()), 'is_subscribed' => new \Zend\XmlRpc\Value\Boolean(false), 'can_subscribe' => new \Zend\XmlRpc\Value\Boolean(false), 'is_closed' => new \Zend\XmlRpc\Value\Boolean($closed), 'icon_url' => new \Zend\XmlRpc\Value\String($this->userManager->getAbsoluteAvatarUrl($author)), 'post_time' => new \Zend\XmlRpc\Value\DateTime($topic->getCreated()), 'reply_number' => new \Zend\XmlRpc\Value\Integer($topic->getPostCount()), 'new_post' => new \Zend\XmlRpc\Value\Boolean($new), 'view_number' => new \Zend\XmlRpc\Value\Integer(0), 'short_content' => new \Zend\XmlRpc\Value\Base64("")));
 }