You are here

public function QaAccountsSettingsForm::buildForm in QA Accounts 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/QaAccountsSettingsForm.php, line 30

Class

QaAccountsSettingsForm
Configuration form for QA Accounts.

Namespace

Drupal\qa_accounts\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('qa_accounts.settings');
  $form['auto_create_user_per_new_role'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Automatically create QA user when role is created'),
    '#default_value' => $config
      ->get('auto_create_user_per_new_role'),
    '#description' => $this
      ->t('Checking this box will automatically create a QA user for newly created role.'),
  ];
  $form['auto_delete_user_per_deleted_role'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Automatically delete QA user when role is deleted'),
    '#default_value' => $config
      ->get('auto_delete_user_per_deleted_role'),
    '#description' => $this
      ->t('Checking this box will automatically delete a QA user when corresponding role deleted.'),
  ];
  return parent::buildForm($form, $form_state);
}