我试图禁用elfinder中的mkdir选项。我只是想上传在我的(根)文件夹允许。下面的解决方案不会禁用mkdir选项(即使我删除了mkdir)。有提示吗?
tinyMCE.activeEditor.windowManager.open({
file : 'elfinder/elfinder.html',
title : 'elFinder 2.0',
width : 950,
height : 630,
resizable : "yes",
uiOptions: {
toolbar : [
// toolbar configuration
['open'],
['back', 'forward'],
['reload'],
['home', 'up'],
['mkfile', 'upload'],
['info'],
['quicklook'],
['copy', 'cut', 'paste'],
['rm'],
['duplicate', 'rename', 'edit'],
['extract', 'archive'],
['search'],
['view'],
['help']
]
},
commands : [
'open', 'reload', 'home', 'up', 'back', 'forward', 'getfile', 'quicklook',
'download', 'rm', 'duplicate', 'rename', 'mkfile', 'upload', 'copy',
'cut', 'paste', 'edit', 'extract', 'archive', 'search', 'info', 'view', 'help'
],
}
编辑connector.php文件并添加一个名为" disabled "的键
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => '../../ava/externo/',
'startPath' => '../../ava/externo/',
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../ava/externo',
'tmbPath' => '.tmb',
'utf8fix' => true,
'tmbCrop' => false,
'tmbBgColor' => 'transparent',
'accessControl' => 'access',
'acceptedName' => '/^[^.].*$/',
'disabled' => array('extract', 'archive', 'mkdir'),
'tmbSize' => 128,
'attributes' => array(
array(
'pattern' => '/^/icons$/',
'read' => true,
'write' => false
),
array(
'pattern' => '/.php$/',
'hidden' => true,
'read' => false
),
array(
'pattern' => '/.zip$/',
'read' => true,
'write' => true
)
),
'uploadDeny' => array('text/php')
注意,此时使用disabled并不会在通过快捷键(热键)执行命令时禁用该命令。例如,当您禁用上传时,Ctrl-u仍将允许用户上传文件。
您可以在初始配置中使用allowShortcuts: false禁用所有热键。您还可以禁用特定命令的快捷方式,例如:
commandsOptions: {
upload : {shortcuts : []},
rm : {shortcuts : []},
download : {shortcuts : []}
},
Unfortunately, I haven't found a way do this in the connector.