summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Sabre
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-10-02 16:36:53 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-05 10:23:30 +0200
commitce433637dad27e944ff2d78167ba962cb2273bad (patch)
treef5a55f235351f2b4146e17ddada1db51db62bd33 /apps/files_trashbin/lib/Sabre
parent2169c261957ee447cfdf27dac593508d8ecc16e9 (diff)
downloadnextcloud-server-ce433637dad27e944ff2d78167ba962cb2273bad.tar.gz
nextcloud-server-ce433637dad27e944ff2d78167ba962cb2273bad.zip
allow trash backends to overwrite the tooltip for trash items
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin/lib/Sabre')
-rw-r--r--apps/files_trashbin/lib/Sabre/AbstractTrash.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/ITrash.php2
-rw-r--r--apps/files_trashbin/lib/Sabre/PropfindPlugin.php5
3 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Sabre/AbstractTrash.php b/apps/files_trashbin/lib/Sabre/AbstractTrash.php
index b4d13a41e38..90f14fddd58 100644
--- a/apps/files_trashbin/lib/Sabre/AbstractTrash.php
+++ b/apps/files_trashbin/lib/Sabre/AbstractTrash.php
@@ -79,6 +79,10 @@ abstract class AbstractTrash implements ITrash {
return $this->data->getOriginalLocation();
}
+ public function getTitle(): string {
+ return $this->data->getTitle();
+ }
+
public function delete() {
$this->trashManager->removeItem($this->data);
}
diff --git a/apps/files_trashbin/lib/Sabre/ITrash.php b/apps/files_trashbin/lib/Sabre/ITrash.php
index 49c600c3f18..7a05fbe9507 100644
--- a/apps/files_trashbin/lib/Sabre/ITrash.php
+++ b/apps/files_trashbin/lib/Sabre/ITrash.php
@@ -32,6 +32,8 @@ interface ITrash {
public function getOriginalLocation(): string;
+ public function getTitle(): string;
+
public function getDeletionTime(): int;
public function getSize();
diff --git a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php
index 19da79fd2a3..81fed3eba2b 100644
--- a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php
+++ b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php
@@ -37,6 +37,7 @@ class PropfindPlugin extends ServerPlugin {
const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename';
const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location';
const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time';
+ const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title';
/** @var Server */
private $server;
@@ -70,6 +71,10 @@ class PropfindPlugin extends ServerPlugin {
return $node->getOriginalLocation();
});
+ $propFind->handle(self::TRASHBIN_TITLE, function () use ($node) {
+ return $node->getTitle();
+ });
+
$propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) {
return $node->getDeletionTime();
});