コード例 #1
0
 /**
  * Fetches the next tree level
  *
  * @param integer $nodeId
  * @param \stdClass $nodeData
  * @return array
  */
 public function getNextTreeLevel($nodeId, $nodeData)
 {
     $this->initDataProvider();
     /** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
     $node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
     if ($nodeId === 'root') {
         $nodeCollection = $this->dataProvider->getTreeMounts();
     } else {
         $nodeCollection = $this->dataProvider->getNodes($node, $node->getMountPoint());
     }
     return $nodeCollection->toArray();
 }
コード例 #2
0
 /**
  * Returns a tree that only contains elements that match the given search string
  *
  * @param integer $nodeId
  * @param stdClass $nodeData
  * @param string $searchFilter
  * @return array
  */
 public function getFilteredTree($nodeId, $nodeData, $searchFilter)
 {
     if (strval($searchFilter) === '') {
         return array();
     }
     /** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
     $node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
     $this->initDataProvider();
     if ($nodeId === 'root') {
         $nodeCollection = $this->dataProvider->getTreeMounts($searchFilter);
     } else {
         $nodeCollection = $this->dataProvider->getFilteredNodes($node, $searchFilter, $node->getMountPoint());
     }
     return $nodeCollection->toArray();
 }
コード例 #3
0
 /**
  * @test
  */
 public function getRootNodeReturnsExpandedNode()
 {
     $this->assertTrue($this->fixture->getRoot()->isExpanded());
 }