You are here

function google_cse_search_block_form_submit in Google Custom Search Engine 7

Processes a search block form submission.

1 string reference to 'google_cse_search_block_form_submit'
google_cse_form_search_block_form_alter in ./google_cse.module
Adds custom submit handler for search block form.

File

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

Code

function google_cse_search_block_form_submit($form, &$form_state) {
  $keys = trim($form_state['values'][$form['form_id']['#value']]);
  $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,
  );
}