// JS
CKEDITOR.instances['body'].config.filebrowserBrowseUrl = '/adminisatrator/library/explorer.php';
// PHP explorer.php
//... get information: $arrDirs, $arrFiles
// List dirs
// List files
foreach ($files as $file) {
echo '<a href="javascript:void(0);" onclick="sendToCKEditor();">File name</a><br />';
}
<script type="text/javascript">
// customize this function, add params you need
function sendToCKEditor() {
if (!window.opener) return;
window.opener.CKEDITOR.tools.callFunction(<?php echo $_GET['CKEditorFuncNum']; ?>, 'http://huypv.net/storages/images/moon.jpg');
//window.opener.CKEDITOR.instances['<?php $_GET['CKEditor'] ?>'].insertHtml('html content here');
window.close();
}
</script>
Title:
Setup CkEditor file browser
Description:
// JS CKEDITOR.instances['body'].config.filebrowserBrowseUrl = '/adminisatrator/library/explorer.php'; // PHP explorer.ph...
...
Rating:
4