You are here

public function WebformEmailConfirm::form in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformEmailConfirm.php \Drupal\webform\Plugin\WebformElement\WebformEmailConfirm::form()

Gets the actual configuration webform array to be built.

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 An associative array contain the element's configuration webform without any default values.

Overrides TextBase::form

File

src/Plugin/WebformElement/WebformEmailConfirm.php, line 68

Class

WebformEmailConfirm
Provides a 'email_confirm' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);
  $form['email_confirm'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Email confirm settings'),
  ];
  $form['email_confirm']['confirm__title'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Email confirm title'),
  ];
  $form['email_confirm']['confirm__description'] = [
    '#type' => 'webform_html_editor',
    '#title' => $this
      ->t('Email confirm description'),
  ];
  $form['email_confirm']['confirm__placeholder'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Email confirm placeholder'),
  ];
  $form['email_confirm']['flexbox'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Use Flexbox'),
    '#description' => $this
      ->t("If 'Automatic' is selected Flexbox layout will only be used if a 'Flexbox layout' element is included in the webform."),
    '#options' => [
      '' => $this
        ->t('Automatic'),
      0 => $this
        ->t('No'),
      1 => $this
        ->t('Yes'),
    ],
  ];
  $form['form']['display_container']['title_display']['#options'] = [
    'before' => $this
      ->t('Before'),
    'after' => $this
      ->t('After'),
    'inline' => $this
      ->t('Inline'),
    'invisible' => $this
      ->t('Invisible'),
    'none' => $this
      ->t('None'),
  ];
  return $form;
}