Skip to content
Snippets Groups Projects
Commit 38f3ef3a authored by wodby's avatar wodby
Browse files

ISTWCMS-4506: fixing the path to the mathjax library

parent b13ad58d
No related branches found
No related tags found
No related merge requests found
...@@ -26,13 +26,6 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin ...@@ -26,13 +26,6 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin
*/ */
protected $libFileFinder; protected $libFileFinder;
/**
* File system.
*
* @var \Drupal\Core\File\FileSystem
*/
protected $fileSystem;
/** /**
* Constructs a BlockComponentRenderArray object. * Constructs a BlockComponentRenderArray object.
* *
...@@ -44,20 +37,17 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin ...@@ -44,20 +37,17 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin
* The plugin implementation definition. * The plugin implementation definition.
* @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder * @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder
* The library file finder. * The library file finder.
* @param \Drupal\Core\File\FileSystem $fileSystem
* The file system.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder, FileSystem $fileSystem) { public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->libFileFinder = $libFileFinder; $this->libFileFinder = $libFileFinder;
$this->fileSystem = $fileSystem;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder'), $container->get('file_system')); return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder'));
} }
/** /**
...@@ -95,7 +85,7 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin ...@@ -95,7 +85,7 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin
return [ return [
'Mathjax' => [ 'Mathjax' => [
'label' => $this->t('Math'), 'label' => $this->t('Math'),
'image' => $this->fileSystem->realpath($this->libFileFinder->find('ckeditor-mathjax')) . '/icons/mathjax.png', 'image' => $this->libFileFinder->find('ckeditor-mathjax') . '/icons/mathjax.png',
], ],
]; ];
} }
...@@ -104,7 +94,7 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin ...@@ -104,7 +94,7 @@ class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPlugin
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getFile() { public function getFile() {
return $this->fileSystem->realpath($this->libFileFinder->find('ckeditor-mathjax')) . '/plugin.js'; return $this->libFileFinder->find('ckeditor-mathjax') . '/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