Closed (fixed)
Project:
Wysiwyg
Version:
5.x-2.0
Component:
Plugins
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2009 at 22:24 UTC
Updated:
11 Jul 2009 at 04:20 UTC
I wrote a plugin for tinymce in WYSIWYG and when I updated to 5.x-2.0 (from 5.x-1.3) the plugin no longer gets added. Is there documentation of what changed for writing a plugin to make it get added?
I can see it in the settings - but it looks like it's never coming back from the call to wysiwyg_get_all_plugins() into the loop that adds Drupal plugins even though its hook_wysiwyg_plugin is being hit. Break is the only plugin that's coming through in that loop from what I can tell.
Here's the code for the hook
/**
* Implementation of hook_wysiwyg_plugin().
*/
function tinymce_footnotes_wysiwyg_plugin($editor) {
switch ($editor) {
case 'tinymce':
return array(
'tinymce_footnotes' => array(
'type' => 'external',
'title' => 'Footnotes',
'description' => 'Add footnotes via a popup',
'path' => drupal_get_path('module', 'tinymce_footnotes') .'/tinymce_plugin',
'icon' => array('tinymce_footnotes' => t('Add Footnotes')),
'buttons' => array('tinymce_footnotes' => t('Add Footnotes')),
'url' => 'http://drupal.org/project/footnotes',
'extended_valid_elements' => array('fn'),
'basePath' => base_path(),
'settings' => array(),
),
);
break;
}
}
Comments
Comment #1
sunHrm. That snippet looks like a mixture of a "native" plugin and a Drupal plugin. Drupal plugins (like the Teaser break plugin) currently have a different structure than internal/native plugins. Based on the snippet, I'd say that you want implement a native plugin, specifically for TinyMCE. If that plugin JavaScript needs to be loaded separately, you need to define 'load' => TRUE. See also tinymce.inc, where some other native editor plugins are defined.