gpt4 book ai didi

javascript - elfinder(一个 Javascript 文件管理器插件)绑定(bind)操作不会在 connector.php 中触发

转载 作者:行者123 更新时间:2023-11-30 16:03:18 24 4
gpt4 key购买 nike

function log() {
$data = array(
'folder_id' => 1,
'user_id' => 1
);

$this->Folder_model->share($data);
}
function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself
}

function album() {
$opts = array(
'bind' => array(
'upload.presave' => array(
'Plugin.AutoResize.onUpLoadPreSave'
)
),
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'alias' => 'Home',
'path' => 'uploads/album/' . $this->user_id . '/',
'URL' => site_url('uploads/album/' . $this->user_id),
'uploadDeny' => array('all'),
'uploadAllow' => array('image/jpeg', 'image/gif', 'image/png', 'image/bmp'),
'uploadOrder' => array('deny', 'allow'),
'accessControl' => array($this, 'access'),
'plugin' => array(
'AutoResize' => array(
'enable' => true,
'maxWidth' => 2100,
'maxHeight' => 1500,
'quality' => 100
)
),
'bind' => array(
'mkdir mkfile rename duplicate upload rm paste' => array($this, 'log')
)
)
)
);

$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
}

上面是connector类,其中album是前端Jquery使用的connector路径。

问题是,由于访问控制可以使用array($this, 'access')触发函数,array($this, 'log')的语法> in bind 应该是正确的?

但是,我检查了每个 Action 都不能触发绑定(bind)功能,有什么办法调试?非常感谢

最佳答案

您不能在根选项中使用 bind

function album() {
$opts = array(
'bind' => array(
'upload.presave' => array(
'Plugin.AutoResize.onUpLoadPreSave'
),
'mkdir mkfile rename duplicate upload rm paste' => array(
array($this, 'log')
)
),
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'alias' => 'Home',
'path' => 'uploads/album/' . $this->user_id . '/',
'URL' => site_url('uploads/album/' . $this->user_id),
'uploadDeny' => array('all'),
'uploadAllow' => array('image/jpeg', 'image/gif', 'image/png', 'image/bmp'),
'uploadOrder' => array('deny', 'allow'),
'accessControl' => array($this, 'access'),
'plugin' => array(
'AutoResize' => array(
'enable' => true,
'maxWidth' => 2100,
'maxHeight' => 1500,
'quality' => 100
)
)
)
)
);

关于javascript - elfinder(一个 Javascript 文件管理器插件)绑定(bind)操作不会在 connector.php 中触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37383308/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com