Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / ckeditor / src / Plugin / CKEditorPlugin / DrupalLink.php
1 <?php
2
3 namespace Drupal\ckeditor\Plugin\CKEditorPlugin;
4
5 use Drupal\ckeditor\CKEditorPluginBase;
6 use Drupal\editor\Entity\Editor;
7
8 /**
9  * Defines the "drupallink" plugin.
10  *
11  * @CKEditorPlugin(
12  *   id = "drupallink",
13  *   label = @Translation("Drupal link"),
14  *   module = "ckeditor"
15  * )
16  */
17 class DrupalLink extends CKEditorPluginBase {
18
19   /**
20    * {@inheritdoc}
21    */
22   public function getFile() {
23     return drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink/plugin.js';
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   public function getLibraries(Editor $editor) {
30     return [
31       'core/drupal.ajax',
32     ];
33   }
34
35   /**
36    * {@inheritdoc}
37    */
38   public function getConfig(Editor $editor) {
39     return [
40       'drupalLink_dialogTitleAdd' => $this->t('Add Link'),
41       'drupalLink_dialogTitleEdit' => $this->t('Edit Link'),
42     ];
43   }
44
45   /**
46    * {@inheritdoc}
47    */
48   public function getButtons() {
49     $path = drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink';
50     return [
51       'DrupalLink' => [
52         'label' => $this->t('Link'),
53         'image' => $path . '/icons/drupallink.png',
54       ],
55       'DrupalUnlink' => [
56         'label' => $this->t('Unlink'),
57         'image' => $path . '/icons/drupalunlink.png',
58       ],
59     ];
60   }
61
62 }