You are here

public function Core::getButtons in BUEditor 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/BUEditorPlugin/Core.php \Drupal\bueditor\Plugin\BUEditorPlugin\Core::getButtons()

Returns plugin buttons.

Return value

array An array of id:label pairs.

Overrides BUEditorPluginBase::getButtons

File

src/Plugin/BUEditorPlugin/Core.php, line 25

Class

Core
Defines BUEditor Core plugin.

Namespace

Drupal\bueditor\Plugin\BUEditorPlugin

Code

public function getButtons() {

  // Buttons in core library
  $buttons = [
    '-' => $this
      ->t('Separator'),
    '/' => $this
      ->t('New line'),
    'bold' => $this
      ->t('Bold'),
    'italic' => $this
      ->t('Italic'),
    'underline' => $this
      ->t('Underline'),
    'strike' => $this
      ->t('Strikethrough'),
    'quote' => $this
      ->t('Quote'),
    'code' => $this
      ->t('Code'),
    'ul' => $this
      ->t('Bulleted list'),
    'ol' => $this
      ->t('Numbered list'),
    'link' => $this
      ->t('Link'),
    'image' => $this
      ->t('Image'),
    'undo' => $this
      ->t('Undo'),
    'redo' => $this
      ->t('Redo'),
  ];
  for ($i = 1; $i < 7; $i++) {
    $buttons['h' . $i] = $this
      ->t('Heading @n', [
      '@n' => $i,
    ]);
  }
  return $buttons;
}