AnchorLink.php in CKEditor Anchor Link - For Drupal 8 and 9 8
File
src/Plugin/CKEditorPlugin/AnchorLink.php
View source
<?php
namespace Drupal\anchor_link\Plugin\CKEditorPlugin;
use Drupal\editor\Entity\Editor;
use Drupal\ckeditor\CKEditorPluginBase;
class AnchorLink extends CKEditorPluginBase {
public function getFile() {
return drupal_get_path('module', 'anchor_link') . '/js/plugins/link/plugin.js';
}
public function getDependencies(Editor $editor) {
return [
'fakeobjects',
];
}
public function getLibraries(Editor $editor) {
return [];
}
public function isInternal() {
return FALSE;
}
public function getButtons() {
return [
'Link' => [
'label' => $this
->t('Link'),
'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/link.png',
],
'Unlink' => [
'label' => $this
->t('Unlink'),
'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/unlink.png',
],
'Anchor' => [
'label' => $this
->t('Anchor'),
'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/anchor.png',
],
];
}
public function getConfig(Editor $editor) {
return [];
}
}