package Gems
subpackage Menu
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.4

 Methods

__construct()

__construct(\Gems_Menu $menu, string $glue = ' '

Parameters

$menu

\Gems_Menu

$glue

string

Optional, text to put between link items

Add a menu item by specifying the controller

addByController(string $controller, string $action = 'index', string $label = null) : \Gems_Menu_MenuList

Parameters

$controller

string

Controller name

$action

string

Action name

$label

string

Optional alternative label

Returns

\Gems_Menu_MenuList(continuation pattern)

Adds the children of the current menu item to this list

addCurrentChildren() : \Gems_Menu_MenuList

Returns

\Gems_Menu_MenuList(continuation pattern)

Adds the parent of parent of the current menu item

addCurrentGrandParent(string $label = null) : \Gems_Menu_MenuList

Does nothing when the parent is a top level item (has no controllor or is the \Gems_menu itself).

Parameters

$label

string

Optional alternative label

Returns

\Gems_Menu_MenuList(continuation pattern)

Adds the parent of the current menu item

addCurrentParent(string $label = null) : \Gems_Menu_MenuList

Does nothing when the parent is a top level item (has no controllor or is the \Gems_menu itself).

Parameters

$label

string

Optional alternative label

Returns

\Gems_Menu_MenuList(continuation pattern)

Adds the siblings (= other children of the parent) of the current menu item to this list

addCurrentSiblings(boolean $anyParameters = false, $includeCurrent = false) : \Gems_Menu_MenuList

Parameters

$anyParameters

boolean

When false, siblings must have the same parameter set as the current menu item

$includeCurrent

Returns

\Gems_Menu_MenuList(continuation pattern)

Add a menu item to this list

addMenuItem(\Gems_Menu_SubMenuItem $menuItem, string $label = null) : \Gems_Menu_MenuList

Parameters

$menuItem

\Gems_Menu_SubMenuItem

$label

string

Optional alternative label

Returns

\Gems_Menu_MenuList(continuation pattern)

addParameterSources()

addParameterSources($source_1, $source_2 = null) : \Gems_Menu_MenuList

Parameters

$source_1

$source_2

Returns

\Gems_Menu_MenuList(continuation pattern)

Get the action link for a specific item.

getFirstAction(boolean $remove = true) : \MUtil_Html_HtmlElement

Parameters

$remove

boolean

Optional, set to true to remove the item from this list.

Returns

\MUtil_Html_HtmlElement

Renders the element into a html string

render(\Zend_View_Abstract $view) : string

The $view is used to correctly encode and escape the output

Parameters

$view

\Zend_View_Abstract

Returns

stringCorrectly encoded and escaped html output

Changes the label for a specific menu item

setLabel(string $controller, string $action, string $label) : \Gems_Menu_MenuList

Parameters

$controller

string

Controller name

$action

string

Action name

$label

string

Alternative label

Returns

\Gems_Menu_MenuList(continuation pattern)

Switches between lowercase links or normal case

setLowerCase(boolean $value = true) : \Gems_Menu_MenuList

Parameters

$value

boolean

Returns

\Gems_Menu_MenuList(continuation pattern)

Switches showing disabled menu items on or off (= default)

showDisabled(boolean $value = true) : \Gems_Menu_MenuList

Parameters

$value

boolean

Returns

\Gems_Menu_MenuList(continuation pattern)

Generates the key name

_getKey(string $controller, string $action) : string

Parameters

$controller

string

Controller name

$action

string

Action name

Returns

string

 Properties

 

of alternative label strings

$altLabels : array

Default

 

toActionLink|toActionLinkLower

$linkFunction : string

Default

'toActionLink'
 

$menu

$menu : \Gems_Menu

Default

 

The first 'disabled' item sets the default value of

$sources : array

Default

array(self::KEY_DISABLED => false)

 Constants

 

KEY_DISABLED

KEY_DISABLED = 'key_disabled'