Neos.Neos/Classes/Fusion/MenuItemsImplementation.php
protected function buildMenuItemRecursive(NodeInterface $currentNode)
    {
        if ($this->isNodeHidden($currentNode)) {
            return null;
        }

        $item = [
            'node' => $currentNode,
            'state' => self::STATE_NORMAL,
            'label' => $currentNode->getLabel(),
            'menuLevel' => $this->currentLevel
        ];

        $item['state'] = $this->calculateItemState($currentNode);
        if (!$this->isOnLastLevelOfMenu($currentNode)) {
            $this->currentLevel++;
            $item['subItems'] = $this->buildMenuLevelRecursive($currentNode->getChildNodes($this->getFilter()));
            $this->currentLevel--;
        }

        return $item;
    }
protected function buildMenuItemRecursive(NodeInterface $currentNode)
    {
        if ($this->isNodeHidden($currentNode)) {
            return null;
        }

        $item = [
            'node' => $currentNode,
            'state' => self::STATE_NORMAL,
            'label' => $currentNode->getLabel(),
            'menuLevel' => $this->currentLevel
        ];

        $item['state'] = $this->calculateItemState($currentNode);
        if (!$this->isOnLastLevelOfMenu($currentNode)) {
            $this->currentLevel++;
            $item['subItems'] = $this->buildMenuLevelRecursive($currentNode->getChildNodes($this->getFilter()));
            $this->currentLevel--;
        }

        return $item;
    }
protected function buildMenuItemRecursive ( NodeInterface $ currentNode ) { if ( $ this -> isNodeHidden ( $ currentNode ) ) { return null ; } $ item = [ 'node' => $ currentNode , 'state' => self :: STATE_NORMAL , 'label' => $ currentNode -> getLabel ( ) , 'menuLevel' => $ this -> currentLevel ] ; $ item [ 'state' ] = $ this -> calculateItemState ( $ currentNode ) ; if ( ! $ this -> isOnLastLevelOfMenu ( $ currentNode ) ) { $ this -> currentLevel ++ ; $ item [ 'subItems' ] = $ this -> buildMenuLevelRecursive ( $ currentNode -> getChildNodes ( $ this -> getFilter ( ) ) ) ; $ this -> currentLevel -- ; } return $ item ; }
Prepare the menu item with state and sub items if this isn't the last menu level.

@param NodeInterface $currentNode
@return array
Prepare the menu item with state and sub items if this isn t the last menu level .