You are here

function apachesolr_search_form_search_block_form_alter in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 8 apachesolr_search.module \apachesolr_search_form_search_block_form_alter()
  2. 6.3 apachesolr_search.module \apachesolr_search_form_search_block_form_alter()
  3. 6 apachesolr_search.module \apachesolr_search_form_search_block_form_alter()
  4. 7 apachesolr_search.module \apachesolr_search_form_search_block_form_alter()

Implementation of hook_form_[form_id]_alter().

1 call to apachesolr_search_form_search_block_form_alter()
apachesolr_search_form_search_theme_form_alter in ./apachesolr_search.module
Implementation of hook_form_[form_id]_alter().

File

./apachesolr_search.module, line 1148
Provides a content search implementation for node content for use with the Apache Solr search application.

Code

function apachesolr_search_form_search_block_form_alter(&$form, $form_state) {
  if (variable_get('apachesolr_search_make_default', 0)) {
    $form['#action'] = url('search/apachesolr_search');
    if (!isset($form['#submit'])) {
      $form['#submit'] = array(
        'apachesolr_search_search_box_form_submit',
      );
    }
    else {
      $key = array_search('search_box_form_submit', $form['#submit']);
      if ($key !== FALSE) {

        // Replace the search module's function.
        $form['#submit'][$key] = 'apachesolr_search_search_box_form_submit';
      }
    }
  }
}