You are here

public function XPreview::alterToolbarWidget in BUEditor 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/BUEditorPlugin/XPreview.php \Drupal\bueditor\Plugin\BUEditorPlugin\XPreview::alterToolbarWidget()

Alters the toolbar widget used in BUEditor Editor form.

Parameters

array $widget: An associative array that holds 'libraries' and 'items' in it.

Overrides BUEditorPluginBase::alterToolbarWidget

File

src/Plugin/BUEditorPlugin/XPreview.php, line 51

Class

XPreview
Defines BUEditor Ajax Preview plugin.

Namespace

Drupal\bueditor\Plugin\BUEditorPlugin

Code

public function alterToolbarWidget(array &$widget) {

  // Make xpreview definition available to toolbar widget
  $widget['libraries'][] = 'bueditor/drupal.bueditor.xpreview';

  // Add a tooltip
  $widget['items']['xpreview']['tooltip'] = $this
    ->t('Requires ajax preview permission.');
}