You are here

public function ManageDialog::validateForm in TacJS 8.5

Same name and namespace in other branches
  1. 8.6 src/Form/Steps/ManageDialog.php \Drupal\tacjs\Form\Steps\ManageDialog::validateForm()
  2. 8.3 src/Form/Steps/ManageDialog.php \Drupal\tacjs\Form\Steps\ManageDialog::validateForm()
  3. 8.4 src/Form/Steps/ManageDialog.php \Drupal\tacjs\Form\Steps\ManageDialog::validateForm()

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/Steps/ManageDialog.php, line 215

Class

ManageDialog
Class ManageDialog.

Namespace

Drupal\tacjs\Form\Steps

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $form_state
    ->setValue('showAlertSmall', $form_state
    ->getValue('showAlertSmall') ? TRUE : FALSE)
    ->setValue('cookieslist', $form_state
    ->getValue('cookieslist') ? TRUE : FALSE)
    ->setValue('showIcon', $form_state
    ->getValue('showIcon') ? TRUE : FALSE)
    ->setValue('adblocker', $form_state
    ->getValue('adblocker') ? TRUE : FALSE)
    ->setValue('DenyAllCta', $form_state
    ->getValue('DenyAllCta') ? TRUE : FALSE)
    ->setValue('AcceptAllCta', $form_state
    ->getValue('AcceptAllCta') ? TRUE : FALSE)
    ->setValue('highPrivacy', $form_state
    ->getValue('highPrivacy') ? TRUE : FALSE)
    ->setValue('handleBrowserDNTRequest', $form_state
    ->getValue('handleBrowserDNTRequest') ? TRUE : FALSE)
    ->setValue('removeCredit', $form_state
    ->getValue('removeCredit') ? TRUE : FALSE)
    ->setValue('moreInfoLink', $form_state
    ->getValue('moreInfoLink') ? TRUE : FALSE)
    ->setValue('useExternalCss', $form_state
    ->getValue('useExternalCss') ? TRUE : FALSE)
    ->setValue('useExternalJs', $form_state
    ->getValue('useExternalJs') ? TRUE : FALSE)
    ->setValue('mandatory', $form_state
    ->getValue('mandatory') ? TRUE : FALSE)
    ->setValue('expire', (int) $form_state
    ->getValue('expire') ?: NULL);
  parent::validateForm($form, $form_state);
}