Commit d62ca100 authored by catch's avatar catch

Issue #2681845 by thpoul: Use CKEditorPluginCssInterface to add the CKEditor language plugin css

parent 5e6b9a3b
......@@ -64,13 +64,6 @@ function ckeditor_ckeditor_css_alter(array &$css, Editor $editor) {
if ($editor->getFilterFormat()->filters('filter_caption')->status) {
$css[] = drupal_get_path('module', 'filter') . '/css/filter.caption.css';
}
// @todo: Remove in https://www.drupal.org/node/2645100.
/** @var \Drupal\ckeditor\CKEditorPluginManager $ckeditor_plugin_manager */
$ckeditor_plugin_manager = \Drupal::service('plugin.manager.ckeditor.plugin');
if (in_array('Language', $ckeditor_plugin_manager->getEnabledButtons($editor))) {
$css[] = drupal_get_path('module', 'ckeditor') . '/css/plugins/language/ckeditor.language.css';
}
}
/**
......
......@@ -9,6 +9,7 @@
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
use Drupal\ckeditor\CKEditorPluginCssInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageManager;
use Drupal\Core\Language\LanguageInterface;
......@@ -23,7 +24,7 @@
* label = @Translation("Language")
* )
*/
class Language extends CKEditorPluginBase implements CKEditorPluginConfigurableInterface {
class Language extends CKEditorPluginBase implements CKEditorPluginConfigurableInterface, CKEditorPluginCssInterface {
/**
* {@inheritdoc}
......@@ -128,4 +129,13 @@ public function settingsForm(array $form, FormStateInterface $form_state, Editor
return $form;
}
/**
* {@inheritdoc}
*/
function getCssFiles(Editor $editor) {
return array(
drupal_get_path('module', 'ckeditor') . '/css/plugins/language/ckeditor.language.css'
);
}
}
Markdown is supported
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