From e955dce1a85124ba839f1f75d1eb498fc33d2799 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 9 Sep 2010 14:19:50 -0600 Subject: [PATCH] Prevent undefined index errors. --- framework/Core/lib/Horde/Menu.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; } -- 2.11.0