Base class for building a menu / button structure where the display of items is dependent on both privileges and the availability of parameter information, e.g. data to fill an 'id' parameter.

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

 Methods

Copy from \Zend_Translate_Adapter

_(string $text, string|\Zend_Locale $locale = null) : string

Translates the given string returns the translation

Parameters

$text

string

Translation string

$locale

string\Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

__construct()

__construct(\GemsEscort $escort) 

Parameters

$escort

Add a agenda setup menu tree to the menu

addAgendaSetupMenu(string $label) : \Gems_Menu_SubMenuItem

Parameters

$label

string

Returns

\Gems_Menu_SubMenuItem

Add a browse / ceate / edit / show / / sleanup etc.

addAgendaSetupPage(string $label, string $privilege, string $controller, array $other = array()) : \Gems_Menu_SubMenuItem

. menu item

Parameters

$label

string

$privilege

string

$controller

string

$other

array

Returns

\Gems_Menu_SubMenuItem

Add a browse / ceate / edit / show / etc.

addBrowsePage(string $label, string $privilege, string $controller, array $other = array()) : \Gems_Menu_SubMenuItem

. menu item

Parameters

$label

string

$privilege

string

$controller

string

$other

array

Returns

\Gems_Menu_SubMenuItem

Add a menu item that is never added to the navigation tree and only shows up as a button.

addButtonOnly(string $label, string $privilege, string $controller, string $action = 'index', array $other = array()) : \Gems_Menu_SubMenuItem

Parameters

$label

string

$privilege

string

$controller

string

$action

string

$other

array

Returns

\Gems_Menu_SubMenuItem

Add a calendar page to the menu

addCalendarPage(string $label) : \Gems_Menu_SubMenuItem

Parameters

$label

string

Returns

\Gems_Menu_SubMenuItem

Add a Mail menu tree to the menu

addCommSetupMenu(string $label) : \Gems_Menu_SubMenuItem

Parameters

$label

string

Returns

\Gems_Menu_SubMenuItem

addContainer()

addContainer($label, $privilege = null, array $other = array()

Parameters

$label

$privilege

$other

Shortcut function to create the export container.

addExportContainer(string $label) : \Gems_Menu_MenuAbstract

Parameters

$label

string

Label for the container

Returns

\Gems_Menu_MenuAbstractThe new contact page

Add a file upload/download page to the menu

addFilePage(string $label, string $privilege, string $controller, array $other = array()) : \Gems_Menu_SubMenuItem

Parameters

$label

string

The label to display for the menu item, null for access without display

$privilege

string

The privilege for the item, null is always, 'pr.islogin' must be logged in, 'pr.nologin' only when not logged in.

$controller

string

What controller to use

$other

array

Array of extra options for this item, e.g. 'visible', 'allowed', 'class', 'icon', 'target', 'type', 'button_only'

Returns

\Gems_Menu_SubMenuItem

Add a roles browse edit page to the menu,

addGroupsPage(string $label, array $other = array()) : \Gems_Menu_SubMenuItem

Parameters

$label

string

$other

array

Returns

\Gems_Menu_SubMenuItem

Shortcut function to create the import container.

addImportContainer(string $label) : \Gems_Menu_MenuAbstract

Parameters

$label

string

Label for the container

Returns

\Gems_Menu_MenuAbstractThe new contact page

Add the log menu items

addLogControllers() 

Add a page to the menu

addPage(string $label, string $privilege, string $controller, string $action = 'index', array $other = array()) : \Gems_Menu_SubMenuItem

Parameters

$label

string

The label to display for the menu item, null for access without display

$privilege

string

The privilege for the item, null is always, 'pr.islogin' must be logged in, 'pr.nologin' only when not logged in.

$controller

string

What controller to use

$action

string

The name of the action

$other

array

Array of extra options for this item, e.g. 'visible', 'allowed', 'class', 'icon', 'target', 'type', 'button_only'

Returns

\Gems_Menu_SubMenuItem

Add a list of report pages

addPlanPage(string $label) : \Gems_Menu_SubMenuItem

Parameters

$label

string

The label to display for the menu item, null for access without display

Returns

\Gems_Menu_SubMenuItem

Add pages that show the user technical information about the installation in the project.

addProjectInfoPage(string $label) : \Gems_Menu_SubMenuItem

Parameters

$label

string

Returns

\Gems_Menu_SubMenuItem

Add pages that show the user an overview of the tracks / surveys used in the project.

addProjectPage(string $label) : \Gems_Menu_SubMenuItem

Parameters

$label

string

Returns

\Gems_Menu_SubMenuItem

Add a staff browse edit page to the menu,

addStaffPage(string $label, array $other = array()) : \Gems_Menu_SubMenuItem

Parameters

$label

string

$other

array

Returns

\Gems_Menu_SubMenuItem

Add a Trackbuilder menu tree to the menu

addTrackBuilderMenu(string $label, array $other = array()) : \Gems_Menu_SubMenuItem

Parameters

$label

string

$other

array

Returns

\Gems_Menu_SubMenuItem

getChildren()

getChildren() : array

Returns

arrayof type \Gems_Menu_SubMenuItem

hasChildren()

hasChildren() 

isTopLevel()

isTopLevel() 

isVisible()

isVisible() 

Copy from \Zend_Translate_Adapter

plural(string $singular, string $plural, integer $number, string|\Zend_Locale $locale = null) : string

Translates the given string using plural notations Returns the translated string

see

Parameters

$singular

string

Singular translation string

$plural

string

Plural translation string

$number

integer

Number for detecting the correct plural

$locale

string\Zend_Locale

(Optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

Sorts the childeren on their order attribute (instead of the order the were added)

sortByOrder() : \Gems_Menu_MenuAbstract

Returns

\Gems_Menu_MenuAbstract(continuation pattern)

uasort() function for sortByOrder()

sortOrder(self $aItem, self $bItem) : integer
Static
see

Parameters

$aItem

self

$bItem

self

Returns

integer

Adds privileges that are used in this menu item to the array

_addUsedPrivileges(array $privileges, $label) 

Parameters

$privileges

array

$label

Get tge request to use for menu building

_getOriginalRequest() : \Zend_Controller_Request_Abstract

Returns

\Zend_Controller_Request_Abstract

Returns a \Zend_Navigation creation array for this menu item, with sub menu items in 'pages'

_toNavigationArray(\Gems_Menu_ParameterCollector $source) : array

Parameters

$source

\Gems_Menu_ParameterCollector

Returns

array

Add a sub item to this item.

add(array $args_array) : \Gems_Menu_SubMenuItem

The argumenets can be any of those used for \Zend_Navigation_Page as well as some Gems specials.

  • 'action' The name of the action.
  • 'allowed' Is the user allowed to access this menu item. Is checked against ACL using 'privilige'.
  • 'button_only' Never in the menu, only shown as a button by the program.
  • 'class' Display class for the menu link.
  • 'controller' What controller to use.
  • 'icon' Icon to display with the label.
  • 'label' The label to display for the menu item.
  • 'privilege' The privilege needed to choose the item.
  • 'target' Optional target attribute for the link.
  • 'type' Optional content type for the link
  • 'visible' Is the item visible. Is checked against ACL using 'privilige'.

see

Parameters

$args_array

array

\MUtil_Ra::args array with defaults 'visible' and 'allowed' true.

Returns

\Gems_Menu_SubMenuItem

Set the visibility of the menu item and any sub items in accordance with the specified user role.

applyAcl(\Zend_Acl $acl, string $userRole) : \Gems_Menu_MenuAbstract

Parameters

$acl

\Zend_Acl

$userRole

string

Returns

\Gems_Menu_MenuAbstract(continuation pattern)

findItem()

findItem(\<type> $options, \<type> $findDeep = true) : \Gems_Menu_SubMenuItem | null

Parameters

$options

\<type>

$findDeep

\<type>

Returns

\Gems_Menu_SubMenuItemnull

findItemPath()

findItemPath($options) 

Parameters

$options

findItems()

findItems($options, array $results) 

Parameters

$options

$results

Make sure only the active branch is visible

setBranchVisible(array $activeBranch) : \Gems_Menu_MenuAbstract

Parameters

$activeBranch

array

Of \Gems_Menu_Menu Abstract items

Returns

\Gems_Menu_MenuAbstract(continuation pattern)

setForChildren()

setForChildren($key, $value) 

Parameters

$key

$value

 Properties

 

$escort

$escort : \GemsEscort

Default

 

$_subItems

$_subItems 

Default

array()
 

$translateAdapter

$translateAdapter : \Zend_Translate_Adapter

Default

 

$user

$user : \Gems_User_User

Default