You are here

function apachesolr_multilingual_form_search_submit in Apache Solr Multilingual 6

Same name and namespace in other branches
  1. 6.2 apachesolr_multilingual.module \apachesolr_multilingual_form_search_submit()

See also

apachesolr_multilingual_form_search_form_alter()

1 string reference to 'apachesolr_multilingual_form_search_submit'
apachesolr_multilingual_form_search_form_alter in ./apachesolr_multilingual.module
Implements hook_form_search_form_alter().

File

./apachesolr_multilingual.module, line 420
Multilingual search using Apache Solr.

Code

function apachesolr_multilingual_form_search_submit($form, &$form_state) {
  $fv = $form_state['values'];
  if (!empty($fv['apachesolr_search']['get'])) {
    $get = json_decode($fv['apachesolr_search']['get'], TRUE);
    if (!empty($fv['apachesolr_search']['detach_auto_language_filter'])) {
      $get['detach-auto-language-filter'] = '1';
    }
    elseif (isset($get['detach-auto-language-filter'])) {
      unset($get['detach-auto-language-filter']);
    }
    $form_state['values']['apachesolr_search']['get'] = json_encode($get);
  }
}