diff --git a/src/Plugin/CKEditorPlugin/AnchorLink.php b/src/Plugin/CKEditorPlugin/AnchorLink.php index fe41d982f81c9f4ac6663f9f16436d8fb46568bb..baa3eea071ee58ff48238fae09cf234ffc8c86a0 100755 --- a/src/Plugin/CKEditorPlugin/AnchorLink.php +++ b/src/Plugin/CKEditorPlugin/AnchorLink.php @@ -20,7 +20,8 @@ class AnchorLink extends CKEditorPluginBase { * Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getFile(). */ public function getFile() { - return drupal_get_path('module', 'anchor_link') . '/js/plugins/link/plugin.js'; + $anchor_link_path = \Drupal::service('extension.list.module')->getPath('anchor_link'); + return $anchor_link_path . '/js/plugins/link/plugin.js'; } /** @@ -50,18 +51,21 @@ class AnchorLink extends CKEditorPluginBase { * {@inheritdoc} */ public function getButtons() { + + $anchor_link_path = \Drupal::service('extension.list.module')->getPath('anchor_link'); + return [ 'LinkToAnchor' => [ 'label' => $this->t('Link to anchor'), - 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/link.png', + 'image' => $anchor_link_path . '/js/plugins/link/icons/link.png', ], 'UnlinkAnchor' => [ 'label' => $this->t('Unlink Anchor'), - 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/unlink.png', + 'image' => $anchor_link_path . '/js/plugins/link/icons/unlink.png', ], 'Anchor' => [ 'label' => $this->t('Anchor'), - 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/anchor.png', + 'image' => $anchor_link_path . '/js/plugins/link/icons/anchor.png', ], ]; } diff --git a/src/Plugin/CKEditorPlugin/FakeObjects.php b/src/Plugin/CKEditorPlugin/FakeObjects.php index 9cc30efed4d339c5e6ba900ad12df7ec8de572d0..9ae54992606c9c112eb1a35153b9b665c671fdc7 100755 --- a/src/Plugin/CKEditorPlugin/FakeObjects.php +++ b/src/Plugin/CKEditorPlugin/FakeObjects.php @@ -21,7 +21,8 @@ class FakeObjects extends PluginBase implements CKEditorPluginInterface { * Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getFile(). */ public function getFile() { - return drupal_get_path('module', 'anchor_link') . '/js/plugins/fakeobjects/plugin.js'; + $anchor_link_path = \Drupal::service('extension.list.module')->getPath('anchor_link'); + return $anchor_link_path . '/js/plugins/fakeobjects/plugin.js'; } /**