You are here

function search_autocomplete_form_alter in Search Autocomplete 6

Same name and namespace in other branches
  1. 8 search_autocomplete.module \search_autocomplete_form_alter()
  2. 5 search_autocomplete.module \search_autocomplete_form_alter()
  3. 2.x search_autocomplete.module \search_autocomplete_form_alter()

File

./search_autocomplete.module, line 159

Code

function search_autocomplete_form_alter($form_id, &$form) {
  if (user_access('search autocomplete access')) {
    if (variable_get("search_autocomplete_hook_search_box", 0) == 1) {
      if ($form_id == "search_theme_form") {
        $form["search_theme_form_keys"]["#autocomplete_path"] = 'search_autocomplete/autocomplete';
      }
    }
    if (variable_get("search_autocomplete_hook_search", 0) == 1) {
      if ($form_id == "search_form" && $form['module']['#value'] == "node") {
        $form["basic"]["inline"]["keys"]["#autocomplete_path"] = 'search_autocomplete/autocomplete';
      }
    }
    if (variable_get("search_autocomplete_hook_search_block", 0) == 1) {
      if ($form_id == "search_block_form") {
        $form["search_block_form_keys"]["#autocomplete_path"] = 'search_autocomplete/autocomplete';
      }
    }
  }
}