class DimensionsMenuItemsImplementation extends AbstractMenuItemsImplementation (View source)

Fusion implementation for a dimensions menu items.

The items generated by this menu will be all possible variants (according to the configured dimensions and presets) of the given node (including the given node).

If a 'dimension' is configured via Fusion, only the possible variants for that dimension will be included in the menu, any other dimensions will be kept from the current context.

Main Options:

  • dimension (optional, string): name of the dimension which this menu should be limited to. Example: "language".
  • presets (optional, array): If set, the presets are not loaded from the Settings, but instead taken from this property. Must be used with "dimension" set.

Constants

STATE_NORMAL

STATE_CURRENT

STATE_ACTIVE

STATE_ABSENT

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 ConfigurationContentDimensionPresetSource $configurationContentDimensionPresetSource
protected ContentDimensionCombinator $contentDimensionCombinator

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 for this variant menu

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.

string
getDimension()

No description

array
getPresets()

No description

array
getIncludeAllPresets()

No description

string
itemLabel(string $pinnedDimensionName = null, NodeInterface $nodeInDimensions = null, array $targetDimensions = null)

Render and return a label for the $nodeInDimensions in the built menu item.

getNodeInDimensions(array $dimensions, array $targetDimensions)

Get the current node in the given dimensions.

findAcceptableNode(array $allowedCombination, array $allDimensionPresets)

No description

array
calculateTargetDimensionsForCombination(array $dimensionCombination)

Calculates the target dimensions for a given dimension combination.

bool
hasHiddenNodeParent(NodeInterface $node)

Returns TRUE if the node has a inaccessible parent.

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 for this variant menu

Return Value

array

An array of menu items and further information

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

string getDimension()

No description

Return Value

string

array getPresets()

No description

Return Value

array

array getIncludeAllPresets()

No description

Return Value

array

protected string itemLabel(string $pinnedDimensionName = null, NodeInterface $nodeInDimensions = null, array $targetDimensions = null)

Render and return a label for the $nodeInDimensions in the built menu item.

Parameters

string $pinnedDimensionName
NodeInterface $nodeInDimensions
array $targetDimensions

Return Value

string

protected NodeInterface|null getNodeInDimensions(array $dimensions, array $targetDimensions)

Get the current node in the given dimensions.

If it doesn't exist the method returns null.

Parameters

array $dimensions
array $targetDimensions

Return Value

NodeInterface|null

protected null|NodeInterface findAcceptableNode(array $allowedCombination, array $allDimensionPresets)

No description

Parameters

array $allowedCombination
array $allDimensionPresets

Return Value

null|NodeInterface

protected array calculateTargetDimensionsForCombination(array $dimensionCombination)

Calculates the target dimensions for a given dimension combination.

Parameters

array $dimensionCombination

Return Value

array

protected bool hasHiddenNodeParent(NodeInterface $node)

Returns TRUE if the node has a inaccessible parent.

Parameters

NodeInterface $node

Return Value

bool