public function PdfPreviewFormatter::settingsSummary in PDFPreview 2.0.x
Same name and namespace in other branches
- 8 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\FieldFormatterCode
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;
}