You are here

public function PDFPreviewFormatter::settingsSummary in PDFPreview 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldFormatter/PdfPreviewFormatter.php \Drupal\pdfpreview\Plugin\Field\FieldFormatter\PdfPreviewFormatter::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 ImageFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/PDFPreviewFormatter.php, line 133

Class

PDFPreviewFormatter
Plugin implementation of the 'pdfpreview' formatter.

Namespace

Drupal\pdfpreview\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $summary[] = $this
    ->t('Separator tag: @tag', [
    '@tag' => $this
      ->getSetting('tag'),
  ]);
  $summary[] = $this
    ->t('Descriptions: @visibility', [
    '@visibility' => $this
      ->getSetting('show_description') ? $this
      ->t('Visible') : $this
      ->t('Hidden'),
  ]);
  if ($this
    ->getSetting('fallback_formatter')) {
    $summary[] = $this
      ->t('Using the default file formatter for non-PDF files');
  }
  return $summary;
}