I'm using IMCE an TinyMCE. IMCE offers an option to set itself as the default file browser in TinyMCE, but this doesn't work properly.
I noticed that IMCE should load 2 JavaScripts while displaying TinyMCE to put a button to be able to access the file browser by the image function.
I don't know why IMCE doesn't put the JSs in the page, but perhaps it may be of interest for other people having the same problem:

To make it running, it's necessary to put some code in "tinymce.module":

1.)
Search the string if (!$is_running) { . It should be somewhere in function tinymce_process_textarea($element).

2.)
Add the following code:

$is_running = TRUE;
$tinymce_mod_path = drupal_get_path('module', 'tinymce');

//And now the changes to make it going

drupal_add_js('var imceBrowserURL = "'.url('imce/browse') .'";', 'inline');
drupal_add_js(drupal_get_path('module', 'imce') .'/imce_set_tinymce.js');

//That's all ^^  ...

Now, while using TinyMCE, the necessary JavaScripts will also be loaded. This should normally be done by IMCE. So It could also be a bug of IMCE.

Comments

keesje’s picture

Hi,
I've exactly the same problem, your fix works, thanks.
I want to add that I have two Drupal sites, one working fine without the fix, the other doesnt. Both the same versions of everything. The one not working is far more complex and uses more other modules. Maybe there is an incompatibility somewhere? Strange ehh..

keesje’s picture

Update: in IE7 still not working after fix?

grandcat’s picture

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

This is very curious. While viewing with IE7, did you use the same user group like in Firefox?
Please take a closer look to the HTML-Code when you view the editor with IE7. Is there any JS entry like the following:

<script type="text/javascript" src="/drupal/modules/imce/imce_set_tinymce.js"></script>

The source file can differ, but it should contain "imce_set_tinymce.js". I also viewed the editor ( + TinyMCE + IMCE + Patch) in my own site with IE7, so please answer the questions above, perhaps this could help to find the problem ;-)

grandcat’s picture

Category: task » bug

Sorry, I set the wrong category ;-)

grandcat’s picture

Now, I know why IMCE doesn't integrate right in TinyMCE. Your template needs an old-fashioned include of "$closure". That's all =)

grandcat’s picture

Status: Postponed (maintainer needs more info) » Fixed

Now, I know why IMCE doesn't integrate right in TinyMCE. Your template needs an old-fashioned include of "$closure". That's all =)

Anonymous’s picture

Status: Fixed » Closed (fixed)
visionmark’s picture

Any other ideas? This doesn't work.

HyperD’s picture

Version: 5.x-1.x-dev » 6.x-1.1-dev
Priority: Normal » Critical

Installed TyniMCE, installed IMCE .. TyniMCE neglets IMCE totally... even if I put the code that you suggested here ...