You are here

function codesnippet_ckeditor_css_alter in CKEditor CodeSnippet 8

Implements hook_ckeditor_css_alter().

Injects our selected CSS sheet anytime CKEditor has loaded.

File

./codesnippet.module, line 15
Provides integration with the CKEditor WYSIWYG editor.

Code

function codesnippet_ckeditor_css_alter(array &$css, Editor $editor) {
  if (!$editor
    ->hasAssociatedFilterFormat()) {
    return;
  }
  $settings = $editor
    ->getSettings();
  if (!empty($settings['plugins']['codesnippet']['highlight_style'])) {
    $css[] = 'libraries/codesnippet/lib/highlight/styles/' . $settings['plugins']['codesnippet']['highlight_style'] . '.css';
  }
}