You are here

function panopoly_search_all_form_submit in Panopoly Search 7

Custom form submit handler to change redirect state of the form

1 string reference to 'panopoly_search_all_form_submit'
panopoly_search_form_alter in ./panopoly_search.module
Implementation of hook_form_alter()

File

./panopoly_search.module, line 27

Code

function panopoly_search_all_form_submit($form, &$form_state) {

  // The block provided by core's Search module uses the form ID as the value
  // key, not keys.
  if (!isset($form_state['values']['keys'])) {
    $keys = trim($form_state['values'][$form['#form_id']]);
  }
  else {
    $keys = trim($form_state['values']['keys']);
  }
  $module = !empty($form_state['values']['module']) ? $form_state['values']['module'] : 'site';
  $module = $module === 'node' ? 'site' : $module;
  $form_state['redirect'] = array(
    'search/' . $module . '/' . $keys,
  );
}