You are here

public static function AdvancedTextFormatterTokenTree::preRender in Advanced Text Formatter 2.0.x

Same name and namespace in other branches
  1. 2.1.x src/AdvancedTextFormatterTokenTree.php \Drupal\advanced_text_formatter\AdvancedTextFormatterTokenTree::preRender()

Add available tokens link to text_format element.

Parameters

array $element: Form element

Return value

array Form element

File

src/AdvancedTextFormatterTokenTree.php, line 25

Class

AdvancedTextFormatterTokenTree

Namespace

Drupal\advanced_text_formatter

Code

public static function preRender($element) {
  $element['format']['show_token'] = array(
    '#type' => 'container',
    'link' => array(
      '#markup' => _advanced_text_formatter_browse_tokens($element['#entity_type']),
    ),
    '#attributes' => array(
      'class' => array(
        'clearfix',
      ),
    ),
    '#weight' => 99,
  );
  return $element;
}