You are here

public function SearchApiRangesAlter::configurationFormSubmit in Search API ranges 7

Submit callback for configuration form.

Overrides SearchApiAbstractAlterCallback::configurationFormSubmit

File

includes/callback_search_api_ranges.inc, line 76

Class

SearchApiRangesAlter
Search API ranges data alteration callback that indexes the min and max of selected numeric fields.

Code

public function configurationFormSubmit(array $form, array &$values, array &$form_state) {
  if (empty($values['fields'])) {
    return array();
  }
  foreach ($values['fields'] as $name => $field) {
    if (empty($field['enabled'])) {
      unset($values['fields'][$name]);
    }
    else {

      // Don't save the enabled flag, it's only used here.
      unset($values['fields'][$name]['enabled']);
    }
  }
  $this->options = $values;
  return $values;
}