FCK Integration

sgware - June 21, 2007 - 16:58
Project:Web File Manager
Version:6.x-2.10-rc4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Would it be possible to add a feature (sub-module?) to WebFM that would allow it to be used instead of the default file browser for FCK WYSIWYG editor? The FCK editor is not so great. I want to be consistent throughout my site, so if I use WebFM to manage and upload files, I would need it to be the file selector also when using FCK.

The first (and perhaps hardest) step would be getting WebFM to stand alone in its own window, rather than on a Drupal page. That way WebFM could be used as a pop-up box. Getting it to pass the selected file URL to FCK might not be too hard. I tried just making a stand-alone php page calling the webfm menu callbacks, but no dice. If you can tell me how to get WebFM in its own windows without all the Drupal blocks and headers/footers, I might be able to write this sub-module.

#1

andremolnar - June 21, 2007 - 18:49

I am on the verge of releasing a couple of webfm extension modules. One of them adds webfm as the file browser to TinyMCE. In theory it shouldn't be hard to do the same thing for FCK.

The extra modules are:
webfm_images - which adds some context menu items to resize images to admin defined sizes
webfm_cck - which creates a webfm cck field type - so that files can be added as fields instead of attachments - it even allows the display of image files as images
and webfm_popup - that pops up a file browser to work with webfm_cck field type - and tinyMCE

andre

#2

ontwerpwerk - July 9, 2007 - 15:58

the IMCE module does it too, so integration with FCKeditor would work if you take that approach

#3

andremolnar - July 9, 2007 - 16:47

#4

Eikaa - November 18, 2008 - 17:32
Version:5.x-1.x-dev» 6.x-2.10-rc2

figured out how to put the webfm in a popup which can be used to insert images into a rich text editor. it's usage is similar to imce, only the url is different. after installing you can see it on the page:

http://example.com/drupalroot/webfm/webfmpopuptest

look into the code for details...

AttachmentSize
webfmpopup.tar_.gz 1.91 KB

#5

redndahead - December 17, 2008 - 21:04

Great module Eikaa.

I took your module and removed the test stuff. I also made a couple of fixes in sending back to the editor. It wasn't returning the full path only relative to the webfm base directory. It also would only return the fid instead of webfm_send/fid. I also added help instructions on how to integrate it with FCKEditor. A simple 4 step process.

It seems this popup functionality would be simple to add into webfm. robmilne, if you're interested I'll try to work on a patch.

AttachmentSize
webfmpopup.tar_.gz 1.98 KB

#6

robmilne - December 31, 2008 - 22:05

Looks really good but I had to use these FCKeditor profile advance options settings rather than the ones suggested in your help:

LinkBrowser= true;
ImageBrowser= true;
FlashBrowser= true;
LinkBrowserURL= getBasePath() + '/?q=webfmpopup&webfmid=txtUrl';
ImageBrowserURL= getBasePath() + '/?q=webfmpopup&webfmid=txtUrl';
FlashBrowserURL= getBasePath() + '/?q=webfmpopup&webfmid=txtUrl';

Also I also changed the following in webfmpopup.js because it was causing problems:

//  console.log(fid);

The 6.x demo site now has FCKeditor enabled - thanks!

#7

lsrzj - February 9, 2009 - 13:21
Version:6.x-2.10-rc2» 6.x-2.10-rc4
Category:feature request» bug report

I installed webfm rc4 and I tried to use FCKEditor integration with no success following the help steps. When I paste that code in advanced options in FCKEditor it fails to start. Any suggestion? Another thing, it would be nicer to have FCKEditor integration the same way as IMCE, through an option added to FCKEditor options under file browser.

PS: Sorry for the duplicate, but my internet seemed that stoped working so I pressed post comment twice and I have no option to delete my own published posts. (I think I should have that option, why not enable this for users?)

#8

lsrzj - February 9, 2009 - 13:15

I installed webfm rc4 and I tried to use FCKEditor integration with no success following the help steps. When I paste that code in advanced options in FCKEditor it fails to start. Any suggestion? Another thing, it would be nicier to have FCKEditor integration the same way as IMCE, through an option added to FCKEditor options under file browser.

#9

lsrzj - February 9, 2009 - 13:16

I installed webfm rc4 and I tried to use FCKEditor integration with no success following the help steps. When I paste that code in advanced options in FCKEditor it fails to start. Any suggestion? Another thing, it would be nicer to have FCKEditor integration the same way as IMCE, through an option added to FCKEditor options under file browser.

#10

robmilne - February 9, 2009 - 22:24

Perhaps redndahead can comment. For the demo site my advanced options are:

LinkBrowserURL= getBasePath() + '?q=webfm_popup&webfmid=txtUrl';
ImageBrowserURL= getBasePath() + '?q=webfm_popup&webfmid=txtUrl';
FlashBrowserURL= getBasePath() + '?q=webfm_popup&webfmid=txtUrl';

There seems to be a '/' attached to the end of the return from getBasePath().

#11

redndahead - February 10, 2009 - 04:22

I'm currently trying to work on a patch and I noticed you added the popup module as well as integrating it into the core webfm module is there a reason for that?

#12

lsrzj - February 10, 2009 - 13:00

Here's what I'm pasting into the FCKEditor's advanced configuration with no success to start FCK. I enabled the module in the modules list, and I checked that if I go to www.example.com/webfm_popup webfm executes without problems. Is there something more that I have to do to make it work with FCK?

LinkBrowser= true;
ImageBrowser= true;
FlashBrowser= true;
LinkBrowserURL= getBasePath() + '?q=webfm_popup&webfmid=txtUrl';
ImageBrowserURL= getBasePath() + '?q=webfm_popup&webfmid=txtUrl';
FlashBrowserURL= getBasePath() + '?q=webfm_popup&webfmid=txtUrl';

Regards!

#13

robmilne - February 10, 2009 - 14:43

I thought it was logical place to put it - perhaps I'm wrong. Would it be better to add to FCK module?

#14

redndahead - February 10, 2009 - 18:21

#13 What I'm saying is the module is duplicating the functionality you added to the core. What I would do is remove the popup module. And we can try to integrate into fckeditor the same was imce does. I'm going to try and look at what is possible tonight and hopefully have something for you tomorrow.

#15

redndahead - February 10, 2009 - 18:24

Forget about that integrate into fckeditor like imce I forgot fckeditor holds the setting for turning on imce and not the other way around.

#16

attiks - February 12, 2009 - 20:35

See #373598: Wysiwyg - TinyMCE integration for the integration with tinymce

#17

ntripcevich - February 19, 2009 - 17:01

It's wonderful that you've added support for WYSIWYG editors but I'm unclear on how to activate it in FCKeditor. Do we set FCKeditor's "File browser" settings to Nothing or Built-in? Ideally WebFM would show up in that list but it hasn't been so in my installation. When I paste in the code above FCKEditor simply doesn't show up anymore.
Is there documentation on activating this new feature in WebFM that I haven't spotted? Thanks.

#18

robmilne - February 19, 2009 - 17:46

Look under 'help' in administer menu.

#19

ntripcevich - February 20, 2009 - 18:49

Thanks RobMilne. Yes following those instructions causes FCKEditor to not appear on my installation with WebFM popup module. I notice that there are no User permissions options for WebFM Popup module (perhaps they're integrated with WebFM?).

#20

redndahead - February 21, 2009 - 05:32

Here is the line fixes. These work for me.

LinkBrowser= true;
ImageBrowser= true;
FlashBrowser= true;
LinkBrowserURL= Drupal.settings.basePath + '?q=webfm_popup&url=txtUrl';
ImageBrowserURL= Drupal.settings.basePath + '?q=webfm_popup&url=txtUrl';
FlashBrowserURL= Drupal.settings.basePath + '?q=webfm_popup&url=txtUrl';

#21

redndahead - February 21, 2009 - 06:53

Added patch to fckeditor queue to add webfm support to the file manager dropdown menu. #379088: Add support for webfm

#22

redndahead - February 21, 2009 - 07:02

By the way if #20 works for people I think we can mark this issue as fixed.

#23

ntripcevich - February 23, 2009 - 19:27
Status:active» fixed

Yes, it works! The "Browse Server" button opens the WebFM popup.
Thanks! This is really slick.

#24

redndahead - February 24, 2009 - 23:20
Status:fixed» needs review

I should have said it should be closed once the documentation is updated.

Robmilne can you update the help documentation to reflect the change that's in #20?

Also if we could get another rc soon, although I know it's a quick turnaround, then I can point the fckeditor folks on which version of webfm is needed to test.

#25

redndahead - February 24, 2009 - 23:20
Status:needs review» reviewed & tested by the community

eh let's make it rtbc

#26

higherform - February 25, 2009 - 14:57

with settings from #20, the URL sent to FCKeditor now looks like:

/*drupal_file_path*/*webfm_root*/*role_dir*/*filename*.ext

instead of

/webfm_send/*fileid*

even for files with perm = 0 .

How do we change this back to the webfm_send url? Or better yet can we make the module smart enough to send "public download" files to FCKeditor as *path*/*filename*.ext and all protected files as /webfm_send/*fileid* ? . With proper apache .htaccess / httpd.conf and /public/ vs /private/ subfolders, this would give the best combination of user-controlled security and performance for us and I imagine many others as well....

#27

higherform - February 25, 2009 - 15:13
Status:reviewed & tested by the community» needs work

#28

redndahead - March 11, 2009 - 14:51

FYI webfm is now an option in fckeditor. Wahoo! Not sure on the private file issue.

@robmilne can you give more insight on how the private file works?

#29

higherform - March 14, 2009 - 16:02
Status:needs work» reviewed & tested by the community

Red -

Thanks for the update. If nothing else, it reminded me to come back here and share my results. The problem with it not respecting the "&webfmid=txtUrl " on certain files was actually a result of the target file's database entry not matching its real path. As soon as I cleared that up, it worked as expected. I will open a separate feature request for the "by file permission setting controls" idea.

I would recommend:
- better documentation of the &webfmid=txtUrl setting
- better error-handling for the file not in db / file's path db entry being invalid
- unless anyone else has a blocker issue, I support rc4 becoming an official release.

Good job to the community, this is a huge boon to the user-friendliness of our clients' sites

#30

Hillfire - March 24, 2009 - 20:17

I am having the same issue higherform had. When I click "Send to rich-text editor" it sends the real path rather than the /webfm_send/ url. I am using webfm rc4 and FCK beta1. I have tried setting the FCKEditor File Browser to "Web File Manager" and using the advanced config setting outlined in this thread without any success. Also, the "path to upload files" setting in FCKEditor config is set to "%b%f/" which just doesn't seem right.

higherform, if you see this, could you give an example of what the database entry's path was and what it had to be changed to for this to work?

If there is anything else I can provide to help, just ask. Thanks.

#31

mcneill - April 9, 2009 - 20:36

I've come across another path related issue when using rc4 with FCK 6.x-1.3 (and WebFM selected in FCK config as the file browser).

I have a role setup to allow a group of users other than administrators to edit content. With the WebFM root set to "webfm" and the role root set to "general", the txtURL returned from webfm_popup should be something like "/sites/default/files/webfm/general/picture.jpg". What is coming back instead is "/sites/default/files/general/picture.jpg". WebFM root is being left out of the path.

I've tried leaving the role root blank, but then webfm_popup shows me no files or directories.

#32

fombas - April 13, 2009 - 09:52
Status:reviewed & tested by the community» needs review

I encountered a similar issue when setting up webfm with fckeditor. When linking to uploaded files in fck (via browse server and send to rich text editor), i do not get a /webfm_send/ url but a url that points to the path on the server (such as the "/sites/default/files/webfm/general/picture.jpg" example in the previous post). This also means that when we move files in web file manager, these links break. Could someone (higherform?) post a howto on the changes that are required to overcome this issue?

In addition, i ran into the same problem as mcneil (31) for roles that do not have access to the root webfm directory.

It may be relevant to know that i am currently using several other modules, including pathauto.

I am really anxious to get this to work... are there any solutions to these issues yet? Please let me know if you need more information on settings or configuration. Thanks!

#33

mcneill - April 13, 2009 - 18:30

fombas and Hillfire,

If you want webfm_popup to send back a /webfm_send/ url adding the entries from post #20 under the "Advanced Options" fieldset of your FCK profile, but changing 'url=txtUrl' to 'webfmid=txtUrl', should do the trick.

#34

fombas - April 22, 2009 - 07:01

Thanks mcneil, that indeed solved the problem. We seem to be able to move files without a problem now.

I do, however, have one more question that i would like to bring up: Is it somehow possible to grant roles the right to create directories and add files / folders to the database without allowing them full admin rights over the webfm module? In particular, our folder structure is set up in a way that certain roles should only be allowed to see a certain subtree of the webfm directory. However, all users should be able to create directories within their subtree. Also, they should be able to add ftp / nfs uploaded files to the database (currently, they are unable to see these files). When i give them admin rights, however, they will be able to change the root directories themselves, so the system is no longer secure.

Since this is not really a fckeditor specific post, i might also post this question as a new issue or in a more appropriate existing issue.

Many thanks

#35

robmilne - April 27, 2009 - 21:57

Just to make things clear, my version in comment#6 is what people should be using if they wish to use the module securely. Defeating file security with 'url=txtUrl' won't work if .htaccess is guarding the files.

#36

kenorb - June 3, 2009 - 11:45
Category:bug report» feature request

#37

mas160 - June 29, 2009 - 12:15
Category:feature request» bug report

I have a similar (same?) issue mcneill in #31 had.
I need to set up several roles permitted to edit nodes and insert images in them.
Once selected "Send to rich text editor" value in textbox lacks the webfm root dir, it seems the variable "fpath" in method webfm_popup.sendtocaller has an incorrect value, e.g. is starting from role root path and not from webfm root path.
Same behavior for file attachments via webfm.
For builtin admin user all things go right.

OT: I'm italian, so I apologize for my ugly english.

#38

higherform - July 14, 2009 - 20:26

A (new?) issue with webfmpopup called from fckeditor:

When:
- using webfmpopup to browse a very large directory (~250 files in it), and
- right-clicking a file more than "one screen height" from the top...

The right click context menu does not show up adjacent to the cursor, but rather with an offset top: XXXpx css value that keeps it within the "first screen height" of the top. Subsequent right-clicks on other files earlier in the list keep the same incorrect offset.

I am seeing this behavior in:
- FF3.5 on ubuntu
- FF3.0 on windows
- IE7 on windows (though the "offset" disappears when right-clicking a file within the first screen height)

Did not test in opera as right-click context has never worked for that browser...

I attempted troubleshooting via the following means with no success:
- Clearing Caches via site performance
- re-download and re-untar rc4 from drupal.org
- Turn off css and js optimizations, page compression, caches via site performance

Environment: D6.12, webfm rc4, webfm image rc4, webfm popup rc4, php 5.2.6

#39

robmilne - July 20, 2009 - 21:10

I fixed this by placing this at the top of the webfm-popup.tpl.php template

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">

Will get included into the next update that I'm trying to find time for

#40

robmilne - July 22, 2009 - 05:17
Status:needs review» fixed

In rc5

#41

higherform - July 22, 2009 - 16:42

That looks like it took care of it in FF3 under both win and ubuntu... will check out the rest when I get a chance. thanks rob

#42

System Message - August 5, 2009 - 16:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.