function panopoly_search_all_form_submit in Panopoly 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 modules/
panopoly/ panopoly_search/ panopoly_search.module - Implementation of hook_form_alter()
File
- modules/
panopoly/ panopoly_search/ 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,
);
}