You are here

public function Thumbnail::settingsSummary in Video Embed Field 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/Thumbnail.php \Drupal\video_embed_field\Plugin\Field\FieldFormatter\Thumbnail::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/Thumbnail.php, line 161

Class

Thumbnail
Plugin implementation of the thumbnail field formatter.

Namespace

Drupal\video_embed_field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $linked = '';
  if (!empty($this
    ->getSetting('link_image_to'))) {
    $linked = $this
      ->getSetting('link_image_to') == static::LINK_CONTENT ? $this
      ->t(', linked to content') : $this
      ->t(', linked to provider');
  }
  $summary[] = $this
    ->t('Video thumbnail (@style@linked).', [
    '@style' => $this
      ->getSetting('image_style') ? $this
      ->getSetting('image_style') : $this
      ->t('no image style'),
    '@linked' => $linked,
  ]);
  return $summary;
}