123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <?php
- function hook_wysiwyg_plugin($editor, $version) {
- switch ($editor) {
- case 'tinymce':
- if ($version > 3) {
- return array(
- 'myplugin' => array(
-
- 'url' => 'http://drupal.org/project/img_assist',
-
-
- 'path' => drupal_get_path('module', 'img_assist') . '/drupalimage',
-
-
-
- 'filename' => 'editor_plugin.js',
-
-
-
- 'buttons' => array(
- 'img_assist' => t('Image Assist'),
- ),
-
-
-
- 'extensions' => array(
- 'imce' => t('IMCE'),
- ),
-
-
- 'options' => array(
- 'file_browser_callback' => 'imceImageBrowser',
- 'inline_styles' => TRUE,
- ),
-
-
-
-
-
- 'load' => TRUE,
-
-
-
-
- 'internal' => TRUE,
-
- 'extended_valid_elements' => array(
- 'img[class|src|border=0|alt|title|width|height|align|name|style]',
- ),
- ),
- );
- }
- break;
- }
- }
- function hook_wysiwyg_include_directory($type) {
- switch ($type) {
- case 'plugins':
-
-
- return $type;
- }
- }
- function hook_INCLUDE_plugin() {
- $plugins['awesome'] = array(
-
- 'title' => t('Awesome plugin'),
-
- 'vendor url' => 'http://drupal.org/project/wysiwyg',
-
-
- 'icon path' => 'path to icon',
-
- 'icon file' => 'name of the icon file with extension',
-
- 'icon title' => t('Do something'),
-
-
- 'js path' => drupal_get_path('module', 'mymodule') . '/awesomeness',
-
-
- 'js file' => 'awesome.js',
-
-
- 'css path' => drupal_get_path('module', 'mymodule') . '/awesomeness',
-
-
- 'css file' => 'awesome.css',
-
- 'settings' => array(
- ),
-
- 'extended_valid_elements' => array(
- 'tag1[attribute1|attribute2]',
- 'tag2[attribute3|attribute4]',
- ),
- );
- return $plugins;
- }
- function hook_INCLUDE_editor() {
- $editor['ckeditor'] = array(
-
- 'title' => 'CKEditor',
-
- 'vendor url' => 'http://ckeditor.com',
-
- 'download url' => 'http://ckeditor.com/download',
-
-
- 'libraries' => array(
- '' => array(
- 'title' => 'Default',
- 'files' => array(
- 'ckeditor.js' => array('preprocess' => FALSE),
- ),
- ),
- 'src' => array(
- 'title' => 'Source',
- 'files' => array(
- 'ckeditor_source.js' => array('preprocess' => FALSE),
- ),
- ),
- ),
-
-
- 'install note callback' => 'wysiwyg_ckeditor_install_note',
-
- 'version callback' => 'wysiwyg_ckeditor_version',
-
- 'themes callback' => 'wysiwyg_ckeditor_themes',
-
-
- 'settings form callback' => 'wysiwyg_ckeditor_settings_form',
-
-
-
-
-
-
-
- 'init callback' => 'wysiwyg_ckeditor_init',
-
-
- 'settings callback' => 'wysiwyg_ckeditor_settings',
-
- 'plugin callback' => 'wysiwyg_ckeditor_plugins',
-
-
- 'plugin settings callback' => 'wysiwyg_ckeditor_plugin_settings',
-
-
- 'proxy plugin' => array(
- 'drupal' => array(
- 'load' => TRUE,
- 'proxy' => TRUE,
- ),
- ),
-
-
- 'proxy plugin settings callback' => 'wysiwyg_ckeditor_proxy_plugin_settings',
-
-
- 'versions' => array(
- '3.0.0.3665' => array(
- 'js files' => array('ckeditor-3.0.js'),
- ),
- ),
- );
- return $editor;
- }
- function hook_wysiwyg_editor_settings_alter(&$settings, $context) {
-
-
-
- if ($context['profile']->editor == 'tinymce') {
-
- $settings['cleanup_on_startup'] = TRUE;
- }
- }
|