You are here

public function AdministrationForm::validateForm in Google Search Appliance 8

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

src/Form/AdministrationForm.php, line 305

Class

AdministrationForm
Class AdministrationForm.

Namespace

Drupal\google_appliance\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);

  // @todo
  //   For security, we check that the user has access to use these filters.
  //    $field_text_format_keys = [
  //      'error_gsa_no_results',
  //      'error_curl_error',
  //      'error_lib_xml_parse_error',
  //    ];
  //    $formats = filter_formats();
  //    foreach ($field_text_format_keys as $field) {
  //      if (!filter_access($formats[$form_state['values'][$field]['format']])) {
  //        form_set_error($field . '][format', $this->t('An illegal choice has been detected. Please contact the site administrator.'));
  //      }
  //      else {
  //        // Alter the formatted text area settings to our expectations.
  //        $form_state['values'][$field . '_format'] = $form_state['values'][$field]['format'];
  //        $form_state['values'][$field] = trim($form_state['values'][$field]['value']);
  //      }
  //    }
}