• Drupal 5.9
  • Wysiwyg 5.x-0.2
  • TinyMCE 2.1.3
  1. Added g2image to sites\all\modules\wysiwyg\tinymce\jscripts\tiny_mce\plugins\g2image
  2. 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,
            ),
    
  3. g2image showed up under buttons and I enabled it for my editor profile.
  4. 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?

Comments

sun’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

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.

steveoliver’s picture

Yes, sun, IMCE is a Drupal contrib module. No, g2image isn't.

sun’s picture

Title: Issue with Wysiwyg Plugins » Add wysiwyg_external_plugins module
Version: 5.x-0.2 » 5.x-1.x-dev
Category: support » feature
Status: Postponed (maintainer needs more info) » Postponed

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.

steveoliver’s picture

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, href="http://drupal.org/node/241753#comment-792305">#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?

sun’s picture

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.

sun’s picture

Version: 5.x-1.x-dev » 6.x-2.x-dev
Component: Wysiwyg Editor » Plugins

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.

dkruglyak’s picture

Status: Postponed » Needs work

I see that #320562 has been fixed. So what would it take now to enable TinyMCE Spellcheck plugin?

sun’s picture

Status: Needs work » Postponed

@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.

sun’s picture

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

iva2k’s picture

Just to let people know - I've created Wysiwyg SpellCheck module that enables TinyMCE spellchecker plugin. It may be just what you need.

Ron Collins’s picture

thanks. that was just what i needed. this was the final piece needed to get private files working with tinymce, IMCE and spell checking.

xolotl’s picture

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.

BeatnikDude’s picture

Title: Add wysiwyg_external_plugins module » wysiwyg_external_plugins module vs. TINYmce plugins

@ xolotl
Thanks, works great, I needed this.
Previously the TinyMCE spellcheck plugin worked as per TinyMCE documentation when added without a fix.

I agree I don't think adding another module is the way to go, especially when you then move the TinyMCE spellcheck library to a location other than the location documented within TinyMCE. It seems that this should be integrated into the module in support of the TinyMCE editor.

sun’s picture

Title: wysiwyg_external_plugins module vs. TINYmce plugins » Add wysiwyg_external_plugins module
bramface’s picture

attheshow’s picture

Subscribing. Would love to be able to use spellchecker plugin without having to add an extra module or hacking this one.

AdrianB’s picture

Subscribing.

BeatnikDude’s picture

I would suggest that the title of this thread reflect the issue, not the proposed solution.

BigMike’s picture

Thank you very much xolotl!

Russell Mann’s picture

This solution works. Spent a lot of time on this and think this should already be in the tinymce.inc. The other editor inc's already have them in, why can't this be fixed and standard? Any ideas?

paskainos’s picture

Thank you xolotl for sharing. I agree with @Russell Mann. Spell checker is very arguably core functionality in a WYSIWYG editor. And since TinyMCE ships with spell checker, rolling it in gets my vote.

I realize this issue probably isn't the best place to make this case, but I'm making it here because of the other interest here on this, and because it's where xolotl's workaround is located.

TwoD’s picture

TinyMCE does not ship with the spellchecker(s) mentioned here. It does have a plugin which can be used with some serverside backends but it needs to be downloaded separately: http://tinymce.oxiecode.com/wiki.php/Plugin:spellchecker
This issue is for plugins in general, so let's not put too much focus on spellcheckers here. ;)

paskainos’s picture

@TwoD: thanks for pointing out the clarification (spellchecker is a plugin). One slight correction, the spellchecker plugin does ship with TinyMCE (since ca. 2007). And I agree, this isn't the place to put too much emphasis on spellchecker. But to your point about 'plugins in general', as previously stated spellchecker is arguably core functionality in a WYSIWYG environment. Therefore, if plugins like Word count are rolled in, then why not spellchecker? I think in that context, the spellchecker dialogue fits here, in conjunction with your remark about plugins in general.

I think perhaps we're talking semantics here, or maybe splitting hairs. But the point is, with most clients expecting spellchecker functionality as much as any other WYSIWYG plugin, a few lines of code makes much more sense than several modules.

TwoD’s picture

Yes, the clientside part of the spellchecker plugin is included, but not the serverside backend. From what we could tell by the documentation such a backend was required and it was necessary to modify config files manually to get it up and running. Hence the current lack of support for the TinyMCE spellchecker plugin. The wordcount plugin had no such requirements.

So thats one reason for not supporting some plugins in "Wysiwyg core", even if they are shipped with the editor. We don't like to require manual configuration, so if nobody's been able to create a GUI to do [most of] the configuration required to make a plugin work, we don't want to take on the responsibility of being first line of support. The editor-specific communities are much better at that. I'm hoping to be able to put some work into #313497: Allow configuration of advanced editor settings very soon. That would contribute a lot to actually being able to create editor-specific GUIs and increasing the level of support for several plugins.

To follow up on the spellchecker:
I took a look at the code in that plugin just now, and it seems there's a fallback to the browser's native spellchecker (if any) for non-IE browsers. If IE is detected, users are asked to install the ieSpell browser extension.
I think that would be enough for officially supporting this plugin (in its default non-backend mode) with Wysiwyg.
It's already possible to enable the native spellchecker in Gecko browsers via hook_wysiwyg_editor_settings_alter() and gecko_spellcheck. It looks like that when the plugin is in "native" mode it will toggle the same functionality acvtivated by the setting and make sure the editor's own context menu stays out of the way.
If there isn't already a feature request for that specific plugin would you mind creating one?
An alternative would be to include support for it within the [badly needed] cleanup/corrections discussed in #970452: Fix TinyMCE plugin names and remove outdated plugin information.

paskainos’s picture

@TwoD: I think your (alternative) proposal to roll this in to #970452: Fix TinyMCE plugin names and remove outdated plugin information is an excellent idea! It seems like a perfect fit, and it gets my vote. In response to your latest post over there I vote we roll this in.

W32’s picture

I added code to initialize the tinymce plugin "Spellchecker" in file "tinymce.inc", turn-on it on the Wysiwyg profile page, but the button on the tinymce toolbar does not appear. Why?

Conf: Drupal7, TinyMCE 3.4.3.2, Wysiwyg-last
added code:

  if (version_compare($editor['installed version'], '3.2.6', '>=')) {
    $plugins['spellchecker'] = array(
      'path' => $editor['library path'] . '/plugins/spellchecker',
      'extensions' => array('spellchecker' => t('Spellchecker')),
      'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',
      'internal' => TRUE,
      'load' => TRUE,
    );
  }
drzraf’s picture

[edit, didn't read correctly]