Are there any plans on developing a TinyMCE plugin for the WebFM module? This way the WebFM module could replace IMCE...

Comments

robmilne’s picture

Status: Active » Postponed

No plans. I'll review a patch if you wish to try yourself.

Andrew Schulman’s picture

I think that this would be really, really useful. Right now my content creators see two different file managers, WebFM for attachments and IMCE for general file uploads, and I hate that. I want just one file manager, and WebFM is much more capable than IMCE. If WebFM could be integrated into TinyMCE, then I'd say bye-bye to IMCE.

http://drupal.org/node/241753#comment-792305 provides a patch for integrating IMCE into TinyMCE. The patch is fairly easily adapted for WebFM as follows:

function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  static $access, $integrated;

  if (!isset($access)) {
    $access = user_access('access webfm');
  }

  $init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);

  if ($init && $access) {
    $init['file_browser_callback'] = 'webfmImageBrowser';
    if (!isset($integrated)) {
      $integrated = TRUE;
      drupal_add_js("function webfmImageBrowser(fid, url, type, win) {win.open(Drupal.settings.basePath +'?q=webfm&app=TinyMCE|url@'+ fid, '', 'width=760,height=560,resizable=1');}", 'inline');
    }
  }

  return $init;
}

What this does:
1. Checks permission to access webfm.
2. Provides a "Browse" button (in TinyMCE, insert/edit image > General > Image URL; little button is at right) that opens a webfm window when it's pressed.

What it doesn't do yet:
3. Show just the file manager. Instead you get the whole /webfm page.
4. Return the results of the file selection to TinyMCE.

I have very little familiarity with this, but if someone pointed me in the right direction I might figure it out. No doubt 3 and 4 are simple if you know how, but I don't yet. Any suggestions?

Andrew.

geoff_eagles’s picture

dbFM is based on webfm and it has TinyMCE integration. You might be able to grope through the dbFM code and use bits to modify webfm?

nhck’s picture

Status: Postponed » Closed (won't fix)

As per #803722: Cease support of Drupal 5? support for D4 and D5 has been closed. Sorry, please upgrade to Drupal 6. If you think this issue still applies with Version 6.x please reopen this issue with correct version tag.

Thank you! :-)