You are here

public function SvgImageFieldWidget::settingsSummary in SVG Image Field 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/SvgImageFieldWidget.php \Drupal\svg_image_field\Plugin\Field\FieldWidget\SvgImageFieldWidget::settingsSummary()
  2. 2.1.x src/Plugin/Field/FieldWidget/SvgImageFieldWidget.php \Drupal\svg_image_field\Plugin\Field\FieldWidget\SvgImageFieldWidget::settingsSummary()

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides FileWidget::settingsSummary

File

src/Plugin/Field/FieldWidget/SvgImageFieldWidget.php, line 104

Class

SvgImageFieldWidget
Plugin implementation of the 'image_image' widget.

Namespace

Drupal\svg_image_field\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $preview_image_max_width = t('Preview image width: @width', [
    '@width' => $this
      ->getSetting('preview_image_max_width'),
  ]);
  $preview_image_max_height = t('Preview image height: @height', [
    '@height' => $this
      ->getSetting('preview_image_max_height'),
  ]);
  array_unshift($summary, $preview_image_max_width);
  array_unshift($summary, $preview_image_max_height);
  return $summary;
}