Neos\Neos\Service\View\NodeView::collectTreeNodeData PHP Метод

collectTreeNodeData() публичный Метод

public collectTreeNodeData ( Neos\ContentRepository\Domain\Model\NodeInterface $node, boolean $expand = true, array $children = [], boolean $hasChildNodes = false, boolean $matched = false ) : array
$node Neos\ContentRepository\Domain\Model\NodeInterface
$expand boolean
$children array
$hasChildNodes boolean
$matched boolean
Результат array
    public function collectTreeNodeData(NodeInterface $node, $expand = true, array $children = array(), $hasChildNodes = false, $matched = false)
    {
        $isTimedPage = false;
        $now = new \DateTime();
        $now = $now->getTimestamp();
        $hiddenBeforeDateTime = $node->getHiddenBeforeDateTime();
        $hiddenAfterDateTime = $node->getHiddenAfterDateTime();
        if ($hiddenBeforeDateTime !== null && $hiddenBeforeDateTime->getTimestamp() > $now) {
            $isTimedPage = true;
        }
        if ($hiddenAfterDateTime !== null) {
            $isTimedPage = true;
        }
        $classes = array();
        if ($isTimedPage === true && $node->isHidden() === false) {
            array_push($classes, 'neos-timedVisibility');
        }
        if ($node->isHidden() === true) {
            array_push($classes, 'neos-hidden');
        }
        if ($node->isHiddenInIndex() === true) {
            array_push($classes, 'neos-hiddenInIndex');
        }
        if ($matched) {
            array_push($classes, 'neos-matched');
        }
        $uriBuilder = $this->controllerContext->getUriBuilder();
        $nodeType = $node->getNodeType();
        $nodeTypeConfiguration = $nodeType->getFullConfiguration();
        if ($node->getNodeType()->isOfType('Neos.Neos:Document')) {
            $uriForNode = $uriBuilder->reset()->setFormat('html')->setCreateAbsoluteUri(true)->uriFor('show', array('node' => $node), 'Frontend\\Node', 'Neos.Neos');
        } else {
            $uriForNode = '#';
        }
        $label = $node->getLabel();
        $nodeTypeLabel = $node->getNodeType()->getLabel();
        $treeNode = array('key' => $node->getContextPath(), 'title' => $label, 'fullTitle' => $node->getProperty('title'), 'nodeTypeLabel' => $nodeTypeLabel, 'tooltip' => '', 'href' => $uriForNode, 'isFolder' => $hasChildNodes, 'isLazy' => $hasChildNodes && !$expand, 'nodeType' => $nodeType->getName(), 'isAutoCreated' => $node->isAutoCreated(), 'expand' => $expand, 'addClass' => implode(' ', $classes), 'name' => $node->getName(), 'iconClass' => isset($nodeTypeConfiguration['ui']) && isset($nodeTypeConfiguration['ui']['icon']) ? $nodeTypeConfiguration['ui']['icon'] : '', 'isHidden' => $node->isHidden());
        if ($hasChildNodes) {
            $treeNode['children'] = $children;
        }
        return $treeNode;
    }