You are here

public function ContactFormDisableForm::buildForm in Contact Storage 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 EntityConfirmFormBase::buildForm

File

src/Form/ContactFormDisableForm.php, line 45

Class

ContactFormDisableForm
Provides the contact form disable form.

Namespace

Drupal\contact_storage\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $form['contact_storage_disabled_form_message'] = [
    '#type' => 'textfield',
    '#title' => t('Default disabled contact form message'),
    '#description' => t('Default message to display if the contact form is disabled. It will be saved when clicking "Disable".'),
    '#default_value' => $this
      ->getEntity()
      ->getThirdPartySetting('contact_storage', 'disabled_form_message', $this
      ->t('This contact form has been disabled.')),
  ];
  return $form;
}