You are here

function apachesolr_enabled_facets_form_submit in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 5.2 apachesolr.admin.inc \apachesolr_enabled_facets_form_submit()
  2. 6 apachesolr.admin.inc \apachesolr_enabled_facets_form_submit()

This is the submit handler for the active facets form.

The form values for each module are array filtereed to remove non-enabled items and stored in the variable table with the name 'apachesolr_enabled_facets'.

See also

apachesolr_enabled_facets_form()

File

./apachesolr.admin.inc, line 276
Administrative pages for the Apache Solr framework.

Code

function apachesolr_enabled_facets_form_submit($form, &$form_state) {
  $enabled = array();
  foreach ($form_state['values']['apachesolr_enabled_facets'] as $module => $facets) {
    $enabled[$module] = array_filter($facets);
  }
  apachesolr_save_enabled_facets($enabled);

  // This cache being stale can prevent new facet filters from working.
  apachesolr_clear_cache();
  drupal_set_message($form_state['values']['submit_message'], 'warning');
}