public function SpamicideSettingsForm::buildForm in Spamicide 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/ SpamicideSettingsForm.php, line 30
Class
- SpamicideSettingsForm
- Configure Spamicide settings for this site.
Namespace
Drupal\spamicide\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['spamicide_admin_mode'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Add Spamicide administration links to forms'),
'#default_value' => $this
->config('spamicide.settings')
->get('spamicide_admin_mode'),
'#description' => $this
->t('This option makes it easy to manage Spamicide settings on forms. When enabled, users with the administer Spamicide settings permission will see a fieldset with Spamicide administration links on all forms, except on administrative pages.'),
];
$form['spamicide_log_attempts'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Log wrong responses'),
'#default_value' => $this
->config('spamicide.settings')
->get('spamicide_log_attempts'),
'#description' => $this
->t('Report information about wrong responses to the log.'),
];
return parent::buildForm($form, $form_state);
}