You are here

public function DownloadLinkFieldFormatter::settingsSummary in Media Entity Download 8.2

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 LinkFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/DownloadLinkFieldFormatter.php, line 59

Class

DownloadLinkFieldFormatter
Plugin implementation of the 'media_entity_download_download_link' formatter.

Namespace

Drupal\media_entity_download\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $settings = $this
    ->getSettings();
  if ($settings['disposition'] == ResponseHeaderBag::DISPOSITION_ATTACHMENT) {
    $summary[] = $this
      ->t('Force "Save as..." dialog');
  }
  return $summary;
}