Hello,
I am currently researching how to integrate CKFinder with CKEditor using the wysiwyg module. I am getting close to hacking a solution but thought I would start a discussion with the community and the module maintainers for a sub-module.
In the past some of the WYSIWYG editors required you configure a file manager via server-side configuration files. More recently with Ckeditor you are required to register the file manager on the instance of the editor in the DOM of the browser (http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28U...). This is attractive in that you could in theory use any file manager with the editor.
Proposal:
1. Create a module called wysiwyg_filemanager
2. The purpose of the module is to provide a centralized management interface to registering file managers both 3rd party and provide bridges for Drupal life and media management modules.
3. File managers would be located in a similar manor to editors /sites/all/libraries/.
4. A configuration interface should be provided to register file managers
5. A configuration interface should be provided to assign a file manager to a supported wysiwyg editor
The possiblities for this module would perhaps have one or more drupal modules provided both management and uploading of media. For example providing a bridge between filefield and web file manager (although currently not viable)
Or using CkFinder or other managers to centerally manage all files and media for a Drupal site.
Let's use this issue to discuss the design and perhaps even code samples.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | ftd_module_list.txt | 18.31 KB | decibel.places |
| #19 | ckfinder_broken.jpg | 23.65 KB | decibel.places |
Comments
Comment #1
emptyvoid commentedPerhaps this would just be a plug-in using the Libraries API?
http://drupal.org/project/libraries
.. As a note in order to get the CKFinder to work in Drupal I had to modify the config.php within the source code to become aware of drupal.
Authentication only works if you have set a cookie name for your Drupal website in /sites/default/settings.php.
Now the last part:
1) Create a module to load the ckfinder js file.
2) Modify the javascript file for the editor in the wysiwyg module /wysiwyg/editors/js/ckeditor-3.0.js
The CKFinder section attaches the ckfinder library to an instance of the wysiwyg editor! :)
Comment #2
emptyvoid commentedChanging name so people will find the comments on integration.
Comment #3
emptyvoid commentedComment #4
mrfelton commentedI too am interested in this. CKFinder provides a much slicker interface than IMCE.
Comment #5
klonosme too... subscribing
Comment #6
sunThe native file browsers/uploaders are purposively not supported by Wysiwyg module. However, if you really insist on wanting to use this, then feel free to create a contributed module that acts as bridge between Wysiwyg and CKFinder. If anything is needed in Wysiwyg module to make this bridge happen, just let us know.
Comment #7
sentogi commentedCheckAuthentication() is ok but I think we should make the baseURL and baseDir vars dynamic for multi-sites structures. you may use file_directory_path() drupal function to realize it.
First ; all we need is drupal common function in ckfinder/config php to be able to use file_directory_path() function
And second ; set the baseURL and baseDir by using file_directory_path() function
That's it. you can use your ckfinder for all sites withour any code change..
Comment #8
decibel.places commentedsubscribe
I heard latest wysiwyg supports ckeditor - but not without all this rigamarole to get the file browser connected!
It's back to using the regular ckeditor module until this works without hacking!
Comment #9
nauthiz693 commentedI tried the method you proposed in comment #1, and it worked for me, but I was wondering about the line,
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);If all you want is the current logged in user, wouldn't it work to do:
drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);This would skip like three or four steps of the bootstrap process and would probably be faster.
Comment #10
that0n3guy commentedsub...
Comment #11
Fidelix commentedSub
Comment #12
richsky commentedSeem not to work.
file_directory_path() is found in file.inc (drupal 6) but it doesn't help
I'd really like to figure out how to have ckfinder using right $base_directory ($baseDir) for each virtual site we may have in a multisite installation.
Comment #13
locomo commentedsubscribe
Comment #14
emptyvoid commentedFor those interested I ended up leveraging the IMCE module instead as it provides integrated security and permissions within Drupal.
http://drupal.org/project/imce
http://drupal.org/project/imce_wysiwyg
Comment #15
decibel.places commentedAt a drupalnyc meetup a few months ago, someone, I think it was jensimmons, noted that CKFinder does not integrate the images with the Drupal image system - they are just uploaded as embedded files, with no imagecache etc. I think nikkiana stated there is a module that will automatically resize enormjous images uploaded by unknowing users http://drupal.org/project/image_resize_filter but that only reduces bandwith.
For knowledgeable admins, CKFinder remains a quick way to embed images in a post..
has anybody tried wysiwyg_imageupload? http://drupal.org/project/wysiwyg_imageupload
Comment #16
jrsinclair commentedAs suggested by @sun in #6, I've created a bridging module for WYSIWYG, CKEditor and CKFinder, to make this whole process a little easier. We'd love people to try it out and let us know how it goes-- just make sure that you read the installation instructions carefully.
Comment #17
digitalfrontiersmediajrsinclair YOU...SAVED...MY...BACON! Honestly, I was thinking I don't have time due to my client's timeframe to figure out what would be required for this. I was just starting to get depressed that here it is 2011 and after 4 years with Drupal I'm having WYSIWYG headaches again, and then there you are with your module! I prefer using WYSIWYG & then have a choice of editors if possible. I prefer a system that works well with Better Formats as WYSIWYG does. But wysiwyg_upload_image doesn't work in blocks, IMCE is confusing to my users/clients, I prefer CKEditor over the others if I have a choice, and thus after 4 years of Drupal builds, I'm still left with few to no options for easy image uploads for my users/clients...until now!
I just followed your instructions, and it seems to work well so far. Works in blocks, too! :-)
Excellent work, my friend. You deserve a cookie, but since you're not here, I'll have one for you in celebration of saving me gobs of time sorting this out!
Thank you for sharing this effort!
Comment #18
decibel.places commentedjrsinclair - will you be adding the module as a contrib module managed by update and drush (maybe after the Git migration?)
Comment #19
decibel.places commentedI installed the bridge module carefully and I am getting a similar bug in the upload dialog to a problem I had with the wysiwyg_imageupload module #1068984: wysiwyg_imageupload popup dialog broken
Perhaps it is a JavaScript or jQuery problem.
see attached screencap and module list
//addendum//
Further testing, including on clean 6.20 install, I still could not get the bridge working.
In IE8 I got the error:
so I moved ckfinder to sites/all/libraries/ckfinder/ckfinder
(top ckfinder directory contains only ckfinder library directory)
and it works - did I miss something in the docs?
Comment #20
jrsinclair commented@decibel.places Where did you have ckfinder installed before?
Comment #21
decibel.places commentedI upgraded from using FCKeditor + its file browser in sites/all/modules to using Wysiwyg with CKeditor and CKfinder in sites/all/libraries
I disabled, uninstalled, and removed FCK before upgrading
CKfinder was not found in sites/all/libraries/ckfinder then I noticed the error above looking for it in sites/all/libraries/ckfinder/ckfinder
I noticed that after I moved CKfinder to sites/all/libraries/ckfinder/ckfinder and enabled your module bridge, the config files were created in sites/all/libraries/ckfinder and had to be moved to sites/all/libraries/ckfinder/ckfinder
justsaying
Comment #22
newrooky commentedDid you have any luck getting Ckfinder to recognize proper base file directories for multisite installations. It is not good practice to load everything into a single folders from al sites and would present big migration issues when we want to separate sites to different servers.
The fix in #7, as mentioned, doesn't work and will spur and error.
Anyone have ideas?
-b
Comment #23
twodThis is still a "won't fix" from Wysiwyg's perspective, see #6.
I have not used CKFinder so I don't know what it'll take to set it up, but posting the errors you get will make it easier for those who do to help you.
Btw, the code in #16 would be a nice to have as a sandbox project here on drupal.org. Then it'll also get its own issue queue. :)
Comment #24
vaccinemedia commentedI used the awesome module by jrsinclair at
http://www.opc.com.au/web-development/wysiwygckeditorckfinder-bridge-mod...
And had the same problem as in #21 and resolved it by changing the paths in the module file wysiwyg_ckeditor_ckfinder_bridge.module by removing the ckfinder part i.e. change line 17 from
. '/ckfinder/core/connector/php/connector.php?' to
. '/core/connector/php/connector.php?'
Comment #25
Makea commentedThis definitely work with Drupal 5 with the following mod:
In the file /wysiwyg/editors/js/ckeditor-3.0.js:
Change "SetupCKEditor" to "setupCKEditor" (with a lowercase 's')
Read more about it here:
http://cksource.com/blog/CKEditor_for_jQuery
Comment #26
jrsinclair commented@TwoD The bridging module now has its own sandbox on Drupal.org at: http://drupal.org/sandbox/jrsinclair/1348830
Comment #27
jrsinclair commentedFor anyone who has been following this thread, the bridging module has been released as a full Drupal module on drupal.org. You can find it at http://drupal.org/project/WYSIWYG-CKFinder
Comment #28
edwinyn commented@jrsinclair you're rock.. it's work. I used your bridge download from Github.
Since I use Open Atrium, I just modified the .info file to be able to be recognized on Drupal 6.x.
Comment #29
jrsinclair commented@edwinyn If you're using the module with D6, you may want to take a look at the permissions and double check that they're working as you expect. The permissions model changed between D6 and D7 and the code for one won't work with the other :-(