CKEditor and elFinder Integration Example

I try to follow instructions on elfinder.org how to integrate CKEditor with elFinder, but not work. is there a CKEditor example that was integrated with elFinder, if anyone knows, please share it.

thanks

+4
source share
2 answers

I found an example with CKEditor and elFinder: http://elrte.org/redmine/attachments/409/elfinder.html

$().ready(function() { var funcNum = window.location.search.replace(/^.*CKEditorFuncNum=(\d+).*$/, "$1"); var langCode = window.location.search.replace(/^.*langCode=([az]{2}).*$/, "$1"); $('#finder').elfinder({ url : 'connectors/php/connector.php', lang : langCode, editorCallback : function(url) { window.opener.CKEDITOR.tools.callFunction(funcNum, url); window.close(); } }) }) 
+1
source

This can be useful if you are using CKFinder. Try the following steps. 1. Download CKEditor and CKFinder. Integrated code may be available at http://dwij.co.in/ckeditor-ckfinder-integration-using-php/
2. Place the extracted code in the same folder inside xampp, as well as below. 3. Create an index file (index.html) that will contain the editor, as shown below.

  <html> <head> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript" src="ckfinder/ckfinder.js"></script> </head> <body> <h1>CKEditor CKFinder Integration using PHP</h1> <textarea id="editor1" name="editor1" rows="10" cols="80"></textarea> <script type="text/javascript"> var editor = CKEDITOR.replace( 'editor1', { filebrowserBrowseUrl : 'ckfinder/ckfinder.html', filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?type=Images', filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?type=Flash', filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images', filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash' }); CKFinder.setupCKEditor( editor, '../' ); </script> </body> </html> 

so your folder structure will be something like this:

  htdocs
 | _integrated
     | _ckeditor
     |  | _config.js
     |  | _...
     | _ckfinder
     |  | _config.php
     |  | _...
     | _uploads
     | _index.html
  • Now open the config.php file inside ckfinder and make the following changes:

     function CheckAuthentication() { // WARNING : DO NOT simply return "true". By doing so, you are allowing // "anyone" to upload and list the files in your server. You must implement // some kind of session validation here. Even something very simple as... // return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized']; return true; // not good option though; go for sessions } $baseUrl = 'http://localhost/integrated/uploads/'; $enabled = true; $config['SecureImageUploads'] = false; $config['ChmodFolders'] = 0777 ; 
  • Now open the url http://localhost/integrated/ and try loading the image.
-3
source

Source: https://habr.com/ru/post/1483133/


All Articles