You are here

public function FieldPdfReaderField::getPdfDisplayOptions in PDF Reader 8

Callback function to return PDF display options.

2 calls to FieldPdfReaderField::getPdfDisplayOptions()
FieldPdfReaderField::settingsForm in src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
Returns a form to configure settings for the formatter.
FieldPdfReaderField::settingsSummary in src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php, line 46

Class

FieldPdfReaderField
Plugin implementation of the 'FieldPdfReaderFields' formatter.

Namespace

Drupal\pdf_reader\Plugin\Field\FieldFormatter

Code

public function getPdfDisplayOptions() {
  $this->displayOptions = [
    'google' => $this
      ->t('Google Viewer'),
    'ms' => $this
      ->t('MS Viewer'),
    'embed' => $this
      ->t('Direct Embed'),
    'pdf-js' => $this
      ->t('pdf.js'),
  ];
  if ($this
    ->isColorboxInstalled()) {
    $this->displayOptions['colorbox'] = $this
      ->t('Colorbox');
  }
  return $this->displayOptions;
}