Last active
August 8, 2018 20:54
-
-
Save alexfinnarn/f77917583282c791eb5e518382b959fd to your computer and use it in GitHub Desktop.
WYSIWYG to CKEdtior hooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements of hook_wysiwyg_plugin(). | |
*/ | |
function code_syntax_highlighting_bundle_wysiwyg_plugin($editor, $version) { | |
// Add the code button for the ckeditor. | |
if ($editor === 'ckeditor') { | |
return array( | |
'code_sc' => array( | |
'path' => backdrop_get_path('module', 'code_syntax_highlighting_bundle') . '/plugins/code_sc', | |
'buttons' => array( | |
'code_sc_button' => t('Code Shortcode Generator'), | |
), | |
'load' => TRUE, | |
), | |
); | |
} | |
} | |
/** | |
* Implements hook_ckeditor_plugins(). | |
*/ | |
function code_syntax_highlighting_bundle_ckeditor_plugins() { | |
$plugins['csh'] = array( | |
'path' => backdrop_get_path('module', 'code_syntax_highlighting_bundle') . '/plugins/code_sc', | |
'file' => 'plugin.js', | |
'internal' => FALSE, | |
// 'css' => array(backdrop_get_path('module', 'mymodule') . '/css/myplugin.css'), | |
'enabled callback' => 'csh_plugin_check', | |
'buttons' => array( | |
'CSH' => array( | |
'label' => t('Code Syntax Highlighting'), | |
'image' => backdrop_get_path('module', 'code_syntax_highlighting_bundle') . '/plugins/code_sc/images/code_sc_button.png', | |
'image_alternative' =>'{code}', | |
//'dependencies' => array('contextmenu'), | |
), | |
), | |
); | |
return $plugins; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment