Verified Commit b7217f3d authored by apaderno's avatar apaderno
Browse files

Issue #3139791 by Phil Wolstenholme, Project Update Bot, apaderno: Make the...

Issue #3139791 by Phil Wolstenholme, Project Update Bot, apaderno: Make the module compatible with Drupal 9
parent 30f805e5
name: CKEditor Advanced Tab name: CKEditor Advanced Tab
type: module type: module
description: 'Adds the Advanced tab to dialog plugin to CKEditor.' description: 'Adds the Advanced tab to dialog plugin to CKEditor.'
core: 8.x core_version_requirement: ^9.3
package: CKEditor package: CKEditor
dependencies: dependencies:
- drupal:ckeditor - drupal:ckeditor
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\ckeditor_advanced_tab\Plugin\CKEditorPlugin; namespace Drupal\ckeditor_advanced_tab\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase; use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\editor\Entity\Editor; use Drupal\editor\Entity\Editor;
...@@ -39,11 +40,14 @@ class CKEditorAdvancedTab extends CKEditorPluginBase implements ContainerFactory ...@@ -39,11 +40,14 @@ class CKEditorAdvancedTab extends CKEditorPluginBase implements ContainerFactory
* A logger instance. * A logger instance.
* @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager
* The translation manager. * The translation manager.
* @param \Drupal\Core\Extension\ModuleExtensionList $extension_list_module
* The module extension list.
*/ */
public function __construct(array $configuration, $plugin_id, array $plugin_definition, LoggerInterface $logger, TranslationInterface $translation_manager) { public function __construct(array $configuration, $plugin_id, array $plugin_definition, LoggerInterface $logger, TranslationInterface $translation_manager, ModuleExtensionList $extension_list_module) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->logger = $logger; $this->logger = $logger;
$this->setStringTranslation($translation_manager); $this->setStringTranslation($translation_manager);
$this->moduleList = $extension_list_module;
} }
/** /**
...@@ -53,7 +57,8 @@ public static function create(ContainerInterface $container, array $configuratio ...@@ -53,7 +57,8 @@ public static function create(ContainerInterface $container, array $configuratio
return new static( return new static(
$configuration, $plugin_id, $plugin_definition, $configuration, $plugin_id, $plugin_definition,
$container->get('logger.channel.ckeditor_advanced_tab'), $container->get('logger.channel.ckeditor_advanced_tab'),
$container->get('string_translation') $container->get('string_translation'),
$container->get('extension.list.module')
); );
} }
...@@ -77,11 +82,10 @@ public function getFile() { ...@@ -77,11 +82,10 @@ public function getFile() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getButtons() { public function getButtons() {
$path = drupal_get_path('module', 'ckeditor_advanced_tab') . '/icons';
return [ return [
'AdvancedTab' => [ 'AdvancedTab' => [
'label' => $this->t('Advanced Tab'), 'label' => $this->t('Advanced Tab'),
'image' => $path . '/link.png', 'image' => $this->getModulePath('ckeditor_advanced_tab') . '/icons/link.png',
], ],
]; ];
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment