You are here

protected function WebformEntitySettingsFormForm::getFormBehaviors in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/EntitySettings/WebformEntitySettingsFormForm.php \Drupal\webform\EntitySettings\WebformEntitySettingsFormForm::getFormBehaviors()

Get form behaviors.

Return value

array An associative array containing form behaviors.

2 calls to WebformEntitySettingsFormForm::getFormBehaviors()
WebformEntitySettingsFormForm::form in src/EntitySettings/WebformEntitySettingsFormForm.php
Gets the actual form array to be built.
WebformEntitySettingsFormForm::save in src/EntitySettings/WebformEntitySettingsFormForm.php
Form submission handler for the 'save' action.

File

src/EntitySettings/WebformEntitySettingsFormForm.php, line 796

Class

WebformEntitySettingsFormForm
Webform form settings.

Namespace

Drupal\webform\EntitySettings

Code

protected function getFormBehaviors() {
  return [
    // Form.
    'form_reset' => [
      'group' => $this
        ->t('Form'),
      'title' => $this
        ->t('Display reset button'),
      'form_description' => $this
        ->t("If checked, users will be able to reset a form and restart multi-step wizards. Current drafts will be deleted when the form is reset."),
    ],
    'form_submit_once' => [
      'group' => $this
        ->t('Form'),
      'title' => $this
        ->t('Prevent duplicate submissions'),
      'all_description' => $this
        ->t('Submit button is disabled immediately after it is clicked for all forms.'),
      'form_description' => $this
        ->t('If checked, the submit button will be disabled immediately after it is clicked.'),
    ],
    // Navigation.
    'form_disable_back' => [
      'group' => $this
        ->t('Navigation'),
      'title' => $this
        ->t('Disable back button'),
      'all_description' => $this
        ->t('Back button is disabled for all forms.'),
      'form_description' => $this
        ->t("If checked, users will not be allowed to navigate back to the form using the browser's back button."),
    ],
    'form_submit_back' => [
      'group' => $this
        ->t('Navigation'),
      'title' => $this
        ->t('Submit previous page when browser back button is clicked'),
      'all_description' => $this
        ->t('Browser back button submits the previous page for all forms.'),
      'form_description' => $this
        ->t("If checked, the browser back button will submit the previous page and navigate back emulating the behaviour of user clicking a wizard or preview page's back button."),
    ],
    'form_unsaved' => [
      'group' => $this
        ->t('Navigation'),
      'title' => $this
        ->t('Warn users about unsaved changes'),
      'all_description' => $this
        ->t('Unsaved warning is enabled for all forms.'),
      'form_description' => $this
        ->t('If checked, users will be displayed a warning message when they navigate away from a form with unsaved changes.'),
    ],
    // Validation.
    'form_novalidate' => [
      'group' => $this
        ->t('Validation'),
      'title' => $this
        ->t('Disable client-side validation'),
      'all_description' => $this
        ->t('Client-side validation is disabled for all forms.'),
      'form_description' => $this
        ->t('If checked, the <a href=":href">novalidate</a> attribute, which disables client-side validation, will be added to this form.', [
        ':href' => 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form',
      ]),
    ],
    'form_disable_inline_errors' => [
      'group' => $this
        ->t('Validation'),
      'title' => $this
        ->t('Disable inline form errors'),
      'all_description' => $this
        ->t('Inline form errors is disabled for all forms.'),
      'form_description' => $this
        ->t('If checked, <a href=":href">inline form errors</a> will be disabled for this form.', [
        ':href' => 'https://www.drupal.org/docs/8/core/modules/inline-form-errors/inline-form-errors-module-overview',
      ]),
    ],
    'form_required' => [
      'group' => $this
        ->t('Validation'),
      'title' => $this
        ->t('Display required indicator'),
      'all_description' => $this
        ->t('Required indicator is displayed on all forms.'),
      'form_description' => $this
        ->t('If checked, a required elements indicator will be added to this webform.'),
    ],
    // Elements.
    'form_autofocus' => [
      'group' => $this
        ->t('Elements'),
      'title' => $this
        ->t('Autofocus the first element'),
      'form_description' => $this
        ->t('If checked, the first visible and enabled form element will be focused when adding a new submission.'),
    ],
    'form_disable_autocomplete' => [
      'group' => $this
        ->t('Elements'),
      'title' => $this
        ->t('Disable autocompletion'),
      'form_description' => $this
        ->t('If checked, the <a href=":href">autocomplete</a> attribute will be set to off, which disables autocompletion for all form elements.', [
        ':href' => 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form',
      ]),
    ],
    'form_details_toggle' => [
      'group' => $this
        ->t('Elements'),
      'title' => $this
        ->t('Display collapse/expand all details link'),
      'all_description' => $this
        ->t('Expand/collapse all (details) link is automatically added to all forms.'),
      'form_description' => $this
        ->t('If checked, an expand/collapse all (details) link will be added to this webform when there are two or more details elements available on the webform.'),
    ],
    // Prepopulate.
    'form_prepopulate' => [
      'group' => $this
        ->t('Prepopulate'),
      'title' => $this
        ->t('Allow all elements to be populated using query string parameters'),
      'form_description' => $this
        ->t("If checked, all elements can be populated using query string parameters. For example, appending ?name=John+Smith to a webform's URL would set the 'name' element's default value to 'John Smith'. Please note that individual elements can also have prepopulation enabled."),
    ],
    'form_prepopulate_source_entity' => [
      'group' => $this
        ->t('Prepopulate'),
      'title' => $this
        ->t('Allow source entity to be populated using query string parameters'),
      'form_description' => $this
        ->t("If checked, source entity can be populated using query string parameters. For example, appending ?source_entity_type=node&source_entity_id=1 to a webform's URL would set a submission's 'Submitted to' value to 'node:1'."),
    ],
    'form_prepopulate_source_entity_required' => [
      'group' => $this
        ->t('Prepopulate'),
      'title' => $this
        ->t('Require source entity to be populated using query string parameters'),
      'form_description' => $this
        ->t("If checked, source entity must be populated using query string parameters."),
    ],
  ];
}