You are here

public function LingotekSettingsTabProfilesEditForm::submitForm in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  2. 8.2 src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  3. 4.0.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  4. 3.0.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  5. 3.1.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  6. 3.2.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  7. 3.3.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  8. 3.5.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  9. 3.6.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  10. 3.7.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::submitForm()
  11. 3.8.x src/Form/LingotekSettingsTabProfilesEditForm.php \Drupal\lingotek\Form\LingotekSettingsTabProfilesEditForm::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

src/Form/LingotekSettingsTabProfilesEditForm.php, line 134

Class

LingotekSettingsTabProfilesEditForm
Configure Lingotek

Namespace

Drupal\lingotek\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $form_values = $form_state
    ->getValues();

  // Save a new profile
  if (!$this->profile) {
    $this
      ->saveNewProfile(strtolower($form_values['name']), $form_values['auto_upload'], $form_values['auto_download'], $form_values['auto_upload_worker']);
  }
  elseif ($this->is_custom_id) {
    $this
      ->updateCustomProfile(strtolower($form_values['name']), $form_values['auto_upload'], $form_values['auto_download'], $form_values['auto_upload_worker']);
  }
  $config = \Drupal::configFactory()
    ->getEditable('lingotek.settings');
  $config
    ->set('default.vault', $form_values['vault']);
  $config
    ->save();
  $form_state
    ->setRedirect('lingotek.settings');
  parent::submitForm($form, $form_state);
}