function google_cse_advanced_settings in Google Custom Search Engine 7
Same name and namespace in other branches
- 5 google_cse.module \google_cse_advanced_settings()
- 6 google_cse.module \google_cse_advanced_settings()
- 7.2 google_cse.module \google_cse_advanced_settings()
Returns an array of any advanced settings which have been set.
2 calls to google_cse_advanced_settings()
- google_cse_build_query in ./
google_cse.module - Builds a query array based on Google CSE settings.
- google_cse_results_searchbox_form in ./
google_cse.theme.inc - Form builder for the searchbox forms.
File
- ./
google_cse.module, line 133 - Display a Google Custom Search Engine (CSE) on your site.
Code
function google_cse_advanced_settings() {
global $language;
$settings = array();
foreach (array(
'cr',
'gl',
'hl',
'ie',
'lr',
'oe',
'safe',
) as $parameter) {
if ($setting = variable_get("google_cse_{$parameter}", '')) {
$settings[$parameter] = $setting;
}
}
if (variable_get('google_cse_locale_hl', '')) {
$settings['hl'] = $language->language;
}
if (variable_get('google_cse_locale_lr', '')) {
$settings['lr'] = 'lang_' . $language->language;
}
return $settings;
}