GlobalSearchUtil Class Reference

Static Public Member Functions

static getGlobalSearchScopingModuleNamesAndLabelsDataByUser (User $user)
static resolveModuleNamesAndLabelsDataWithAllOption (&$moduleNamesAndLabels)
static resolveGlobalSearchScopeFromGetData ($get, $attributeName= 'globalSearchScope')
static resolveIfModuleShouldBeGloballySearched (Module $module)

Static Protected Member Functions

static findGlobalSearchScopingModuleNamesAndLabelsDataByUser (User $user)
static getGlobalSearchScopingCacheIdentifier (User $user)

Detailed Description

Helper class to assist with Global Search functionality.

Definition at line 40 of file GlobalSearchUtil.php.


Member Function Documentation

static getGlobalSearchScopingModuleNamesAndLabelsDataByUser ( User user  )  [static]

Given a user, return an array of module names and their translated labels, for which the user has the right to access and only modules that support the global search.

Parameters:
User $user
Returns:
array of module names and labels.

Definition at line 48 of file GlobalSearchUtil.php.

static getGlobalSearchScopingCacheIdentifier ( User user  )  [static, protected]

The global search scoping module names cache identifier is a combination of the language and specified user. This ensures if the user or language changes, that it properly retrieves the cache.

Definition at line 86 of file GlobalSearchUtil.php.

static resolveModuleNamesAndLabelsDataWithAllOption ( &$  moduleNamesAndLabels  )  [static]

Add a 'All' element as the first element in the array.

Parameters:
array $moduleNamesAndLabels
Returns:
modified $moduleNamesAndLabels array with All as first element.

Definition at line 97 of file GlobalSearchUtil.php.

static resolveGlobalSearchScopeFromGetData ( get,
attributeName = 'globalSearchScope' 
) [static]

Given a $_GET array, resolve the value of the globalSearchScope. if the globalSearchScope isset but the value is 'All', return null, since this is the same as having null to begin with.

Parameters:
array $get
string $attributeName
Returns:
null or array of globalSearchScope value.

Definition at line 109 of file GlobalSearchUtil.php.

static resolveIfModuleShouldBeGloballySearched ( Module module  )  [static]

Given a module, return true/false if it should be able to be globally searched. This is just an initial safety pass as the module will still need to return a class for $module::getGlobalSearchFormClassName(); This handles the exception of the UsersModule which can have module scoping for UsersListView, but we do not want this to be globally searched.

Parameters:
Module $module

Definition at line 129 of file GlobalSearchUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun Mar 26 07:10:25 2017