You are here

function paragraphs_ee_preprocess_input__submit__paragraphs_action__image in Paragraphs Editor Enhancements 8

Prepare variables used in input--submit--paragraphs_action--image.html.twig.

File

./paragraphs_ee.module, line 327
Main functions for "Paragraphs Editor Enhancements" module.

Code

function paragraphs_ee_preprocess_input__submit__paragraphs_action__image(&$vars) {
  $element = $vars['element'];

  // Add title and description as custom element.
  $vars['title'] = $element['#value'];
  $vars['description'] = $element['#description'];
  $vars['description_id'] = empty($vars['attributes']['aria-describedby']) ? NULL : $vars['attributes']['aria-describedby'];
  $icon_attributes = $element['#icon_attributes'];
  if (!empty($element['#icon'])) {
    $icon_attributes['style'] = 'background-image: url("' . $element['#icon'] . '");';
  }
  $vars['icon_attributes'] = $icon_attributes;
}