You are here

function google_appliance_block_form_submit in Google Search Appliance 7

Submit handler for block search form just sets the redirect for the form based on the search query

File

./google_appliance.module, line 270
Google Appliance module enables searching via a dedicated Google Search Appliance hardware device. See README.txt and the help page at admin/help/google_appliance.

Code

function google_appliance_block_form_submit($form, &$form_state) {
  $settings = _google_appliance_get_settings();

  // kill any dynamic destinations, as the results page is always the destination
  if (isset($_GET['destination'])) {
    unset($_GET['destination']);
  }

  // set the redirect
  $search_query = urlencode($form_state['values']['search_keys']);
  $form_state['redirect'] = url($settings['drupal_path'] . '/' . $search_query, array(
    'absolute' => TRUE,
  ));

  // search execution happens in page callback
}