OliveroPreRender.php in Drupal 9
File
core/themes/olivero/src/OliveroPreRender.php
View source
<?php
namespace Drupal\olivero;
use Drupal\Core\Security\TrustedCallbackInterface;
class OliveroPreRender implements TrustedCallbackInterface {
public static function textFormat($element) {
$element['format']['#attributes']['class'][] = 'filter-wrapper';
$element['format']['format']['#wrapper_attributes']['class'][] = 'form-item--editor-format';
$element['format']['format']['#attributes']['class'][] = 'filter-list';
$element['format']['format']['#attributes']['class'][] = 'form-element--small';
$element['format']['format']['#attributes']['class'][] = 'form-element--editor-format';
$element['format']['guidelines']['#attributes']['class'][] = 'filter-guidelines';
$element['format']['help']['#attributes']['class'][] = 'filter-help';
return $element;
}
public static function messagePlaceholder(array $element) {
if (isset($element['fallback']['#markup'])) {
$element['fallback']['#markup'] = '<div data-drupal-messages-fallback class="hidden messages-list"></div>';
}
return $element;
}
public static function trustedCallbacks() {
return [
'textFormat',
'messagePlaceholder',
];
}
}