You are here

public function SettingsForm::buildForm in Bibliography & Citation 8

Same name in this branch
  1. 8 src/Form/SettingsForm.php \Drupal\bibcite\Form\SettingsForm::buildForm()
  2. 8 modules/bibcite_import/src/Form/SettingsForm.php \Drupal\bibcite_import\Form\SettingsForm::buildForm()
Same name and namespace in other branches
  1. 2.0.x modules/bibcite_import/src/Form/SettingsForm.php \Drupal\bibcite_import\Form\SettingsForm::buildForm()

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

modules/bibcite_import/src/Form/SettingsForm.php, line 30

Class

SettingsForm
Module settings form.

Namespace

Drupal\bibcite_import\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('bibcite_import.settings');
  $form['contributor_deduplication'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable Contributor deduplication'),
    '#default_value' => $config
      ->get('settings.contributor_deduplication'),
  ];
  $form['keyword_deduplication'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable Keyword deduplication'),
    '#default_value' => $config
      ->get('settings.keyword_deduplication'),
  ];
  return parent::buildForm($form, $form_state);
}