Line 15: | Line 15: | ||
To send back the file url from an external file browser, simply call <code>CKEDITOR.tools.callFunction</code> and pass there CKEditorFuncNum as the first argument: | To send back the file url from an external file browser, simply call <code>CKEDITOR.tools.callFunction</code> and pass there CKEditorFuncNum as the first argument: | ||
− | CKEDITOR.tools.callFunction( funcNum, fileUrl [, data] ); | + | window.parent.CKEDITOR.tools.callFunction( funcNum, fileUrl [, data] ); |
If data (the third argument) is a string, it will be displayed by CKEditor (usually used to display an error message if problem occurs during file upload). | If data (the third argument) is a string, it will be displayed by CKEditor (usually used to display an error message if problem occurs during file upload). |
Revision as of 13:03, 21 December 2009
CKEditor can be easily integrated with your own file browser.
To connect already compatible file browser with CKEditor (like CKFinder), simply follow the File Browser (Uploader) documentation.
Interaction between CKEditor and File Browser
CKEditor sends automatically some additional arguments to the filebrowser:
-
CKEditor
- name of the CKEditor instance -
langCode
- CKEditor language ("en" for English) -
CKEditorFuncNum
- anonymous function number used to pass the url of a file to CKEditor
CKEditor=editor1&CKEditorFuncNum=1&langCode=en
Passing the URL of selected file
To send back the file url from an external file browser, simply call CKEDITOR.tools.callFunction
and pass there CKEditorFuncNum as the first argument:
window.parent.CKEDITOR.tools.callFunction( funcNum, fileUrl [, data] );
If data (the third argument) is a string, it will be displayed by CKEditor (usually used to display an error message if problem occurs during file upload).