1
Knowledgeroot / Re: How to enable Upload of images in CKEditor in Version 1.6
« Last post by thr4fun on June 26, 2018, 09:46:18 AM »Hallo,
ich habe mal einen Workaround, der mein Problem vorerst mal löst
https://github.com/Studio-42/elFinder/wiki/Integration-with-CKEditor
Den elFinder ins Knowledroot-Verzeichnis "extension/elFinder" legen.
Dann die Methode 2 anwenden und die config.js des CKEditors anpassen.
config.filebrowserBrowseUrl = './extension/elFinder/elfinder-cke.html'; // eg. 'includes/elFinder/elfinder-cke.html'
Danach die elfinder-cke.html umkopieren und editieren. managers : { }
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {
getFileCallback : function(file, fm) {
window.opener.CKEDITOR.tools.callFunction((function() {
var reParam = new RegExp('(?:[\?&]|&)CKEditorFuncNum=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
})(), fm.convAbsUrl(file.url));
fm.destroy();
window.close();
}
, height : '100%' // optional
, resizable : false // optional
}
}
Im elFinder Verzeichnis noch die Datei connector.minimal.php-dist -> connector.minimal.php kopieren:
./elFinder/php/connector.minimal.php
und das Verzeichnis auf das Knowlederoot ./uploads/ Verzeichnis setzen:
// Documentation for connector options:
// https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
$opts = array(
// 'debug' => true,
'roots' => array(
// Items volume
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../../../uploads/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../../uploads/', // URL to files (REQUIRED)
'trashHash' => 't1_Lw', // elFinder's hash of trash folder
'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
'uploadDeny' => array('all'), // All Mimetypes not allowed to upload
'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
),
// Trash volume
array(
'id' => '1',
'driver' => 'Trash',
'path' => '../../../uploads/.trash/',
'tmbURL' => dirname($_SERVER['PHP_SELF']) . '/../../../uploads/.trash/.tmb/',
'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
'uploadDeny' => array('all'), // Recomend the same settings as the original volume that uses the trash
'uploadAllow' => array('image', 'text/plain'),// Same as above
'uploadOrder' => array('deny', 'allow'), // Same as above
'accessControl' => 'access', // Same as above
)
)
);
CU
Tom
ich habe mal einen Workaround, der mein Problem vorerst mal löst

https://github.com/Studio-42/elFinder/wiki/Integration-with-CKEditor
Den elFinder ins Knowledroot-Verzeichnis "extension/elFinder" legen.
Dann die Methode 2 anwenden und die config.js des CKEditors anpassen.
config.filebrowserBrowseUrl = './extension/elFinder/elfinder-cke.html'; // eg. 'includes/elFinder/elfinder-cke.html'
Danach die elfinder-cke.html umkopieren und editieren. managers : { }
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {
getFileCallback : function(file, fm) {
window.opener.CKEDITOR.tools.callFunction((function() {
var reParam = new RegExp('(?:[\?&]|&)CKEditorFuncNum=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
})(), fm.convAbsUrl(file.url));
fm.destroy();
window.close();
}
, height : '100%' // optional
, resizable : false // optional
}
}
Im elFinder Verzeichnis noch die Datei connector.minimal.php-dist -> connector.minimal.php kopieren:
./elFinder/php/connector.minimal.php
und das Verzeichnis auf das Knowlederoot ./uploads/ Verzeichnis setzen:
// Documentation for connector options:
// https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
$opts = array(
// 'debug' => true,
'roots' => array(
// Items volume
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../../../uploads/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../../uploads/', // URL to files (REQUIRED)
'trashHash' => 't1_Lw', // elFinder's hash of trash folder
'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
'uploadDeny' => array('all'), // All Mimetypes not allowed to upload
'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
),
// Trash volume
array(
'id' => '1',
'driver' => 'Trash',
'path' => '../../../uploads/.trash/',
'tmbURL' => dirname($_SERVER['PHP_SELF']) . '/../../../uploads/.trash/.tmb/',
'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
'uploadDeny' => array('all'), // Recomend the same settings as the original volume that uses the trash
'uploadAllow' => array('image', 'text/plain'),// Same as above
'uploadOrder' => array('deny', 'allow'), // Same as above
'accessControl' => 'access', // Same as above
)
)
);
CU
Tom