You are here

public function LingotekAccountDisconnectForm::submitForm in Lingotek Translation 8

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

File

src/Form/LingotekAccountDisconnectForm.php, line 84
Contains \Drupal\lingotek\Form\LingotekAccountDisconnect.

Class

LingotekAccountDisconnectForm
Provides a form to disconnect from Lingotek.

Namespace

Drupal\lingotek\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->configFactory()
    ->getEditable('lingotek.settings');
  $config
    ->set('account.access_token', NULL);
  $config
    ->set('account.login_id', NULL);
  $config
    ->set('account.callback_url', NULL);
  $config
    ->save();
  $this
    ->logger('lingotek')
    ->notice('Account disconnected from Lingotek.');
  drupal_set_message($this
    ->t('You were disconnected from Lingotek.'));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}