protected function VideoFormatter::presentationLabel in Facebook Instant Articles 8.2
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldFormatter/VideoFormatter.php \Drupal\fb_instant_articles\Plugin\Field\FieldFormatter\VideoFormatter::presentationLabel()
Given a presentation machine name, return the label.
Parameters
string $presentation: Presentation type name.
Return value
\Drupal\Core\StringTranslation\TranslatableMarkup String label.
2 calls to VideoFormatter::presentationLabel()
- VideoFormatter::settingsForm in src/
Plugin/ Field/ FieldFormatter/ VideoFormatter.php - Returns a form to configure settings for the formatter.
- VideoFormatter::settingsSummary in src/
Plugin/ Field/ FieldFormatter/ VideoFormatter.php - Returns a short summary for the current formatter settings.
File
- src/
Plugin/ Field/ FieldFormatter/ VideoFormatter.php, line 216
Class
- VideoFormatter
- Plugin implementation of the 'fbia_video' formatter.
Namespace
Drupal\fb_instant_articles\Plugin\Field\FieldFormatterCode
protected function presentationLabel($presentation) {
switch ($presentation) {
case Video::ASPECT_FIT:
$label = $this
->t('Fit');
break;
case Video::ASPECT_FIT_ONLY:
$label = $this
->t('Fit only');
break;
case Video::FULLSCREEN:
$label = $this
->t('Fullscreen');
break;
case Video::NON_INTERACTIVE:
$label = $this
->t('Non-interactive');
break;
default:
$label = $this
->t('None');
break;
}
return $label;
}