AdvancedTextFormatterTokenTree.php in Advanced Text Formatter 2.1.x
File
src/AdvancedTextFormatterTokenTree.php
View source
<?php
namespace Drupal\advanced_text_formatter;
use Drupal\Core\Security\TrustedCallbackInterface;
class AdvancedTextFormatterTokenTree implements TrustedCallbackInterface {
public static function trustedCallbacks() {
return [
'preRender',
];
}
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;
}
}