class MenuItemsImplementation extends AbstractMenuItemsImplementation (View source)

A Fusion MenuItems object

Constants

STATE_NORMAL

STATE_CURRENT

STATE_ACTIVE

STATE_ABSENT

MAXIMUM_LEVELS_LIMIT

Hard limit for the maximum number of levels supported by this menu

Properties

protected Runtime $runtime from  AbstractFusionObject
protected string $path

The Fusion path currently being rendered

from  AbstractFusionObject
protected string $fusionObjectName

Name of this Fusion object, like Neos.Neos:Text

from  AbstractFusionObject
protected array $fusionValueCache from  AbstractFusionObject
protected array $items

An internal cache for the built menu items array.

from  AbstractMenuItemsImplementation
protected NodeInterface $currentNode from  AbstractMenuItemsImplementation
protected int $currentLevel

Internal cache for the currentLevel tsValue.

from  AbstractMenuItemsImplementation
protected bool $renderHiddenInIndex

Internal cache for the renderHiddenInIndex property.

from  AbstractMenuItemsImplementation
protected NodeInterface[] $currentNodeRootline

Rootline of all nodes from the current node to the site root node, keys are depth of nodes.

from  AbstractMenuItemsImplementation
protected NodeInterface $startingPoint

Internal cache for the startingPoint tsValue.

protected int $lastLevel

Internal cache for the lastLevel value.

protected int $maximumLevels

Internal cache for the maximumLevels tsValue.

Methods

__construct(Runtime $runtime, string $path, string $fusionObjectName)

Constructor

mixed
evaluate()

Returns the items as result of the fusion object.

getRuntime()

Get the Fusion runtime this object was created in.

mixed
fusionValue(string $path)

Return the Fusion value relative to this Fusion object (with processors etc applied).

bool
offsetExists(mixed $offset)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

mixed
offsetGet(mixed $offset)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

void
offsetSet(mixed $offset, mixed $value)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

void
offsetUnset(mixed $offset)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

bool
getRenderHiddenInIndex()

Should nodes that have "hiddenInIndex" set still be visible in this menu.

array
getItems()

Main API method which sends the to-be-rendered data to Fluid

array
buildItems()

Builds the array of menu items containing those items which match the configuration set for this Menu object.

string
calculateItemState(NodeInterface $node = null)

Helper Method: Calculates the state of the given menu item (node) depending on the currentNode.

bool
isNodeHidden(NodeInterface $node)

Return true/false if the node is currently hidden or not in the menu; taking the "renderHiddenInIndex" configuration of the Menu Fusion object into account.

array
getCurrentNodeRootline()

Get the rootline from the current node up to the site node.

int
getNodeLevelInSite(NodeInterface $node)

Node Level relative to site root node.

int
getEntryLevel()

The last navigation level which should be rendered.

string
getFilter()

NodeType filter for nodes displayed in menu

int
getMaximumLevels()

Maximum number of levels which should be rendered in this menu.

int
getLastLevel()

Return evaluated lastLevel value.

getStartingPoint()

No description

array
getItemCollection()

No description

array
buildMenuLevelRecursive(array $menuLevelCollection)

No description

array
buildMenuItemRecursive(NodeInterface $currentNode)

Prepare the menu item with state and sub items if this isn't the last menu level.

findMenuStartingPoint()

Find the starting point for this menu. depending on given startingPoint If startingPoint is given, this is taken as starting point for this menu level, as a fallback the Fusion context variable node is used.

bool
isOnLastLevelOfMenu(NodeInterface $menuItemNode)

Checks if the given menuItem is on the last level for this menu, either defined by maximumLevels or lastLevels.

findParentNodeInBreadcrumbPathByLevel(int $givenSiteLevel, NodeInterface $startingPoint)

Finds the node in the current breadcrumb path between current site node and current node whose level matches the specified entry level.

int
calculateNodeDepthFromRelativeLevel(int $relativeLevel, NodeInterface $referenceNode)

Calculates an absolute depth value for a relative level given.

Details

__construct(Runtime $runtime, string $path, string $fusionObjectName)

Constructor

Parameters

Runtime $runtime
string $path
string $fusionObjectName

mixed evaluate()

Returns the items as result of the fusion object.

Return Value

mixed

Runtime getRuntime()

Get the Fusion runtime this object was created in.

Return Value

Runtime

protected mixed fusionValue(string $path)

Return the Fusion value relative to this Fusion object (with processors etc applied).

Note that subsequent calls of fusionValue() with the same Fusion path will return the same values since the first evaluated value will be cached in memory.

Parameters

string $path

Return Value

mixed

bool offsetExists(mixed $offset)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

Parameters

mixed $offset

Return Value

bool

mixed offsetGet(mixed $offset)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

Parameters

mixed $offset

Return Value

mixed

void offsetSet(mixed $offset, mixed $value)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

Parameters

mixed $offset
mixed $value

Return Value

void

void offsetUnset(mixed $offset)

Dummy implementation of ArrayAccess to allow this.XXX access in processors.

Parameters

mixed $offset

Return Value

void

bool getRenderHiddenInIndex()

Should nodes that have "hiddenInIndex" set still be visible in this menu.

Return Value

bool

array getItems()

Main API method which sends the to-be-rendered data to Fluid

Return Value

array

protected array buildItems()

Builds the array of menu items containing those items which match the configuration set for this Menu object.

Return Value

array

An array of menu items and further information

Exceptions

Exception

protected string calculateItemState(NodeInterface $node = null)

Helper Method: Calculates the state of the given menu item (node) depending on the currentNode.

This method needs to be called inside buildItems() in the subclasses.

Parameters

NodeInterface $node

Return Value

string

protected bool isNodeHidden(NodeInterface $node)

Return true/false if the node is currently hidden or not in the menu; taking the "renderHiddenInIndex" configuration of the Menu Fusion object into account.

This method needs to be called inside buildItems() in the subclasses.

Parameters

NodeInterface $node

Return Value

bool

protected array getCurrentNodeRootline()

Get the rootline from the current node up to the site node.

Return Value

array

protected int getNodeLevelInSite(NodeInterface $node)

Node Level relative to site root node.

0 = Site root node

Parameters

NodeInterface $node

Return Value

int

int getEntryLevel()

The last navigation level which should be rendered.

1 = first level of the site 2 = second level of the site ... 0 = same level as the current page -1 = one level above the current page -2 = two levels above the current page ...

Return Value

int

string getFilter()

NodeType filter for nodes displayed in menu

Return Value

string

int getMaximumLevels()

Maximum number of levels which should be rendered in this menu.

Return Value

int

int getLastLevel()

Return evaluated lastLevel value.

Return Value

int

NodeInterface getStartingPoint()

No description

Return Value

NodeInterface

array getItemCollection()

No description

Return Value

array

protected array buildMenuLevelRecursive(array $menuLevelCollection)

No description

Parameters

array $menuLevelCollection

Return Value

array

protected array buildMenuItemRecursive(NodeInterface $currentNode)

Prepare the menu item with state and sub items if this isn't the last menu level.

Parameters

NodeInterface $currentNode

Return Value

array

protected NodeInterface findMenuStartingPoint()

Find the starting point for this menu. depending on given startingPoint If startingPoint is given, this is taken as starting point for this menu level, as a fallback the Fusion context variable node is used.

If entryLevel is configured this will be taken into account as well.

Return Value

NodeInterface

Exceptions

Exception

protected bool isOnLastLevelOfMenu(NodeInterface $menuItemNode)

Checks if the given menuItem is on the last level for this menu, either defined by maximumLevels or lastLevels.

Parameters

NodeInterface $menuItemNode

Return Value

bool

protected NodeInterface findParentNodeInBreadcrumbPathByLevel(int $givenSiteLevel, NodeInterface $startingPoint)

Finds the node in the current breadcrumb path between current site node and current node whose level matches the specified entry level.

Parameters

int $givenSiteLevel

The site level child nodes of the to be found parent node should have. See $this->entryLevel for possible values.

NodeInterface $startingPoint

Return Value

NodeInterface

The parent node of the node at the specified level or NULL if none was found

protected int calculateNodeDepthFromRelativeLevel(int $relativeLevel, NodeInterface $referenceNode)

Calculates an absolute depth value for a relative level given.

Parameters

int $relativeLevel
NodeInterface $referenceNode

Return Value

int