function search_log_form_alter in Search Log 8
Same name and namespace in other branches
- 6 search_log.module \search_log_form_alter()
- 7 search_log.module \search_log_form_alter()
Implements hook_form_alter().
Alter standard search forms to capture submission.
File
- ./
search_log.module, line 59 - This module holds functions of Search Log Module.
Code
function search_log_form_alter(&$form, &$form_state, $form_id) {
$form_id_processed = $form_id;
// Custom Search module.
if (strpos($form_id_processed, 'custom_search_blocks_form') !== FALSE) {
$form_id_processed = 'custom_search_blocks_form';
}
switch ($form_id_processed) {
case 'search_form':
array_unshift($form['#submit'], 'search_log_search_form_submit');
break;
case 'search_block_form':
array_unshift($form['#submit'], 'search_log_search_block_form_submit');
break;
case 'search_theme_form':
array_unshift($form['#submit'], 'search_log_search_theme_form_submit');
break;
case 'custom_search_blocks_form':
array_unshift($form['#submit'], 'search_log_custom_search_blocks_form_submit');
break;
}
}