You are here

public function SettingsForm::submitForm in Translation Management Tool 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/SettingsForm.php, line 121

Class

SettingsForm
Configure tmgmt settings.

Namespace

Drupal\tmgmt\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('tmgmt.settings')
    ->set('quick_checkout', $form_state
    ->getValue('tmgmt_quick_checkout'))
    ->set('purge_finished', $form_state
    ->getValue('tmgmt_purge_finished'))
    ->set('anonymous_access', $form_state
    ->getValue('tmgmt_anonymous_access'))
    ->set('respect_text_format', $form_state
    ->getValue('respect_text_format'))
    ->set('allowed_formats', array_keys(array_filter($form_state
    ->getValue('allowed_formats'))))
    ->set('submit_job_item_on_cron', $form_state
    ->getValue('tmgmt_submit_job_item_on_cron'))
    ->set('job_items_cron_limit', $form_state
    ->getValue('job_items_cron_limit'))
    ->save();
  parent::submitForm($form, $form_state);
}