You are here

public function LoginDestinationSettingsForm::buildForm in Login Destination 8

Same name and namespace in other branches
  1. 8.2 src/Form/LoginDestinationSettingsForm.php \Drupal\login_destination\Form\LoginDestinationSettingsForm::buildForm()

@inheritdoc

Overrides ConfigFormBase::buildForm

File

src/Form/LoginDestinationSettingsForm.php, line 33

Class

LoginDestinationSettingsForm
Provides form for managing module settings.

Namespace

Drupal\login_destination\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('login_destination.settings');
  $form['settings']['preserve_destination'] = [
    '#type' => 'checkbox',
    '#default_value' => $config
      ->get('preserve_destination'),
    '#title' => $this
      ->t('Preserve the destination parameter'),
    '#description' => $this
      ->t("The 'destination' GET parameter will have priority over the settings of this module. With this setting enabled, redirect from the user login block will not work."),
  ];
  $form['settings']['immediate_redirect'] = [
    '#type' => 'checkbox',
    '#default_value' => $config
      ->get('immediate_redirect'),
    '#title' => $this
      ->t('Redirect immediately after using one-time login link'),
    '#description' => $this
      ->t('User will be redirected before given the possibility to change their password.'),
  ];
  return parent::buildForm($form, $form_state);
}