-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Integration with CKEditor
troex edited this page May 4, 2012
·
31 revisions
You must tell CKEditor you where the file manager is.
CKEDITOR.replace( 'editor1', {
filebrowserBrowseUrl : 'path/to/editor/file', // eg. 'includes/elFinder/elfinder.html'
uiColor : '#9AB8F3'
});
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.filebrowserBrowseUrl = 'includes/elFinder/elfinder.html';
};
Replace next code in elfinder.html
<!-- elFinder initialization (REQUIRED) -->
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var elf = $('#elfinder').elfinder({
url : 'php/connector.php' // connector URL (REQUIRED)
// lang: 'ru', // language (OPTIONAL)
}).elfinder('instance');
});
</script>
with this
<script type="text/javascript" charset="utf-8">
// Helper function to get parameters from the query string.
function getUrlParam(paramName) {
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
}
$().ready(function() {
var funcNum = getUrlParam('CKEditorFuncNum');
var elf = $('#elfinder').elfinder({
url : 'php/connector.php',
getFileCallback : function(file) {
window.opener.CKEDITOR.tools.callFunction(funcNum, file);
window.close();
},
resizable: false
}).elfinder('instance');
});
</script>
http://elfinder.org/forum/#/20110728/integration-with-ckeditor-759177/
http://forrst.com/posts/Elfinder_2_0_beta_filemanager_for_the_web_Ex-PPS