public function FieldPdfReaderField::settingsSummary in PDF Reader 8
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 FormatterBase::settingsSummary
File
- src/
Plugin/ Field/ FieldFormatter/ FieldPdfReaderField.php, line 144
Class
- FieldPdfReaderField
- Plugin implementation of the 'FieldPdfReaderFields' formatter.
Namespace
Drupal\pdf_reader\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = [];
$displayoptions = $this
->getPdfDisplayOptions();
$summary[] = $this
->t('Size:') . $this
->getSetting('pdf_width') . 'x' . $this
->getSetting('pdf_height');
$summary[] = $this
->t('Direct Embed fit option:') . $this
->getSetting('embed_view_fit');
$summary[] = $this
->t('Using:') . $displayoptions[$this
->getSetting('renderer')];
$is_downloadable = $this
->getSetting('download') ? $this
->t('YES') : $this
->t('NO');
$summary[] = $this
->t('Download Link:') . $is_downloadable;
$summary[] = $this
->t('Direct Embed Hide toolbar:') . $this
->getSetting('embed_hide_toolbar');
return $summary;
}