PHP Class Horde_Menu, horde

Copyright 1999-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
显示文件 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_menu array Menu array.

Public Methods

Method Description
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.
addArray ( array $item ) : integer Add an item to the menu array.
addSiteLinks ( ) Add links found in the application's menu configuration.
getSiteLinks ( ) : array Get the list of site links to add to the menu.
isSelected ( $url ) : boolean Checks to see if the current url matches the given url.
render ( ) : Horde_View_Sidebar Return the rendered representation of the menu items.

Protected Methods

Method Description
_render ( ) : Horde_View_Sidebar Converts the menu to a sidebar view.

Method Details

_render() protected method

Converts the menu to a sidebar view.
protected _render ( ) : Horde_View_Sidebar
return Horde_View_Sidebar Sidebar view of menu elements.

add() public method

Add an item to the menu array.
public add ( string $url, string $text, string $icon = '', string $icon_path = null, string $target = '', string $onclick = null, string $class = null )
$url string String containing the value for the hyperlink.
$text string String containing the label for this menu item.
$icon string String containing the filename of the image icon to display for this menu item.
$icon_path string If the icon lives in a non-default directory, where is it?
$target string If the link needs to open in another frame or window, what is its name?
$onclick string Onclick javascript, if desired.
$class string CSS class for the menu item.

addArray() public method

Add an item to the menu array.
public addArray ( array $item ) : integer
$item array The item to add. 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.
return integer The id (NOT guaranteed to be an array index) of the item just added to the menu.

isSelected() public static method

Checks to see if the current url matches the given url.
public static isSelected ( $url ) : boolean
return boolean Whether the given URL is the current location.

render() public method

Return the rendered representation of the menu items.
public render ( ) : Horde_View_Sidebar
return Horde_View_Sidebar Sidebar view of menu elements.

Property Details

$_menu protected_oe property

Menu array.
protected array $_menu
return array