You are here

public function OnomasticonExcludeCkeditorButton::getButtons in Onomasticon 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/CKEditorPlugin/OnomasticonExcludeCkeditorButton.php \Drupal\onomasticon\Plugin\CKEditorPlugin\OnomasticonExcludeCkeditorButton::getButtons()

NOTE: The keys of the returned array corresponds to the CKEditor button names. They are the first argument of the editor.ui.addButton() or editor.ui.addRichCombo() functions in the plugin.js file.

Overrides CKEditorPluginButtonsInterface::getButtons

File

src/Plugin/CKEditorPlugin/OnomasticonExcludeCkeditorButton.php, line 29

Class

OnomasticonExcludeCkeditorButton
Defines the Onomasticon Exclude (Nonomasticon) plugin.

Namespace

Drupal\onomasticon\Plugin\CKEditorPlugin

Code

public function getButtons() {

  // Make sure that the path to the image matches the file structure of
  // the CKEditor plugin you are implementing.
  $path = drupal_get_path('module', 'onomasticon') . '/js/plugins/nonomasticon';
  return [
    'nonomasticon' => [
      'label' => $this
        ->t('NOnomasticon'),
      'image' => $path . '/icons/nonomasticon.png',
    ],
  ];
}