You are here

function ckeditor_ckeditor_css_alter in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/ckeditor/ckeditor.module \ckeditor_ckeditor_css_alter()

Implements hook_ckeditor_css_alter().

File

core/modules/ckeditor/ckeditor.module, line 54
Provides integration with the CKEditor WYSIWYG editor.

Code

function ckeditor_ckeditor_css_alter(array &$css, Editor $editor) {
  if (!$editor
    ->hasAssociatedFilterFormat()) {
    return;
  }

  // Add the filter caption CSS if the text format associated with this text
  // editor uses the filter_caption filter. This is used by the included
  // CKEditor DrupalImageCaption plugin.
  if ($editor
    ->getFilterFormat()
    ->filters('filter_caption')->status) {
    $css[] = drupal_get_path('module', 'filter') . '/css/filter.caption.css';
  }

  // Add the filter caption CSS if the text format associated with this text
  // editor uses the filter_align filter. This is used by the included
  // CKEditor DrupalImageCaption plugin.
  if ($editor
    ->getFilterFormat()
    ->filters('filter_align')->status) {
    $css[] = drupal_get_path('module', 'ckeditor') . '/css/plugins/drupalimagecaption/ckeditor.drupalimagecaption.css';
  }
}