本文整理匯總了PHP中UnifiedSearchAdvanced::getUnifiedSearchModulesDisplay方法的典型用法代碼示例。如果您正苦於以下問題:PHP UnifiedSearchAdvanced::getUnifiedSearchModulesDisplay方法的具體用法?PHP UnifiedSearchAdvanced::getUnifiedSearchModulesDisplay怎麽用?PHP UnifiedSearchAdvanced::getUnifiedSearchModulesDisplay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnifiedSearchAdvanced
的用法示例。
在下文中一共展示了UnifiedSearchAdvanced::getUnifiedSearchModulesDisplay方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSearchModules
/**
* Determine which modules should be searched against.
*
* @return array
*/
protected function getSearchModules()
{
$usa = new UnifiedSearchAdvanced();
$unified_search_modules_display = $usa->getUnifiedSearchModulesDisplay();
// load the list of unified search enabled modules
$modules = array();
//check to see if the user has customized the list of modules available to search
$users_modules = $GLOBALS['current_user']->getPreference('globalSearch', 'search');
if (!empty($users_modules)) {
// use user's previous selections
foreach ($users_modules as $key => $value) {
if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) {
$modules[$key] = $key;
}
}
} else {
foreach ($unified_search_modules_display as $key => $data) {
if (!empty($data['visible'])) {
$modules[$key] = $key;
}
}
}
// make sure the current module appears first in the list
if (isset($modules[$this->module])) {
unset($modules[$this->module]);
$modules = array_merge(array($this->module => $this->module), $modules);
}
return $modules;
}