DetailPlugin.php in CKeditor Details Accordion 8
File
src/Plugin/CKEditorPlugin/DetailPlugin.php
View source
<?php
namespace Drupal\ckeditor_details\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginInterface;
use Drupal\ckeditor\CKEditorPluginButtonsInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\editor\Entity\Editor;
class DetailPlugin extends PluginBase implements CKEditorPluginInterface, CKEditorPluginButtonsInterface {
public function getDependencies(Editor $editor) {
return [];
}
public function getLibraries(Editor $editor) {
return [
'core/drupal.jquery',
];
}
public function isInternal() {
return FALSE;
}
public function getConfig(Editor $editor) {
return [];
}
public function getButtons() {
return [
'detail' => [
'label' => t('Add accordion'),
'image' => drupal_get_path('module', 'ckeditor_details') . '/js/plugins/detail/icons/detail.png',
],
];
}
public function getFile() {
return drupal_get_path('module', 'ckeditor_details') . '/js/plugins/detail/plugin.js';
}
}