You are here

public function IgnoredModulesForm::submitForm in Nagios Monitoring 8

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 ConfigFormBase::submitForm

File

src/Form/IgnoredModulesForm.php, line 189

Class

IgnoredModulesForm

Namespace

Drupal\nagios\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('nagios.settings');
  $ignored_modules = array_keys(array_filter($form_state
    ->getValue('modules')));
  $config
    ->set('nagios.ignored_modules', $ignored_modules);
  $config
    ->save();
  parent::submitForm($form, $form_state);
}