You are here

function search_log_form_alter in Search Log 6

Same name and namespace in other branches
  1. 8 search_log.module \search_log_form_alter()
  2. 7 search_log.module \search_log_form_alter()

Implementation of hook_form_alter().

Alter standard search forms to capture submission.

File

./search_log.module, line 88
Replaces default report of top search phrases.

Code

function search_log_form_alter($form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'search_form':
    case 'search_block_form':
    case 'search_theme_form':
      if (isset($form['module'])) {
        if (!in_array($form['module']['#value'], variable_get('search_log_modules_enabled', array()))) {
          return;
        }
      }
      $form['#submit'][] = 'search_log_submit';
      break;
  }
  return $form;
}