function google_appliance_get_settings in Google Search Appliance 6.2
Get selected config settings.
6 calls to google_appliance_get_settings()
- google_appliance_admin_settings in ./
google_appliance.module - google_appliance module configuration form.
- google_appliance_admin_settings_submit in ./
google_appliance.module - Submit handler for module configuration form. Rebuild menus if a significant config value was changed.
- google_appliance_catch_all_task_access in ./
google_appliance.module - Menu access callback to prevent the catch-all LOCAL_TASK from triggering when one of the standard search tabs is active.
- google_appliance_menu in ./
google_appliance.module - Implementation of hook_menu().
- google_appliance_menu_alter in ./
google_appliance.module - Implementation of hook_menu_alter().
File
- ./
google_appliance.module, line 39 - Google Search Appliance (GSA) / Google Mini integration
Code
function google_appliance_get_settings($reset = FALSE) {
static $settings;
if ($reset or empty($settings)) {
$google_appliance_name = trim(variable_get('google_appliance_name', GOOGLE_APPLIANCE_NAME_DEFAULT));
$google_appliance_path = trim(variable_get('google_appliance_path', 'google-appliance'));
$default_client = trim(variable_get('google_appliance_default_client', 'default_frontend'));
$default_collection = trim(variable_get('google_appliance_default_collection', 'default_collection'));
$default_tab_enabled = variable_get('google_appliance_default_tab_enabled', TRUE);
$default_search_path = trim(variable_get('google_appliance_default_search_path', 'google-appliance'));
$search_tabs = trim(variable_get('google_appliance_search_tabs', ''));
$tabs_array = array();
if ($search_tabs) {
foreach (preg_split('/[\\n\\r]+/', $search_tabs) as $tab) {
if ($tab = trim($tab)) {
$tabs_array[] = $tab;
}
}
}
$default_tab = implode('|', array(
$google_appliance_name,
$default_search_path,
$default_client,
$default_collection,
));
// Add the default tab to the tabs array, if requested.
if ($default_tab_enabled) {
array_unshift($tabs_array, $default_tab);
}
$settings = array(
'google_appliance_name' => $google_appliance_name,
'google_appliance_path' => $google_appliance_path,
'default_client' => $default_client,
'default_collection' => $default_collection,
'search_tabs' => $search_tabs,
'tabs_array' => $tabs_array,
'default_tab' => $default_tab,
'default_tab_enabled' => $default_tab_enabled,
'default_search_path' => $default_search_path,
);
}
return $settings;
}