add post_moveToTrash and post_restore signals to the trash bin

This commit is contained in:
Björn Schießle 2013-03-01 12:20:29 +01:00
parent 09dc15d2b1
commit 7c360c2491
1 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,7 @@ class Trashbin {
\OC_Log::write('files_trashbin', 'trash bin database couldn\'t be updated', \OC_log::ERROR);
return;
}
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', array('path' => \OC\Files\Filesystem::normalizePath($file_path)));
// Take care of file versions
if ( \OCP\App::isEnabled('files_versions') ) {
@ -173,6 +174,7 @@ class Trashbin {
$mtime = $view->filemtime($source);
if( $view->rename($source, $target.$ext) ) {
$view->touch($target.$ext, $mtime);
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('path' => \OC\Files\Filesystem::normalizePath('/'.$location.'/'.$filename.$ext)));
if ($view->is_dir($target.$ext)) {
$trashbinSize -= self::calculateSize(new \OC\Files\View('/'.$user.'/'.$target.$ext));
} else {