function search_autocomplete_form_alter in Search Autocomplete 5
Same name and namespace in other branches
- 8 search_autocomplete.module \search_autocomplete_form_alter()
- 6 search_autocomplete.module \search_autocomplete_form_alter()
- 2.x search_autocomplete.module \search_autocomplete_form_alter()
Alter the existing search forms
File
- ./
search_autocomplete.module, line 176 - Drupal Module: Search Autocomplete New maintener: Miroslav <www.axiomcafe.fr/contact>
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';
}
}
}
}