From: buttle Date: Tue, 10 Feb 2015 18:20:01 +0000 (+0100) Subject: Added EVENT to homestubnav X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2a0a0287d47bd51eef6d3369ca74c7f673e72b39;p=quix0rs-gnu-social.git Added EVENT to homestubnav Changed menu->submenu(). if (! $menu->getItems()) then do nothing --- diff --git a/lib/homestubnav.php b/lib/homestubnav.php index 7dd6ae19a1..d22d1fd16c 100644 --- a/lib/homestubnav.php +++ b/lib/homestubnav.php @@ -49,13 +49,17 @@ class HomeStubNav extends Menu { function getItems() { - return array(array('top', - array(), - // TRANS: Menu item in personal group navigation menu. - _m('MENU','Home'), - // TRANS: Menu item title in personal group navigation menu. - // TRANS: %s is a username. - _('Back to top'), - 'nav_return_top')); + if (Event::handle('StartHomeStubNav', array(&$this->action))) { + return array(array('top', + array(), + // TRANS: Menu item in personal group navigation menu. + _m('MENU','Home'), + // TRANS: Menu item title in personal group navigation menu. + // TRANS: %s is a username. + _('Back to top'), + 'nav_return_top')); + Event::handle('EndHomeStubNav', array(&$this->action)); + } + return Null; } } diff --git a/lib/menu.php b/lib/menu.php index 27503aa06b..3d22ff4924 100644 --- a/lib/menu.php +++ b/lib/menu.php @@ -150,6 +150,8 @@ class Menu extends Widget function submenu($label, $menu) { + if(!$menu->getItems()) + return; $this->action->elementStart('li'); $this->action->element('h3', null, $label); $menu->show();