You are here

function google_cse_search_form_submit in Google Custom Search Engine 7

Processes a search form submission.

1 string reference to 'google_cse_search_form_submit'
google_cse_form_search_form_alter in ./google_cse.module
Adds custom submit handler for search form.

File

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

Code

function google_cse_search_form_submit($form, &$form_state) {
  $keys = $form_state['values']['processed_keys'];
  $sitesearch = isset($form_state['values']['sitesearch']) ? $form_state['values']['sitesearch'] : NULL;
  $form_state['redirect'] = array(
    $form_state['redirect'],
    array(
      'query' => google_cse_build_query($keys, $sitesearch),
    ),
    301,
  );
}