You are here

function top_searches_catch_search_keys in Top Searches 7

Same name and namespace in other branches
  1. 5 top_searches.module \top_searches_catch_search_keys()
  2. 6 top_searches.module \top_searches_catch_search_keys()
1 string reference to 'top_searches_catch_search_keys'
top_searches_form_alter in ./top_searches.module

File

./top_searches.module, line 83

Code

function top_searches_catch_search_keys($form, $form_state) {
  switch ($form['form_id']['#value']) {
    case "search_block_form":
      $keys = $form_state['values']['search_block_form'];
      break;
    case "search_theme_form":
      $keys = $form_state['values']['search_theme_form'];
      break;
    case "search_form":
      $keys = $form_state['values']['keys'];
      break;
  }

  // Send keys to top_searches hook
  if ($keys) {
    $valid = _top_searches_valid_phrase($keys);
    if ($valid) {
      top_searches_top_searches($keys);
    }
  }
}