]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added EVENT to homestubnav
authorbuttle <chris@gatopelao.org>
Tue, 10 Feb 2015 18:20:01 +0000 (19:20 +0100)
committerbuttle <chris@gatopelao.org>
Tue, 10 Feb 2015 18:20:01 +0000 (19:20 +0100)
Changed menu->submenu(). if (! $menu->getItems()) then do nothing

lib/homestubnav.php
lib/menu.php

index 7dd6ae19a1a1d703af160a6efc1e1032be90e5b0..d22d1fd16c71b4c557362ac43fc4d575ecceff45 100644 (file)
@@ -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;
     }
 }
index 27503aa06bf59d4e48dc67e1dd57909342031680..3d22ff49241c0101a10794041baee0c2cde75e60 100644 (file)
@@ -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();