You are here

public function SettingsForm::submitForm in Content Planner 8

Same name in this branch
  1. 8 modules/content_kanban/src/Form/SettingsForm.php \Drupal\content_kanban\Form\SettingsForm::submitForm()
  2. 8 modules/content_calendar/src/Form/SettingsForm.php \Drupal\content_calendar\Form\SettingsForm::submitForm()

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

modules/content_kanban/src/Form/SettingsForm.php, line 148

Class

SettingsForm
Defines a form that configures forms module settings.

Namespace

Drupal\content_kanban\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Get values.
  $values = $form_state
    ->getValues();

  // Get value to use Content Calendar colors.
  $use_content_calendar_colors = $values['use_content_calendar_colors'];

  // If Content Calendar module is disabled, then disable usage of colors.
  if (!$this->kanbanService
    ->contentCalendarModuleIsEnabled()) {
    $use_content_calendar_colors = 0;
  }

  // Save settings into configuration.
  $this
    ->saveColorSetting($use_content_calendar_colors);

  // Save show user image thumbnail option.
  $this
    ->config(self::CONFIG_NAME)
    ->set('show_user_thumb', $values['show_user_thumb'])
    ->set('default_filter_date_range', $values['default_filter_date_range'])
    ->save();
}