You are here

public function ResetPresetsConfirmForm::submitForm in Easychart 8.3

Form submission 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 FormInterface::submitForm

File

src/Form/ResetPresetsConfirmForm.php, line 40
Contains \Drupal\easychart\ResetPresetsConfirmForm

Class

ResetPresetsConfirmForm

Namespace

Drupal\easychart\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->configFactory()
    ->getEditable('easychart.settings')
    ->clear('presets')
    ->save();
  drupal_set_message($this
    ->t('The presets have been reset to their default values.'));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}