You are here

public function TextOverlayImageEffect::getSummary in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageEffect/TextOverlayImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\TextOverlayImageEffect::getSummary()
  2. 8.2 src/Plugin/ImageEffect/TextOverlayImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\TextOverlayImageEffect::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/TextOverlayImageEffect.php, line 733

Class

TextOverlayImageEffect
Overlays text on the image, defining text font, size and positioning.

Namespace

Drupal\image_effects\Plugin\ImageEffect

Code

public function getSummary() {
  $data = $this->configuration;
  $data['font_color_detail'] = [
    '#theme' => 'image_effects_color_detail',
    '#color' => $data['font']['color'],
    '#border' => TRUE,
    '#border_color' => 'matchLuma',
  ];
  if ($stroke_mode = $this
    ->strokeMode()) {
    $data['stroke_mode'] = $stroke_mode;
    $data['stroke_color_detail'] = [
      '#theme' => 'image_effects_color_detail',
      '#color' => $data['font']['stroke_color'],
      '#border' => TRUE,
      '#border_color' => 'matchLuma',
    ];
  }
  if ($data['layout']['background_color']) {
    $data['background_color_detail'] = [
      '#theme' => 'image_effects_color_detail',
      '#color' => $data['layout']['background_color'],
      '#border' => TRUE,
      '#border_color' => 'matchLuma',
    ];
  }
  return [
    '#theme' => 'image_effects_text_overlay_summary',
    '#data' => $data,
  ] + parent::getSummary();
}