Prevent undefined index errors.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Sep 2010 20:19:50 +0000 (14:19 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Sep 2010 20:56:34 +0000 (14:56 -0600)
framework/Core/lib/Horde/Menu.php

index bc32841..82ffb91 100644 (file)
@@ -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.
      * </pre>
      *
@@ -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;
     }