Skip to content
Snippets Groups Projects
Commit 300cdc45 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3277445: Support Drupal 10 and update all use of deprecation in the...

Issue #3277445: Support Drupal 10 and update all use of deprecation in the CKEditor Anchor Link module
parent 0a016a0c
No related branches found
No related tags found
No related merge requests found
......@@ -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',
],
];
}
......
......@@ -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';
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment