EntityLink.php in CKEditor Entity Link 8
File
src/Plugin/CKEditorPlugin/EntityLink.php
View source
<?php
namespace Drupal\ckeditor_entity_link\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\editor\Entity\Editor;
class EntityLink extends CKEditorPluginBase {
public function getFile() {
return drupal_get_path('module', 'ckeditor_entity_link') . '/js/plugins/entitylink/plugin.js';
}
public function getLibraries(Editor $editor) {
return [
'core/drupal.ajax',
];
}
public function getConfig(Editor $editor) {
return [
'EntityLink_dialogTitleAdd' => $this
->t('Add Link'),
'EntityLink_dialogTitleEdit' => $this
->t('Edit Link'),
];
}
public function getButtons() {
$path = drupal_get_path('module', 'ckeditor_entity_link') . '/js/plugins/entitylink';
return [
'EntityLink' => [
'label' => $this
->t('Link'),
'image' => $path . '/link.png',
],
];
}
}