You are here

public function MediaElementFieldFormatterTrait::settingsSummary in MediaElement 8

1 call to MediaElementFieldFormatterTrait::settingsSummary()
MediaElementVideoFieldFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/MediaElementVideoFieldFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/MediaElementFieldFormatterTrait.php, line 61

Class

MediaElementFieldFormatterTrait
Common methods for MediaElement.js processing.

Namespace

Drupal\mediaelement\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $for_download = $this->settings['download_link'];
  $preload = $this->settings['preload'];
  $summary[] = $this
    ->t('Provide Download Link: %download', [
    '%download' => $for_download ? $this
      ->t('yes') : $this
      ->t('no'),
  ]);
  if ($for_download) {
    $summary[] = $this
      ->t('Download Link Text: %link_text', [
      '%link_text' => $this->settings['download_text'],
    ]);
  }
  $summary[] = $this
    ->t('Preload: %preload', [
    '%preload' => $preload,
  ]);
  return $summary;
}