function FileWidget::settingsForm

Same name in other branches
  1. 8.9.x core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php \Drupal\file\Plugin\Field\FieldWidget\FileWidget::settingsForm()
  2. 10 core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php \Drupal\file\Plugin\Field\FieldWidget\FileWidget::settingsForm()
  3. 11.x core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php \Drupal\file\Plugin\Field\FieldWidget\FileWidget::settingsForm()

Overrides WidgetBase::settingsForm

1 call to FileWidget::settingsForm()
ImageWidget::settingsForm in core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
Returns a form to configure settings for the widget.
1 method overrides FileWidget::settingsForm()
ImageWidget::settingsForm in core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
Returns a form to configure settings for the widget.

File

core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php, line 64

Class

FileWidget
Plugin implementation of the 'file_generic' widget.

Namespace

Drupal\file\Plugin\Field\FieldWidget

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
    $element['progress_indicator'] = [
        '#type' => 'radios',
        '#title' => $this->t('Progress indicator'),
        '#options' => [
            'throbber' => $this->t('Throbber'),
            'bar' => $this->t('Bar with progress meter'),
        ],
        '#default_value' => $this->getSetting('progress_indicator'),
        '#description' => $this->t('The throbber display does not show the status of uploads but takes up less space. The progress bar is helpful for monitoring progress on large uploads.'),
        '#weight' => 16,
        '#access' => file_progress_implementation(),
    ];
    return $element;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.