set callback removePreviews() when removing a folder

This commit is contained in:
Uwe Steinmann 2020-02-25 17:08:38 +01:00
parent 6bf193aa85
commit 3448734024

View File

@ -449,6 +449,16 @@ switch($command) {
'groups'=>array_unique(array_merge($fnl['groups'], $pnl['groups']), SORT_REGULAR)
);
$foldername = $folder->getName();
function removePreviews($arr, $document) {
$previewer = $arr[0];
$previewer->deleteDocumentPreviews($document);
return null;
}
require_once("SeedDMS/Preview.php");
$previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir);
$dms->addCallback('onPreRemoveDocument', 'removePreviews', array($previewer));
if($folder->remove()) {
if ($notifier) {
$subject = "folder_deleted_email_subject";