4 * Contains \Drupal\bootstrap\Plugin\Process\TextFormat.
7 namespace Drupal\bootstrap\Plugin\Process;
9 use Drupal\bootstrap\Annotation\BootstrapProcess;
10 use Drupal\bootstrap\Bootstrap;
11 use Drupal\bootstrap\Utility\Element;
12 use Drupal\Core\Form\FormStateInterface;
15 * Processes the "text_format" element.
17 * @ingroup plugins_process
19 * @BootstrapProcess("text_format")
21 * @see \Drupal\filter\Element\TextFormat::processFormat()
23 class TextFormat extends ProcessBase implements ProcessInterface {
28 public static function processElement(Element $element, FormStateInterface $form_state, array &$complete_form) {
29 if (isset($element->format)) {
30 $element->format->addClass('form-inline');
32 // Guidelines (removed).
33 $element->format->guidelines->setProperty('access', FALSE);
36 $element->format->format
37 ->addClass('input-sm')
38 ->setProperty('title_display', 'invisible')
39 ->setProperty('weight', -10);
42 $element->format->help->about
43 ->setAttribute('title', t('Opens in new window'))
44 ->setProperty('icon', Bootstrap::glyphicon('question-sign'));
45 if (Bootstrap::getTheme()->getSetting('tooltip_enabled')) {
46 $element->format->help->about->setAttribute('data-toggle', 'tooltip');