Add wysiwyg_external_plugins module
steveoliver - July 25, 2008 - 21:47
| Project: | Wysiwyg |
| Version: | 6.x-2.x-dev |
| Component: | Plugins |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Jump to:
Description
- Drupal 5.9
- Wysiwyg 5.x-0.2
- TinyMCE 2.1.3
- Added g2image to sites\all\modules\wysiwyg\tinymce\jscripts\tiny_mce\plugins\g2image
- Added g2image to wysiwyg_editors.plugins.inc:
'g2image' => array(
'path' => $path_editor .'/plugins/g2image',
'buttons' => array('g2image' => t('Gallery 2 Image')),
'url' => 'http://g2image.steffensenfamily.com/index.php?title=Main_Page',
'internal' => TRUE,
'load' => TRUE,
), - g2image showed up under buttons and I enabled it for my editor profile.
- But g2image button doesn't show up in TinyMCE.
I'm also wondering how to get IMCE working with the standard TinyMCE insert/edit image button.
Any ideas?

#1
The one and only question in advance: Are both editor plugins provided by Drupal contrib modules? I know IMCE, but I don't know that "g2image" thingy.
#2
Yes, sun, IMCE is a Drupal contrib module. No, g2image isn't.
#3
Regarding IMCE, see #287025: IMCE_Wysiwyg API bridge module
For g2image and other plugins, I really think someone should create a separate module for the Wysiwyg project that implements hook_wysiwyg_plugin() for a bunch of (external) editor plugins that are not related to Drupal modules. That would be a relatively time-consuming task, because for each of them, one has to check the license (perhaps consult the author) and update it when a new version appears. Of course, as the API evolves, all hook implementations might need to be updated the other day, and I certainly do not only think of plugins for TinyMCE here. This module could live inside the Wysiwyg package, so all users would benefit from it.
If someone wants to step in and take over this part, feel free to leave me a message.
#4
I do understand what you are saying about a module for external plugins - I think that will become necessary. I may be able to commission that work by a programmer I work with. I will point him to this thread if he is available and have him contact you to move forward.
Regarding IMCE, I followed your link to #287025: Wysiwyg Editor support (which seemed to have no follow-up support) to another post, #241753: Integrate tinyMCE better with IMCE which recommended adding a template.php function (for TinyMCE standalone, not TinyMCE as editor for WYSIWYG):
<?php
function phptemplate_tinymce_theme($init, $textarea_name,
$theme_name, $is_running) {
static $access, $integrated;
if (!isset($access)) {
$access = function_exists('imce_access') && imce_access();
}
$init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);
if ($init && $access) {
$init['file_browser_callback'] = 'imceImageBrowser';
if (!isset($integrated)) {
$integrated = TRUE;
drupal_add_js("function imceImageBrowser(fid, url, type, win) {
win.open(Drupal.settings.basePath +'?q=imce&app=TinyMCE|url@'+ fid, '', 'width=760,height=560,resizable=1');}", 'inline');
}
}
return $init;
}
?>
This did not work to enable the IMCE button in TinyMCE for WYSIWYG. I'm not sure what you wanted me to see about post #287025. Were you recommending the function above? Or something else?
#5
I've pointed you to the existing IMCE issue to keep different topics separated, and replied over there. This issue should focus on external editor plugins only.
#6
I'm interested in solving the larger issue - supporting externally distributed/hosted editor plugins in externally ditributed/hosted editor libraries.
#320562: Libraries API contains more valuable info around this topic.
It boils down to 1 wrapper module for all kind of external plugins, I guess.
#7
I see that #320562 has been fixed. So what would it take now to enable TinyMCE Spellcheck plugin?
#8
@dkruglyak: This issue is about editor plugins that are neither shipped with the editor, nor provided by a Drupal module. Instead, it's about completely optional, externally hosted editor plugins.
#328252: Handle compatibility of internal plugins via plugin API (also) talks about TinyMCE's spellchecker plugin and I believe that's what you want.
#9
Sorry, #466168: Patch to enable spellchecker plugin in TinyMCE clarified that the spellchecker plugin is somehow special. The basic plugin is shipped with the editor, but you additionally need to download server-side PHP scripts and put them into the plugin's directory to make it work.
http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
#10
Just to let people know - I've created Wysiwyg SpellCheck module that enables TinyMCE spellchecker plugin. It may be just what you need.
#11
thanks. that was just what i needed. this was the final piece needed to get private files working with tinymce, IMCE and spell checking.
#12
I didn't really want to install another module just to enable spellchecking in tinymce (v. 3.2.5), so I got it working by doing the following. I didn't really see this info stated clearly anywhere, so I'm putting it here in case it helps someone else. You may find it easier to use the wysiwyg_spellcheck module to accomplish the same thing.
Replace the standard spellchecker plugin at sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/spellchecker with the latest downloaded from tinymce (v 2.0.2) at http://tinymce.moxiecode.com/download.php.
Then add the following reference to that plugin in the wysiwyg module (v 6.x-2.0) at about line 520 of sites/all/modules/wysiwyg/editors/tinymce.inc
'spellchecker' => array('path' => $editor['library path'] . '/plugins/spellchecker',
'buttons' => array('spellchecker' => t('Spell Check')),
'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker';,
'internal' => TRUE,
'load' => TRUE,
),
Then configure the necessary input formats in your drupal site's wysiwyg administration screen to enable the spell check button.