You are here

public function ImageWidget::settingsForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php \Drupal\image\Plugin\Field\FieldWidget\ImageWidget::settingsForm()
  2. 9 core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php \Drupal\image\Plugin\Field\FieldWidget\ImageWidget::settingsForm()

File

core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php, line 70

Class

ImageWidget
Plugin implementation of the 'image_image' widget.

Namespace

Drupal\image\Plugin\Field\FieldWidget

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $element = parent::settingsForm($form, $form_state);
  $element['preview_image_style'] = [
    '#title' => t('Preview image style'),
    '#type' => 'select',
    '#options' => image_style_options(FALSE),
    '#empty_option' => '<' . t('no preview') . '>',
    '#default_value' => $this
      ->getSetting('preview_image_style'),
    '#description' => t('The preview image will be shown while editing the content.'),
    '#weight' => 15,
  ];
  return $element;
}