SplitText.php in Thunder 8.2
File
modules/thunder_paragraphs/modules/paragraph_split_text/src/Plugin/CKEditorPlugin/SplitText.php
View source
<?php
namespace Drupal\paragraph_split_text\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\editor\Entity\Editor;
class SplitText extends CKEditorPluginBase {
public function getFile() {
return $this
->getLibraryPath() . '/plugin.js';
}
public function getConfig(Editor $editor) {
return [];
}
public function getButtons() {
return [
'SplitTextBefore' => [
'label' => $this
->t('Split Text Before'),
'image' => $this
->getLibraryPath() . '/icons/splittext-before.png',
],
'SplitTextAfter' => [
'label' => $this
->t('Split Text After'),
'image' => $this
->getLibraryPath() . '/icons/splittext-after.png',
],
];
}
protected function getLibraryPath() {
$path = drupal_get_path('module', 'paragraph_split_text') . '/js/plugins/splittext';
return $path;
}
}