XmlMenuListener
in package
Class XmlMenuListener
Tags
Table of Contents
- $environment : Environment
- $fileFinder : XmlMenuFinder
- $menuFactory : CacheMenuFactory
- $smartyEngine : SmartyEngine
- __construct() : mixed
- XmlMenuListener constructor.
- __invoke() : CoreMenuDataCollected
- Events callback function.
- addFile() : void
- Processes a menu file and adds them to the menu cache.
- addGroup() : void
- Adds a menu group.
- fixTitle() : void
- Fixes the "title" element in $dataset.
- hasAttributes() : bool
- Returns true if data set contains key "@attributes".
- isGroupDataSet() : bool
- Returns true if $dataset represents a menu group.
Properties
$environment
private
Environment
$environment
$fileFinder
private
XmlMenuFinder
$fileFinder
$menuFactory
private
CacheMenuFactory
$menuFactory
$smartyEngine
private
SmartyEngine
$smartyEngine
Methods
__construct()
XmlMenuListener constructor.
public
__construct(XmlMenuFinder $fileFinder, CacheMenuFactory $menuFactory, SmartyEngine $smartyEngine, Environment $environment) : mixed
Parameters
- $fileFinder : XmlMenuFinder
- $menuFactory : CacheMenuFactory
- $smartyEngine : SmartyEngine
- $environment : Environment
Return values
mixed —__invoke()
Events callback function.
public
__invoke(CoreMenuDataCollected $event) : CoreMenuDataCollected
Parameters
- $event : CoreMenuDataCollected
Return values
CoreMenuDataCollected —addFile()
Processes a menu file and adds them to the menu cache.
private
addFile(CoreMenuDataCollected $event, string $menuFile) : void
Parameters
- $event : CoreMenuDataCollected
- $menuFile : string
Tags
Return values
void —addGroup()
Adds a menu group.
private
addGroup(CoreMenuDataCollected $event, array<string|int, mixed> $groupDataSet) : void
Parameters
- $event : CoreMenuDataCollected
- $groupDataSet : array<string|int, mixed>
Return values
void —fixTitle()
Fixes the "title" element in $dataset.
private
fixTitle(array<string|int, mixed> &$dataset) : void
This is important due to compatibility reasons. The "txt." prefix will be replaced with "admin_menu.", so the text manager can translate the title later.
Parameters
- $dataset : array<string|int, mixed>
Return values
void —hasAttributes()
Returns true if data set contains key "@attributes".
private
hasAttributes(array<string|int, mixed> $dataset) : bool
Parameters
- $dataset : array<string|int, mixed>
Return values
bool —isGroupDataSet()
Returns true if $dataset represents a menu group.
private
isGroupDataSet(array<string|int, mixed> $dataset) : bool
Parameters
- $dataset : array<string|int, mixed>