function ds_search_form_search_form_alter in Display Suite 7
Same name and namespace in other branches
- 7.2 modules/ds_search/ds_search.module \ds_search_form_search_form_alter()
Implements hook_form_FORM_ID_alter().
File
- modules/
ds_search/ ds_search.module, line 509 - Display Suite search.
Code
function ds_search_form_search_form_alter(&$form, $form_state) {
// Drupal core
if (variable_get('ds_search_type', 'node') == 'node' && isset($form['module']) && $form['module']['#value'] == 'ds_search') {
if (variable_get('ds_search_node_form_alter', FALSE)) {
$form['module']['#value'] = 'node';
node_form_search_form_alter($form, $form_state);
}
}
// Apache Solr.
if (variable_get('ds_search_type', 'node') == 'apachesolr_search' && isset($form['module']) && $form['module']['#value'] == 'ds_search') {
if (variable_get('ds_search_apachesolr_form_alter', FALSE)) {
if (function_exists('apachesolr_search_form_search_form_alter')) {
$form['module']['#value'] = 'apachesolr_search';
apachesolr_search_form_search_form_alter($form, $form_state);
if (variable_get('ds_search_apachesolr_hide_current_filters', FALSE)) {
$form['basic']['apachesolr_search']['retain-filters']['#type'] = 'value';
$form['basic']['apachesolr_search']['retain-filters']['#value'] = variable_get('ds_search_apachesolr_current_filters_default', FALSE);
}
}
}
}
}