protected function ImageFormatter::presentationLabel in Facebook Instant Articles 8.2
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldFormatter/ImageFormatter.php \Drupal\fb_instant_articles\Plugin\Field\FieldFormatter\ImageFormatter::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 ImageFormatter::presentationLabel()
- ImageFormatter::settingsForm in src/
Plugin/ Field/ FieldFormatter/ ImageFormatter.php - Returns a form to configure settings for the formatter.
- ImageFormatter::settingsSummary in src/
Plugin/ Field/ FieldFormatter/ ImageFormatter.php - Returns a short summary for the current formatter settings.
File
- src/
Plugin/ Field/ FieldFormatter/ ImageFormatter.php, line 206
Class
- ImageFormatter
- Plugin implementation of the 'fbia_image' formatter.
Namespace
Drupal\fb_instant_articles\Plugin\Field\FieldFormatterCode
protected function presentationLabel($presentation) {
switch ($presentation) {
case Image::ASPECT_FIT:
$label = $this
->t('Fit');
break;
case Image::ASPECT_FIT_ONLY:
$label = $this
->t('Fit only');
break;
case Image::FULLSCREEN:
$label = $this
->t('Fullscreen');
break;
case Image::NON_INTERACTIVE:
$label = $this
->t('Non-interactive');
break;
default:
$label = $this
->t('None');
break;
}
return $label;
}