You are here

public function ImageZoomFormatter::settingsSummary in Image Zoom 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldFormatter/ImageZoomFormatter.php \Drupal\imagezoom\Plugin\Field\FieldFormatter\ImageZoomFormatter::settingsSummary()

Returns a short summary for the current formatter settings.

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

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

1 call to ImageZoomFormatter::settingsSummary()
ImageZoomGalleryFormatter::settingsSummary in modules/imagezoom_gallery/src/Plugin/Field/FieldFormatter/ImageZoomGalleryFormatter.php
Returns a short summary for the current formatter settings.
1 method overrides ImageZoomFormatter::settingsSummary()
ImageZoomGalleryFormatter::settingsSummary in modules/imagezoom_gallery/src/Plugin/Field/FieldFormatter/ImageZoomGalleryFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/ImageZoomFormatter.php, line 179

Class

ImageZoomFormatter
Image Zoom field formatter for Image fields.

Namespace

Drupal\imagezoom\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $zoom_types = $this
    ->zoomTypes();
  $summary[] = $this
    ->t('Zoom type: @type', [
    '@type' => $zoom_types[$this
      ->getSetting('imagezoom_zoom_type')],
  ]);
  $image_styles = image_style_options(FALSE);
  unset($image_styles['']);
  $summary[] = $this
    ->t('Display image style: @style', [
    '@style' => isset($image_styles[$this
      ->getSetting('imagezoom_display_style')]) ? $image_styles[$this
      ->getSetting('imagezoom_display_style')] : 'original',
  ]);
  $summary[] = $this
    ->t('Zoomed image style: @style', [
    '@style' => isset($image_styles[$this
      ->getSetting('imagezoom_zoom_style')]) ? $image_styles[$this
      ->getSetting('imagezoom_zoom_style')] : 'original',
  ]);
  return $summary;
}