class AdvancedTextFormatterTokenTree in Advanced Text Formatter 2.1.x
Same name and namespace in other branches
- 2.0.x src/AdvancedTextFormatterTokenTree.php \Drupal\advanced_text_formatter\AdvancedTextFormatterTokenTree
Hierarchy
- class \Drupal\advanced_text_formatter\AdvancedTextFormatterTokenTree implements TrustedCallbackInterface
Expanded class hierarchy of AdvancedTextFormatterTokenTree
1 file declares its use of AdvancedTextFormatterTokenTree
- advanced_text_formatter.module in ./
advanced_text_formatter.module - Advanced Text Formatter
File
- src/
AdvancedTextFormatterTokenTree.php, line 7
Namespace
Drupal\advanced_text_formatterView source
class AdvancedTextFormatterTokenTree implements TrustedCallbackInterface {
/**
* {@inheritdoc}
*/
public static function trustedCallbacks() {
return [
'preRender',
];
}
/**
* Add available tokens link to text_format element.
*
* @param array $element
* Form element
*
* @return array
* Form element
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdvancedTextFormatterTokenTree:: |
public static | function | Add available tokens link to text_format element. | |
AdvancedTextFormatterTokenTree:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |