X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmenu.php;h=f0f797fe3257b609fa771d630667624b5b2e5989;hb=5beea658a463609933ea11f6c0f0fd1773daddc6;hp=46e160562ac922f1f83f366195bc6fdde97378ad;hpb=ef9c7c627feec2714ffcdd8f2a80fbf65519a63f;p=quix0rs-gnu-social.git diff --git a/lib/menu.php b/lib/menu.php index 46e160562a..f0f797fe32 100644 --- a/lib/menu.php +++ b/lib/menu.php @@ -108,7 +108,7 @@ class Menu extends Widget } } - function item($actionName, $args, $label, $description, $id=null, $cls=null) + function item($actionName, array $args, $label, $description, $id=null, $cls=null) { if (empty($id)) { $id = $this->menuItemID($actionName, $args); @@ -124,7 +124,7 @@ class Menu extends Widget $cls); } - function isCurrent($actionName, $args) + function isCurrent($actionName, array $args) { if ($actionName != $this->actionName) { return false; @@ -144,11 +144,11 @@ class Menu extends Widget return true; } - + function menuItemID($actionName, $args = null) { $id = sprintf('nav_%s', $actionName); - + if (!is_null($args)) { foreach ($args as $key => $value) { $id .= '_' . $key . '_' . $value; @@ -160,9 +160,12 @@ class Menu extends Widget function submenu($label, $menu) { - $this->action->elementStart('li'); - $this->action->element('h3', null, $label); - $menu->show(); - $this->action->elementEnd('li'); + 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)); + } } }