You are here

function apachesolr_multilingual_apachesolr_search_custom_page_search_form_submit in Apache Solr Multilingual 7

Same name and namespace in other branches
  1. 6.3 apachesolr_multilingual.module \apachesolr_multilingual_apachesolr_search_custom_page_search_form_submit()

See also

apachesolr_multilingual_form_search_form_alter()

1 string reference to 'apachesolr_multilingual_apachesolr_search_custom_page_search_form_submit'
apachesolr_multilingual_form_apachesolr_search_custom_page_search_form_alter in ./apachesolr_multilingual.module
Implements hook_form_search_form_alter().

File

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

Code

function apachesolr_multilingual_apachesolr_search_custom_page_search_form_submit($form, &$form_state) {
  $fv = $form_state['values'];
  if (!empty($fv['get'])) {
    $get = json_decode($fv['get'], TRUE);
    if (!empty($fv['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']['get'] = json_encode($get);
  }
}