StartSubMenu and EndSubMenu events
This commit is contained in:
parent
dc0b62f636
commit
b6b9036821
@ -1472,3 +1472,12 @@ EndHomeStubNavItems:
|
||||
- $action: action being executed (for output and params)
|
||||
- $items: array of items in the nav
|
||||
|
||||
EndSubMenu: After outputting a submenu (including enclosing tags) to HTML
|
||||
- $out: HTMLOutputter used to output (usually an Action, but not always!)
|
||||
- $menu: The Menu object outputted as a submenu.
|
||||
- $label: Localized text which represents the menu item.
|
||||
|
||||
StartSubMenu: Before outputting a submenu (including enclosing tags) to HTML
|
||||
- $out: HTMLOutputter used to output (usually an Action, but not always!)
|
||||
- $menu: The Menu object outputted as a submenu.
|
||||
- $label: Localized text which represents the menu item.
|
||||
|
12
lib/menu.php
12
lib/menu.php
@ -150,12 +150,12 @@ class Menu extends Widget
|
||||
|
||||
function submenu($label, $menu)
|
||||
{
|
||||
if (empty($menu->getItems())){
|
||||
return false;
|
||||
if (Event::handle('StartSubMenu', array($this->action, $menu, $label))) {
|
||||
$this->action->elementStart('li');
|
||||
$this->action->element('h3', null, $label);
|
||||
$menu->show();
|
||||
$this->action->elementEnd('li');
|
||||
Event::handle('EndSubMenu', array($this->action, $menu, $label));
|
||||
}
|
||||
$this->action->elementStart('li');
|
||||
$this->action->element('h3', null, $label);
|
||||
$menu->show();
|
||||
$this->action->elementEnd('li');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user