You are here

function apachesolr_search_facetapi_realm_settings_form_submit in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr_search.module \apachesolr_search_facetapi_realm_settings_form_submit()
  2. 6.3 apachesolr_search.module \apachesolr_search_facetapi_realm_settings_form_submit()

Form submission handler for facetapi_realm_settings_form().

1 string reference to 'apachesolr_search_facetapi_realm_settings_form_submit'
apachesolr_search_form_facetapi_realm_settings_form_alter in ./apachesolr_search.module
Implements hook_form_[form_id]_alter().

File

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

Code

function apachesolr_search_facetapi_realm_settings_form_submit(&$form, &$form_state) {
  $env_id = $form['#facetapi']['env_id'];

  // Adds the settings to the array keyed by environment ID, saves variables.
  $show_facets = $form_state['values']['apachesolr_search_show_facets'];
  $facet_pages = $form_state['values']['apachesolr_search_facet_pages'];
  if ($show_facets) {
    apachesolr_environment_variable_set($env_id, 'apachesolr_search_show_facets', $show_facets);
  }
  else {

    // Due to performance reasons, we delete it from the vars so that our init
    // process can react on environments that hae it set and not unset.
    // See apachesolr_search_init().
    apachesolr_environment_variable_del($env_id, 'apachesolr_search_show_facets');
  }
  apachesolr_environment_variable_set($env_id, 'apachesolr_search_facet_pages', $facet_pages);
}