You are here

function google_cse_build_query in Google Custom Search Engine 7.2

Same name and namespace in other branches
  1. 7.3 google_cse.module \google_cse_build_query()
  2. 7 google_cse.module \google_cse_build_query()

Builds a query array based on Google CSE settings.

File

./google_cse.module, line 76
Display a Google Custom Search Engine (CSE) on your site.

Code

function google_cse_build_query($keys, $sitesearch = NULL, $here = TRUE) {
  if (!variable_get('google_cse_use_adv', 0)) {
    return array(
      'q' => $keys,
      'cx' => variable_get('google_cse_cx', ''),
    );
  }
  return array(
    'q' => $keys,
    'cx' => variable_get('google_cse_cx', ''),
    'cof' => $here ? variable_get('google_cse_cof_here', 'FORID:11') : variable_get('google_cse_cof_google', 'FORID:0'),
    'sitesearch' => isset($sitesearch) ? $sitesearch : google_cse_sitesearch_default(),
  ) + google_cse_advanced_settings();
}