summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-01 09:41:07 -0800
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-01 09:41:07 -0800
commit2e2cf28d30b0f1afbfe000aaeea5c2ced365a183 (patch)
treecc6e9e215bb988d5f6b3cec236fa711e51779c70
parent87c8fff2d2bcfbaf414991db25594c3bca67c08f (diff)
parentdf2a9a3c60c3ada040216a97869644fcb14816f3 (diff)
downloadnextcloud-server-2e2cf28d30b0f1afbfe000aaeea5c2ced365a183.tar.gz
nextcloud-server-2e2cf28d30b0f1afbfe000aaeea5c2ced365a183.zip
Merge pull request #2005 from owncloud/trash_add_signals
add post_moveToTrash and post_restore signals to the trash bin
-rw-r--r--apps/files_trashbin/lib/trash.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 0b8472198d9..6dedd314cf2 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -71,6 +71,9 @@ 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('filePath' => \OC\Files\Filesystem::normalizePath($file_path),
+ 'trashPath' => \OC\Files\Filesystem::normalizePath($deleted.'.d'.$timestamp)));
// Take care of file versions
if ( \OCP\App::isEnabled('files_versions') ) {
@@ -173,6 +176,9 @@ 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('filePath' => \OC\Files\Filesystem::normalizePath('/'.$location.'/'.$filename.$ext),
+ 'trashPath' => \OC\Files\Filesystem::normalizePath($file)));
if ($view->is_dir($target.$ext)) {
$trashbinSize -= self::calculateSize(new \OC\Files\View('/'.$user.'/'.$target.$ext));
} else {