You are here

public function PublishContentSettings::submitForm in Publish Content 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/PublishContentSettings.php, line 138

Class

PublishContentSettings
Class PublishContentSettings.

Namespace

Drupal\publishcontent\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('publishcontent.settings');
  $config
    ->set('ui_localtask', $form_state
    ->getValue('ui_localtask'));
  $config
    ->set('ui_checkbox', $form_state
    ->getValue('ui_checkbox'));
  $config
    ->set('create_revision', $form_state
    ->getValue('create_revision'));
  $config
    ->set('create_log_entry', $form_state
    ->getValue('create_log_entry'));
  $config
    ->set('publish_text_value', $form_state
    ->getValue('publish_text_value'));
  $config
    ->set('unpublish_text_value', $form_state
    ->getValue('unpublish_text_value'));
  $config
    ->save();
  $this->cacheInvalidator
    ->invalidateTags([
    'local_task',
  ]);
  return parent::submitForm($form, $form_state);
}