/**
  *
  * Loads the option rows for this select field.
  * @return array All option rows.
  *
  */
 protected function getOptions()
 {
     $rootForums = $this->forumRepository->findRootForums();
     $values = array();
     foreach ($rootForums as $rootForum) {
         $values[] = $this->getForumOptionRow($rootForum, TRUE);
     }
     return $values;
 }
 /**
  * @param integer $nodeId
  * @return array
  */
 public function getTreeNode($nodeId)
 {
     if ($nodeId === 'forum-root') {
         $forumId = NULL;
         $forums = $this->forumRepository->findRootForums();
     } else {
         $forumId = (int) str_replace('forum-', '', $nodeId);
         $forums = $this->forumRepository->findByUid($forumId)->getChildren();
     }
     $result = array();
     foreach ($forums as $forum) {
         $forumNode = array('text' => $forum->getTitle(), 'title' => $forum->getTitle(), 'topicCount' => $forum->getTopicCount(), 'postCount' => $forum->getPostCount(), 'id' => 'forum-' . $forum->getUid(), 'iconCls' => 'tx-typo3forum-icon-16-forum', 'draggable' => TRUE, 'allowDrop' => TRUE, 'isTarget' => TRUE, '__identity' => $forum->getUid());
         if (count($forum->getChildren()) === 0) {
             #$forumNode['leaf'] = TRUE;
             $forumNode['expanded'] = TRUE;
             $forumNode['children'] = array();
         }
         $result[] = $forumNode;
     }
     return $result;
 }
예제 #3
0
 public function getChildren()
 {
     return $this->forumRepository->findRootForums();
 }