MenuUtil Class Reference

Static Public Member Functions

static resolveByCacheAndGetVisibleAndOrderedTabMenuByCurrentUser ()
static resolveByCacheAndGetVisibleAndOrderedTabMenuByUser ($user)
static resolveByCacheAndGetVisibleAndOrderedAdminTabMenuByCurrentUser ()
static resolveByCacheAndGetVisibleAndOrderedAdminTabMenuByUser ($user)
static getMenuViewItemsCacheIdentifierByUser ($user)
static getAdminMenuViewItemsCacheIdentifierByUser ($user)
static forgetCacheEntryForTabMenuByUser ($user)
static getVisibleAndOrderedTabMenuByCurrentUser ()
static getVisibleAndOrderedTabMenuByUser ($user)
static getCustomVisibleAndOrderedTabMenuItemsByUser ($user)
static getVisibleAndOrderedAdminTabMenuByCurrentUser ()
static getVisibleAndOrderedAdminTabMenuByUser ($user)
static getAccessibleShortcutsCreateMenuByCurrentUser ()
static getAccessibleShortcutsCreateMenuByUser ($user)
static getAccessibleConfigureMenuByCurrentUser ($moduleClassName)
static getAccessibleConfigureMenuByUser ($moduleClassName, $user)
static getAccessibleConfigureSubMenuByCurrentUser ($moduleClassName)
static getAccessibleConfigureSubMenuByUser ($moduleClassName, $user)
static getOrderedAccessibleHeaderMenuForCurrentUser ()
static getOrderedAccessibleHeaderMenuForUser ($user)
static getAccessibleOrderedUserHeaderMenuForCurrentUser ()
static getAccessibleOrderedUserHeaderMenuForUser ($user)
static getAccessibleModuleTabMenuByUser ($moduleClassName, $user)
static getAccessibleModuleAdminTabMenuByUser ($moduleClassName, $user)

Data Fields

const MENU_VIEW_ITEMS = 'MenuViewItems'
const ADMIN_MENU_VIEW_ITEMS = 'AdminMenuViewItems'

Static Protected Member Functions

static getMenuViewItemsCacheIdentifier ()
static getAdminMenuViewItemsCacheIdentifier ()
static getAccessibleHeaderMenuForCurrentUser ()
static getAccessibleHeaderMenuForUser ($user)
static orderHeaderMenuItems ($a, $b)
static resolveModuleMenuForAccess ($moduleClassName, array $menu, $user=null)
static doesUserHaveRightToViewMenuItem ($moduleClassName, $item, $user)
static getModuleOrderingForTabMenuByUser ($user)
static getModuleOrderingForAdminTabMenuByUser ($user)
static resolveMenuItemsForLanguageLocalization ($menuItems, $moduleClassName, $labelElements=array('label'), $ajaxLinkOptionsElements=array('ajaxLinkOptions'))
static resolveTabMenuForDynamicLabelContent (&$items)

Detailed Description

Helper class for retrieving menus

Definition at line 40 of file MenuUtil.php.


Member Function Documentation

static resolveByCacheAndGetVisibleAndOrderedTabMenuByUser ( user  )  [static]
Parameters:
User $user
Returns:
array|mixed

Definition at line 55 of file MenuUtil.php.

static resolveByCacheAndGetVisibleAndOrderedAdminTabMenuByUser ( user  )  [static]
Parameters:
$user 
Returns:
array|mixed

Definition at line 82 of file MenuUtil.php.

static getMenuViewItemsCacheIdentifier (  )  [static, protected]

The menu view items cache identifier is a combination of the language and current user. This ensures if the user or language changes, that it properly retrieves the cache.

Definition at line 102 of file MenuUtil.php.

static getMenuViewItemsCacheIdentifierByUser ( user  )  [static]
Parameters:
$user 
Returns:
string

Definition at line 111 of file MenuUtil.php.

static getAdminMenuViewItemsCacheIdentifier (  )  [static, protected]

The admin menu view items cache identifier is a combination of the language and current user. This ensures if the user or language changes, that it properly retrieves the cache.

Definition at line 120 of file MenuUtil.php.

static getAdminMenuViewItemsCacheIdentifierByUser ( user  )  [static]
Parameters:
User $user
Returns:
string

Definition at line 129 of file MenuUtil.php.

static forgetCacheEntryForTabMenuByUser ( user  )  [static]
Parameters:
$user 

Definition at line 138 of file MenuUtil.php.

static getVisibleAndOrderedTabMenuByCurrentUser (  )  [static]

Get the tab menu items ordered and only the visible tabs based on the effective user setting for tab menu items. A module can have more than one top level menu item. Utilizes current user.

Returns:
array tab menu items

Definition at line 151 of file MenuUtil.php.

static getVisibleAndOrderedTabMenuByUser ( user  )  [static]
Parameters:
$user 
Returns:
array

Definition at line 160 of file MenuUtil.php.

static getCustomVisibleAndOrderedTabMenuItemsByUser ( user  )  [static]
Parameters:
$user 
Returns:
array

Definition at line 203 of file MenuUtil.php.

static getVisibleAndOrderedAdminTabMenuByCurrentUser (  )  [static]

Get the admin tab menu items ordered and only the visible tabs based on the effective user setting for tab menu items. A module can have more than one top level menu item. Utilizes current user.

Returns:
array tab menu items

Definition at line 225 of file MenuUtil.php.

static getVisibleAndOrderedAdminTabMenuByUser ( user  )  [static]
Parameters:
$user 
Returns:
array

Definition at line 234 of file MenuUtil.php.

static getAccessibleShortcutsCreateMenuByCurrentUser (  )  [static]

Get accessible shortcuts menu item based on the current user.

Returns:
array of menu items.

Definition at line 269 of file MenuUtil.php.

static getAccessibleShortcutsCreateMenuByUser ( user  )  [static]
Parameters:
$user 
Returns:
array

Definition at line 279 of file MenuUtil.php.

static getAccessibleConfigureMenuByCurrentUser ( moduleClassName  )  [static]

Get accessible coinfigure menu item based on the current user.

Returns:
array of menu items.

Definition at line 309 of file MenuUtil.php.

static getAccessibleConfigureMenuByUser ( moduleClassName,
user 
) [static]
Parameters:
string $moduleClassName
$user 
Returns:
menu

Definition at line 321 of file MenuUtil.php.

static getAccessibleConfigureSubMenuByCurrentUser ( moduleClassName  )  [static]
Parameters:
$moduleClassName 
Returns:
menu

Definition at line 336 of file MenuUtil.php.

static getAccessibleConfigureSubMenuByUser ( moduleClassName,
user 
) [static]
Parameters:
string $moduleClassName
$user 
Returns:
menu

Definition at line 348 of file MenuUtil.php.

static getOrderedAccessibleHeaderMenuForUser ( user  )  [static]
Parameters:
$user 
Returns:
array

Definition at line 369 of file MenuUtil.php.

static getAccessibleHeaderMenuForCurrentUser (  )  [static, protected]

Get accessible header menu item based on the specified module class name for the current user.

Returns:
array of menu items.

Definition at line 381 of file MenuUtil.php.

static getAccessibleOrderedUserHeaderMenuForCurrentUser (  )  [static]

Get accessible user header menu item based for the current user.

Returns:
array of menu items.

Definition at line 433 of file MenuUtil.php.

static getAccessibleOrderedUserHeaderMenuForUser ( user  )  [static]
Parameters:
$user 
Returns:
array

Definition at line 443 of file MenuUtil.php.

static getAccessibleModuleTabMenuByUser ( moduleClassName,
user 
) [static]

Public for testing purposes only.

Returns:
array of accessible tab menu items

Definition at line 481 of file MenuUtil.php.

static getAccessibleModuleAdminTabMenuByUser ( moduleClassName,
user 
) [static]

Public for testing purposes only.

Returns:
array of accessible admin tab menu items

Definition at line 504 of file MenuUtil.php.

static resolveModuleMenuForAccess ( moduleClassName,
array $  menu,
user = null 
) [static, protected]

Currently only supports one level of nesting.

Definition at line 526 of file MenuUtil.php.

static doesUserHaveRightToViewMenuItem ( moduleClassName,
item,
user 
) [static, protected]
Returns:
boolean true if user has right to view menu items

Definition at line 558 of file MenuUtil.php.

static getModuleOrderingForTabMenuByUser ( user  )  [static, protected]

Temporarily statically defined until we implement module sorting/visibility for tab menu items.

Definition at line 574 of file MenuUtil.php.

static getModuleOrderingForAdminTabMenuByUser ( user  )  [static, protected]

Temporarily statically defined until we implement module sorting/visibility for tab menu items.

Definition at line 594 of file MenuUtil.php.

static resolveMenuItemsForLanguageLocalization ( menuItems,
moduleClassName,
labelElements = array('label'),
ajaxLinkOptionsElements = array('ajaxLinkOptions') 
) [static, protected]

Given a menu item array, each label element, specified by $labelElements, will be iterated over and translated for the current user's language.

Returns:
menu item array

Definition at line 616 of file MenuUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri Nov 24 07:10:26 2017