You are here

public function SearchApiFederatedSolrField::formButtonSubmit in Search API Federated Solr 7

Same name and namespace in other branches
  1. 7.3 src/SearchApiFederatedSolrField.php \SearchApiFederatedSolrField::formButtonSubmit()
  2. 7.2 src/SearchApiFederatedSolrField.php \SearchApiFederatedSolrField::formButtonSubmit()

Submit helper callback for buttons in the callback's configuration form.

File

src/SearchApiFederatedSolrField.php, line 190

Class

SearchApiFederatedSolrField

Code

public function formButtonSubmit(array $form, array &$form_state) {
  $button_name = $form_state['triggering_element']['#name'];
  if ($button_name == 'op') {
    $this->options['fields']['_new_field_' . REQUEST_TIME] = [
      'is_new' => TRUE,
    ];
  }
  else {
    $key = substr($button_name, 34);
    unset($this->options['fields'][$key]);
  }
  $form_state['rebuild'] = TRUE;
  $this->changes = TRUE;
}