diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-18 14:09:22 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-22 15:33:53 +0100 |
commit | a3da82261bf03ff4b54b0ebf3836d339fe2d4177 (patch) | |
tree | 1f07edcb756ac35d0592e0ee87387e730b6533d2 /apps/files_trashbin/ajax | |
parent | d60522893713df7359d0e02c841f35a65d2186aa (diff) | |
download | nextcloud-server-a3da82261bf03ff4b54b0ebf3836d339fe2d4177.tar.gz nextcloud-server-a3da82261bf03ff4b54b0ebf3836d339fe2d4177.zip |
remove item in the trash bin view after successful undelete
Diffstat (limited to 'apps/files_trashbin/ajax')
-rw-r--r-- | apps/files_trashbin/ajax/undelete.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index c5480348285..f55629d695c 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -7,7 +7,8 @@ if(!OC_User::isLoggedIn()) { $timestamp = isset( $_REQUEST['timestamp'] ) ? $_REQUEST['timestamp'] : ''; $filename = isset( $_REQUEST['filename'] ) ? trim($_REQUEST['filename'], '/\\') : ''; -OCA_Trash\Trashbin::restore($filename, $timestamp); - -//TODO: return useful data after succsessful restore operation and remove restored files from the list view -OCP\JSON::success(array("data" => array('content'=>'foo', 'id' => 'bar')));
\ No newline at end of file +if ( OCA_Trash\Trashbin::restore($filename, $timestamp) ) { + OCP\JSON::success(array("data" => array('filename'=>$filename, 'timestamp' => $timestamp))); +} else { + OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".$filename))); +} |