You are here

public function super_loginSettingsForm::submitForm in Super Login 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/Super_loginSettingsForm.php, line 180

Class

super_loginSettingsForm
Configure Super Login settings for this site.

Namespace

Drupal\super_login

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('super_login.settings');
  $config
    ->set('super_login.login_text', $form_state
    ->getValue('login_text'));
  $config
    ->set('super_login.forgot_pw_text', $form_state
    ->getValue('forgot_pw_text'));
  $config
    ->set('super_login.capslock_msg', $form_state
    ->getValue('capslock_msg'));
  $config
    ->set('super_login.new_account_text', $form_state
    ->getValue('new_account_text'));
  $config
    ->set('super_login.login_title', $form_state
    ->getValue('login_title'));
  $config
    ->set('super_login.password_reset_title', $form_state
    ->getValue('password_reset_title'));
  $config
    ->set('super_login.back_link', $form_state
    ->getValue('back_link'));
  $config
    ->set('super_login.css', $form_state
    ->getValue('css'));
  $config
    ->set('super_login.messages', $form_state
    ->getValue('messages'));
  $config
    ->set('super_login.button_theme', $form_state
    ->getValue('button_theme'));
  $config
    ->set('super_login.capslock', $form_state
    ->getValue('capslock'));
  $config
    ->set('super_login.placeholder', $form_state
    ->getValue('placeholder'));
  $config
    ->set('super_login.login_type', $form_state
    ->getValue('login_type'));
  $config
    ->set('super_login.login_placeholder', $form_state
    ->getValue('login_placeholder'));
  $config
    ->set('super_login.pass_placeholder', $form_state
    ->getValue('pass_placeholder'));
  $config
    ->set('super_login.autofocus', $form_state
    ->getValue('autofocus'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
  $module_data = \Drupal::service('extension.list.module')
    ->reset()
    ->getList();
}