You are here

public function MagnificPopup::settingsSummary in Magnific Popup 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/MagnificPopup.php \Drupal\magnific_popup\Plugin\Field\FieldFormatter\MagnificPopup::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

File

src/Plugin/Field/FieldFormatter/MagnificPopup.php, line 80

Class

MagnificPopup
Magnific Popup field formatter.

Namespace

Drupal\magnific_popup\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $image_styles = image_style_options(FALSE);
  $thumb_image_style = $this
    ->getSetting('thumbnail_image_style');
  $popup_image_style = $this
    ->getSetting('popup_image_style');

  // Check image styles exist or display 'Original Image'.
  $summary[] = $this
    ->t('Thumbnail image style: @thumb_style. Popup image style: @popup_style', [
    '@thumb_style' => isset($image_styles[$thumb_image_style]) ? $thumb_image_style : 'Original Image',
    '@popup_style' => isset($image_styles[$popup_image_style]) ? $popup_image_style : 'Original Image',
  ]);
  return $summary;
}