Hi,
I am using the "elfinder-minimal" version from nightly builds of this great software, because in normal release I had to disable many things that I do not use.
I would like to know how I can do a function ("bind" in the connector php) to get the name and the previous and current situation of a file/folder after moving it.
I have read the documentation and looked at many examples but I do not see how to obtain that data.
Thank you
@adolforo Please check pastecommand results with an option bind.
'bind' => array('paste' => array(
function($cmd, $result, $args, $elfinder, $volume) {
$added = $result['added'];
$removed = $result['removed'];
// and your function...
}
))
Thank you,
With this, I can work now.
One last question :
According to the documentation, the hash is calculated (in PHP) as:
$volumeId = 'l1_';
$path = 'path/to/target'; // without root path
$hash = $volumeId . rtrim(strtr(base64_encode($path), '+/=', '-_.'), '.');
According to this, the inverse (without "$volumeId") would be :
$path = base64_decode(strtr(substr($hash, strrpos($hash, '_')), '-_.', '+/='));
(although "rtrim" has no inverse)
But it does not work.
The one that works is
$path = base64_decode(strtr(substr($hash, strrpos($hash, '_')), '-.', '+='));
(the character "_" must be kept)
and also it works simply :
base64_decode(substr($hash, strrpos($hash, '_')));
What is the correct function?
regards
@adolforo You can use $volume->getPath($hash) to get path from hash.
Thank you
Much easier