Skip to content

Instantly share code, notes, and snippets.

@aschiwi
Last active December 18, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aschiwi/5780513 to your computer and use it in GitHub Desktop.
Save aschiwi/5780513 to your computer and use it in GitHub Desktop.
Please check this blog post for an explanation of this code: http://www.undpaul.de/blog/2013/06/14/changing-ckeditor-skins-drupals-wysiwyg
<?php
/**
* Implements hook__wysiwyg_editor_settings_alter().
*/
function MODULENAME_wysiwyg_editor_settings_alter(&$settings, $context) {
global $base_url;
if ($context['profile']->editor == 'ckeditor') {
$skins_path = drupal_get_path('module', 'MODULENAME') . '/ckeditor/skins';
// For flexibility we use a variable to get the active skin name.
$active_skin = variable_get('MODULENAME_skin', 'silver');
// Set custom skin.
$settings['skin'] = sprintf('%s,' . '%s/%s/%s/', $active_skin, $base_url, $skins_path, $active_skin);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment