Btbutton.php in CKEditor Bootstrap Buttons 2.0.x
File
src/Plugin/CKEditorPlugin/Btbutton.php
View source
<?php
namespace Drupal\ckeditor_bootstrap_buttons\Plugin\CKEditorPlugin;
use Drupal\editor\Entity\Editor;
use Drupal\ckeditor\CKEditorPluginBase;
class Btbutton extends CKEditorPluginBase {
public function getLibraryPath() {
if (\Drupal::moduleHandler()
->moduleExists('libraries')) {
return libraries_get_path('btbutton');
}
else {
return 'libraries/btbutton';
}
}
public function getFile() {
return $this
->getLibraryPath() . '/plugin.js';
}
public function getLibraries(Editor $editor) {
return [];
}
public function isInternal() {
return FALSE;
}
public function getButtons() {
return [
'btbutton' => [
'label' => $this
->t('Bootstrap Buttons'),
'image' => $this
->getLibraryPath() . '/icons/btbutton.png',
],
];
}
public function getConfig(Editor $editor) {
return [];
}
}