You are here

protected function FormatterTrait::buildSettingsSummary in Image Hover Effects 8

2 calls to FormatterTrait::buildSettingsSummary()
ImageFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/ImageFormatter.php
Returns a short summary for the current formatter settings.
ResponsiveImageFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/FormatterTrait.php, line 45

Class

FormatterTrait
Helper methods for image formatters.

Namespace

Drupal\image_hover_effects\Plugin\Field\FieldFormatter

Code

protected function buildSettingsSummary() {
  $settings = $this
    ->getSettings();
  $summary = [];
  $image_link = $settings['image_link'];
  if ($image_link) {
    if ($settings['hover_effect']) {
      $effects = self::getEffects();
      $summary[] = t('Hover effect: %effect', [
        '%effect' => $effects[$settings['hover_effect']],
      ]);
    }
    $summary[] = t('Hover text: %text', [
      '%text' => $settings['hover_text'],
    ]);
  }
  return $summary;
}