I'm testing IMCE-HEAD on my Drupal-6.0.
On the same installation, there is a fckeditor-6.x-1.1-beta2.

After all installation, I tried to use FCKeditor.
Both image and link interface doesn't show a browse button.

CommentFileSizeAuthor
#6 imce-HEAD.FCKEditor.D6.patch3.76 KBsmh67
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sanderbontje’s picture

Similar problem here on my test setup:

Drupal 6.0, upgraded yesterday to 6.1
IMCE HEAD revision from CVS (imce.module v 1.19 2008/02/27)
FCKeditor_2.5.1 (latest stable release)
fckeditor-6.x-1.1-beta2 Drupal module

IMCE module is enabled in admin/build/modules.
All users' roles are configured to have access to IMCE at admin/settings/imce.
No javascript errors are thrown.
No browse button showing up on image and link interface.

Checked template: theme Garland prints $closure.
But there is no link to any imce related javascript visible in the output page source.

Dubs’s picture

Hi there,

I have the same problem as mentioned above.

FCKEditor - 6.x-1.1-beta2
IMCE - Latest build (correct on 4th March 2008)
Drupal - 6.1

Dubs

manmach’s picture

I am getting a browse button, but that launches the browser of FCKeditor, instead of the IMCE browser.

I had to enable basic and advanced file management of a profile at admin/settings/fckeditor/edit first.

sergiopasra’s picture

It seems that FCKeditor needs the function imce_integrate. From fckeditor.module:

  // integrate IMCE if it exists and is prefered
    if (function_exists('imce_integrate') && variable_get('imce_settings_fck', 0)) {
      imce_integrate('fck');
      $advanced_uploads = 0;
      $basic_uploads = 0;
    }

but the function is not defined

smh67’s picture

I have the same difficulties in pretty much the same setup (Drupal 6.1, IMCE-HEAD): "Browse Server" does not show up. However, I do get the "Browse Server" Button if I override FCKConfig manually (i.e. by hardcoding the lines

FCKConfig.ImageBrowser = true;
FCKConfig.ImageBrowserURL = '/imce/browse';

into fck_image.js, line 95, after window.onload-function ).

But the resulting imce/browse dialog does not show any way to add the selected picture to the original FCK dialog. I assume that the missing "Add" button might be a consequence of the improvised way of calling IMCE? At least that's why I did not open a new thread on a missing "Add" button.
Does anybody have a working Drupal 6.1-FCKEditor-IMCE-installation? Where would the Add button show up anyways? Thanks.

smh67’s picture

Title: FCKeditor does not show "browse" button for IMCE-HEAD » FCKeditor does not show "browse" button for IMCE-HEAD (w/ ugly patch)
FileSize
3.76 KB

ok. This is a very evil quick&dirty patch, but it does for me what it needs to do (i.e. get imce working with FCKEditor on Drupal 6.1). I'm really new to all of this, but here's what I figured the problem was:

  • imce.module: FCKEditor specifically asks if there is a function imce_integrate($editorname) to manage the integration of IMCE into FCK. In the IMCE-HEAD there was none, so I created one that sets a few javascript variables, integrates the imce_set_fck.js and makes sure that a function "imce2fck_init()" within this file gets called once the FCKEditors have been instanciated. Looking at older imce-version, I think this still comes somewhat close to how it's meant to work
  • imce_set_fck.js: This file was missing from imce-HEAD. The current version I made is terrible. It contains imce2fck_init() that uses document.getElementById to find all instances of oFCK FCKEditors and configures them to use imce. To do so, it most importantly sets the oFCK_x.Config.ImageBrowser true, and the ...BrowserURL to a decent value obtained from imce.module
  • imce/page.inc: In imce everything seems to be in place to transfer files back to the calling window. The javascript function imce_sendto() even allows to specify a routine to handle this. I didn't know how else to activate it, so I added a line in the inc-file to put some javascript in the header to call this function. Now, clicking a selected image in imce initiates the transfer of the file to the calling window (via the following)
  • js/imce.js: Added a function (again, similar to older imce versions) to manage the transfer back to FCKEditor

Most of the stuff, as I said, is ugly, hardcoded, and raw. It is certainly no good code. But maybe it helps people get inspired, or just get IMCE-HEAD (27 Feb 08) and FCKEditor on D6.x running until better code arrives. Copy the patch to your modules/imce; cd modules/imce; patch -p 2 -u -i imce-HEAD.FCKEditor.D6.patch

ufku’s picture

Title: FCKeditor does not show "browse" button for IMCE-HEAD (w/ ugly patch) » FCKeditor does not show "browse" button for IMCE-HEAD

Good news for the ones who are in a hurry to use fck-imce combo. A new method has been implemented to integrate IMCE into WYSIWYG editors. FCK users are lucky that FCK maintainers made it easy to set the filebrowser under configuration profiles. You just go to your fckeditor profile settings and add these lines to custom js configuration field under advanced settings:

LinkBrowserURL= '/?q=imce&app=FCKEditor|url@txtUrl';//this might be txtLnkUrl for some older versions
ImageBrowserURL= '/?q=imce&app=FCKEditor|url@txtUrl|width@txtWidth|height@txtHeight';
FlashBrowserURL= '/?q=imce&app=FCKEditor|url@txtUrl';

And also you should be running the latest IMCE HEAD version that contains the file js/imce_set_app.js

Please test it and dont forget to update this issue.

smh67’s picture

This seems to work very well for me! Thanks a lot!! Great work.

ufku’s picture

Status: Active » Fixed
garg_art’s picture

I placed the exact same code on my D6.1 and FCK 2.51 and IMCE Head dt 3/11/2008 and it did not work.
I removed the code and the native FCK file browser is back.......

The error I receive says -
File browser is not configured properly!

smh67’s picture

Maybe just a caching issue? I first had trouble with this. Did you try to insert the three lines into ~/modules/fckeditor/fckeditor.config.js directly?
Also, make sure to check (at least) the "Allow advanced file management:" to true

ufku’s picture

File browser is not configured properly!

This error is shown when there is no configuration profile assigned to user. In other words access denied.
And, yes, it should be changed to a more relevant error message.

ufku’s picture

forgot to mention that the message could appear when there were no directories specified in user's configuration profile.

garg_art’s picture

Thanks a lot smh67. This advanced file management is the problem. I wonder if its just me but it may be a good idea to point this out clearly in documentation. There are so many settings in Drupal that its like an airplane cockpit. Price one pays for powerful solution.

Thanks for your help.

ufku’s picture

in order to override advanced file management setting one has to add these lines:
LinkBrowser= true;
ImageBrowser= true;
FlashBrowser= true;
so the whole settings in custom js configuration are:

LinkBrowser= true;
ImageBrowser= true;
FlashBrowser= true;
LinkBrowserURL= '/?q=imce&app=FCKEditor|url@txtUrl';
ImageBrowserURL= '/?q=imce&app=FCKEditor|url@txtUrl|width@txtWidth|height@txtHeight';
FlashBrowserURL= '/?q=imce&app=FCKEditor|url@txtUrl';
garg_art’s picture

ufku rocks

This works like a charm now.

jeffsensat’s picture

With Drupal 6.1:
FCKEditor 2.5 installed and working fine.
IMCE HEAD installed and enabled.
FCKEditor 2.5 Basic and Advanced File Management enabled.
File overrides defined here written to sites/all/modules/fckeditor/fckeditor.config.js ...
All other FCKEditor instructions including myriad of hoop-jumping (I think) done. [Ahem, could this be a smidgen easier? :>. ]

Followed ALL instructions I could glean here and elsewhere. When clicking on FCKEditor “Insert/Edit Image” button, I’m getting an “Image Properties” popup window with the following URL:

http://mydomain.com/sites/all/modules/fckeditor/fckeditor/editor/fckdial...

When clicking the “Browse Server” button within that new window, I’m taken to a new popup window for this URL:

http://www.mydomain.com/?q=imce&app=FCKEditor|url@txtUrl|width@txtWidth|height@txtHeight

... which actually displays the non-Drupal index.html page at the root of my domain.

Drupal is installed here currently, as a subfolder of the primary domain, as I develop: http://www.mydomain.com/d6/

Tried also adding these to Administer / Site configuration / Edit FCKeditor profile “Custom javascript configuration:”

When I remove these, I’m taken here:

http://mydomain.com/d6/sites/all/modules/fckeditor/fckeditor/editor/file...

... which displays a blank FCKEditor browser window. No files to choose from.

It hurts. It hurts so BAD.

ufku’s picture

change the URLs int he settings to '/d6/?q=....' or to Drupal.settings.basePath +'?q=....'

Good news is that, you wont be needing these settings for the next release of fckeditor, as the IMCE integration will be among the settings and easy as a single click.

jeffsensat’s picture

That worked ufku!

Two more questions:

01) Like FCKEditor, IMCE is using the same CSS file as the site to draw its background, which is VERY hard to read. I had to tell FCKEditor to use its own FCKEditor default CSS so I FCKEditing was legible and possible. Any idea how to do the same with IMCE?

02) Once I go from PRODUCTION to LAUNCHING the site (and move it out of the current mydomain.com/sub/ folder directly into mydomain.com), all the links to embedded images will change, won’t they? How will I address that?

THANKS.

jeffsensat’s picture

Actually, I was able to go into the IMCE CSS file and alter the background color ... all is well!

(Now if I could just get a RIGHT-ALIGNED image to show up as RIGHT-ALIGNED! This must be an FCKEditor issue, so now I’m off to solve THAT problem.)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.