You are here

function google_cse_advanced_settings in Google Custom Search Engine 6

Same name and namespace in other branches
  1. 5 google_cse.module \google_cse_advanced_settings()
  2. 7 google_cse.module \google_cse_advanced_settings()
  3. 7.2 google_cse.module \google_cse_advanced_settings()

Returns an array of any advanced settings which have been set.

3 calls to google_cse_advanced_settings()
google_build_query in ./google.module
Build a query array based on Google CSE settings.
google_cse_searchbox_form_builder in ./google_cse.module
Form builder for the searchbox forms.
template_preprocess_google_cse_results in ./google_cse.theme.inc
The search results page can be themed/customized.

File

./google_cse.module, line 174
Display a Google Custom Search Engine 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;
}