\Horde_Menu

The Horde_Menu:: class provides standardized methods for creating menus in Horde applications.

Copyright 1999-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
add()
addArray()
render()
addSiteLinks()
getSiteLinks()
isSelected()
No public properties found
No constants found
_render()
$_menu
N/A
No private methods found
No private properties found
N/A

Properties

$_menu

$_menu : array

Menu array.

Type

array

Methods

add()

add(string  $url, string  $text, string  $icon = '', string  $icon_path = null, string  $target = '', string  $onclick = null, string  $class = null) 

Add an item to the menu array.

Parameters

string $url

String containing the value for the hyperlink.

string $text

String containing the label for this menu item.

string $icon

String containing the filename of the image icon to display for this menu item.

string $icon_path

If the icon lives in a non-default directory, where is it?

string $target

If the link needs to open in another frame or window, what is its name?

string $onclick

Onclick javascript, if desired.

string $class

CSS class for the menu item.

addArray()

addArray(mixed  $item) 

Add an item to the menu array.

Parameters

mixed $item

The item to add. Either a string containing the value 'separator' or an array contianing the following valid keys:

'class' - (string) CSS classname.
'icon' - (string) Filename of the image icon.
'icon_path' - (string) Non-default directory path for icon.
'onclick' - (string) Onclick javascript.
'target' - (string) HREF target parameter.
'text' - (string) Label.
'url' - (string) Hyperlink.
'container' - (string) Name of sidebar container to add to, if not the
              default.

render()

render() : \Horde_View_Sidebar

Return the rendered representation of the menu items.

Returns

\Horde_View_Sidebar —

Sidebar view of menu elements.

addSiteLinks()

addSiteLinks() 

Add links found in the application's menu configuration.

getSiteLinks()

getSiteLinks() : array

Get the list of site links to add to the menu.

Returns

array —

A list of menu items to add.

isSelected()

isSelected(  $url) : boolean

Checks to see if the current url matches the given url.

Parameters

$url

Returns

boolean —

Whether the given URL is the current location.

_render()

_render() : \Horde_View_Sidebar

Converts the menu to a sidebar view.

Returns

\Horde_View_Sidebar —

Sidebar view of menu elements.