ローカルの xampp サーバーにelFinder v2.1 File Managerをインストールしました。すべてがうまくいっているようです。以下は私のconnector.phpです。
function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0
? !($attr == 'read' || $attr == 'write')
: null;}
$emp_id = 'sm_dir_name';
$opts = array(
'bind' => array(
'mkdir mkfile rename duplicate upload rm paste' => array($myLogger, 'log'),
),
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => '../../lib/lib_emp/'.$emp_id,
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../lib/lib_emp/'.$emp_id,
'accessControl' => 'access',
'uploadOverwrite'=> false,
'debug' => false,
'arc' => '7za',
'fileURL' => true,
etc...;
これは、elFinder を初期化する index.php ファイルです。
$(document).ready(function() {
var elf = $('#elfinder').elfinder({
url : 'css/connector.php',
commandsOptions : {
edit : {
mimes : ['text/plain', 'text/html', 'text/javascript', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'], //types to edit
editors: [{
mimes : ['text/plain', 'text/html', 'text/javascript', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
load: function(textarea) {
$(textarea).ckeditor();
},
close: function(textarea, instance) {
CKEDITOR.instances[textarea.id].destroy();
},
save: function(textarea, editor) {
textarea.value = $(textarea).val();
}
}
]
}
}
}).elfinder('instance');
});
以下のような質問があります。
- ページの読み込み時に elFinder の自動読み込みを無効にする方法は?
- elfinder を開始して、選択したディレクトリ名でロードする方法 (クライアントは $post メソッドと同様にサーバーに値を送信する必要があります)
customData : {token : '42', test : 'test'},
elFinder の開始で使用できると思います。これらの値を connector.php から取得する方法がわかりません。ユーザーが load_emp ボタンをクリックするたびに、elFinder が更新され、選択したディレクトリに移動する必要があります。
私は1か月以来、これとelFinderについてさらに多くを検索しています。elFinder 開発者チームのドキュメントとサポートは非常に貧弱です。
この質問だけでなく、今後の質問にもお答えいただければ幸いです。
よろしくお願いします、
スパン