public function AspectSwitcherImageEffect::getSummary in Image Effects 8
Same name and namespace in other branches
- 8.3 src/Plugin/ImageEffect/AspectSwitcherImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\AspectSwitcherImageEffect::getSummary()
- 8.2 src/Plugin/ImageEffect/AspectSwitcherImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\AspectSwitcherImageEffect::getSummary()
Returns a render array summarizing the configuration of the image effect.
Return value
array A render array.
Overrides ImageEffectBase::getSummary
File
- src/
Plugin/ ImageEffect/ AspectSwitcherImageEffect.php, line 35
Class
- AspectSwitcherImageEffect
- Choose image styles to apply based on source image orientation.
Namespace
Drupal\image_effects\Plugin\ImageEffectCode
public function getSummary() {
$data = $this->configuration;
if ($portrait_image_style = $this
->failSafeGetImageStyle($this->configuration['portrait_image_style'])) {
$data['portrait'] = $portrait_image_style
->label();
}
else {
$data['portrait'] = $this
->t("(none)");
}
if ($landscape_image_style = $this
->failSafeGetImageStyle($this->configuration['landscape_image_style'])) {
$data['landscape'] = $landscape_image_style
->label();
}
else {
$data['landscape'] = $this
->t("(none)");
}
return [
'#theme' => 'image_effects_aspect_switcher',
'#data' => $data,
] + parent::getSummary();
}