Class Horde_Menu
The Horde_Menu:: class provides standardized methods for creating menus in
Horde applications.
Copyright 1999-2012 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.
Methods summary
public
|
|
public
|
#
setMask( integer $mask )
Sets the display mask.
Parameters
Since
Horde_Core 1.3.0
|
public
integer
|
#
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.
Add an item to the menu array.
Parameters
- $url
- String containing the value for the hyperlink.
- $text
- <p>String containing the label for this menu
item.</p>
- $icon
- <p>String containing the filename of the image
icon to display for this menu item.</p>
- $icon_path
- <p>If the icon lives in a non-default directory,
where is it?</p>
- $target
- <p>If the link needs to open in another frame or
window, what is its name?</p>
- $onclick
- Onclick javascript, if desired.
- $class
- CSS class for the menu item.
Returns
integer The id (NOT guaranteed to be an array index) of the
item just added to the menu.
|
public
integer
|
#
addArray( array $item )
Add an item to the menu array.
Add an item to the menu array.
Parameters
- $item
- The item to add. Valid keys:
<pre><span class="php-quote">'class'</span> - (string) CSS classname.
<span class="php-quote">'icon'</span> - (string) Filename of the image icon.
<span class="php-quote">'icon_path'</span> - (string) Non-<span class="php-keyword1">default</span> directory path <span class="php-keyword1">for</span> icon.
<span class="php-quote">'onclick'</span> - (string) Onclick javascript.
<span class="php-quote">'target'</span> - (string) HREF target parameter.
<span class="php-quote">'text'</span> - (string) Label.
<span class="php-quote">'url'</span> - (string) Hyperlink.</pre>
Returns
integer The id (NOT guaranteed to be an array index) of the
item just added to the menu.
|
public
|
|
public
string
|
#
render( )
Return the rendered representation of the menu items.
Return the rendered representation of the menu items.
Returns
string The rendered representation.
|
public
|
#
addAppLinks( )
Add links to other Horde applications defined in an application's
config file.
Add links to other Horde applications defined in an application's
config file.
|
public
array
|
#
getAppLinks( )
List any links to other Horde applications defined in an application's
config file.
List any links to other Horde applications defined in an application's
config file.
Returns
array A list of applications to create menu items for.
|
public
|
#
addSiteLinks( )
Add links found in the application's menu configuration.
Add links found in the application's menu configuration.
|
public
array
|
#
getSiteLinks( )
Get the list of site links to add to the menu.
Get the list of site links to add to the menu.
Returns
array A list of menu items to add.
|
public static
boolean
|
#
isSelected( mixed $url )
Checks to see if the current url matches the given url.
Checks to see if the current url matches the given url.
Returns
boolean Whether the given URL is the current location.
|
public static
boolean
|
#
showService( string $type )
TODO
Parameters
- $type
- The type of link.
<pre>The following must be <span class="php-keyword2">defined</span> in Horde<span class="php-quote">'s menu config, or else they
won'</span>t be displayed in the menu:
<span class="php-quote">'help'</span>, <span class="php-quote">'problem'</span>, <span class="php-quote">'logout'</span>, <span class="php-quote">'login'</span>, <span class="php-quote">'prefs'</span></pre>
Returns
boolean True if the link is to be shown.
|
Constants summary
integer |
MASK_NONE
Don't show any menu items.
Don't show any menu items.
|
|
integer |
MASK_HELP
|
|
integer |
MASK_LOGIN
Show login/logout menu item.
Show login/logout menu item.
|
|
integer |
MASK_PREFS
Show preferences menu item.
Show preferences menu item.
|
|
integer |
MASK_PROBLEM
Show problem reporting menu item.
Show problem reporting menu item.
|
|
integer |
MASK_BASE
Only show application specific menu items.
Only show application specific menu items.
|
|
integer |
MASK_ALL
|
|
integer |
POS_LAST
|
|