Skip to content

Commit

Permalink
Bug: 14581 Allow a string containing 'separator' to be passed as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Feb 24, 2017
1 parent 7539232 commit a3f3b09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion framework/Core/lib/Horde/Menu.php
Expand Up @@ -54,7 +54,9 @@ public function add($url, $text, $icon = '', $icon_path = null,
/**
* Add an item to the menu array.
*
* @param array $item The item to add. Valid keys:
* @param mixed $item The item to add. Either a string containing the
* value 'separator' or an array contianing the
* following valid keys:
* <pre>
* 'class' - (string) CSS classname.
* 'icon' - (string) Filename of the image icon.
Expand All @@ -70,6 +72,11 @@ public function add($url, $text, $icon = '', $icon_path = null,
*/
public function addArray($item)
{
if (!is_array($item) && $item == 'separator') {
$this->_menu[] = $item;
return;
}

if (!isset($item['url'])) {
$item['url'] = new Horde_Url();
} elseif (!($item['url'] instanceof Horde_Url)) {
Expand Down

0 comments on commit a3f3b09

Please sign in to comment.