From: Michael M Slusarz Date: Thu, 9 Sep 2010 20:19:50 +0000 (-0600) Subject: Prevent undefined index errors. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e955dce1a85124ba839f1f75d1eb498fc33d2799;p=horde.git Prevent undefined index errors. --- diff --git a/framework/Core/lib/Horde/Menu.php b/framework/Core/lib/Horde/Menu.php index bc32841d5..82ffb91d4 100644 --- a/framework/Core/lib/Horde/Menu.php +++ b/framework/Core/lib/Horde/Menu.php @@ -101,8 +101,8 @@ class Horde_Menu * 'icon' - (string) Filename of the image icon. * 'icon_path' - (string) Non-default directory path for icon. * 'onclick' - (string) Onclick javascript. - * 'text' - (string) Label. * 'target' - (string) HREF target parameter. + * 'text' - (string) Label. * 'url' - (string) Hyperlink. * * @@ -116,7 +116,15 @@ class Horde_Menu $pos = count($this->_menu); } - $this->_menu[$pos] = $item; + $this->_menu[$pos] = array_merge(array( + 'class' => '', + 'icon' => '', + 'icon_path' => null, + 'onclick' => null, + 'target' => '', + 'text' => '', + 'url' => '' + ), $item); return $pos; }