aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2024-07-16 21:24:30 +0200
committerskjnldsv <skjnldsv@protonmail.com>2024-07-18 19:47:11 +0200
commitb80c57dab362b00b4d5a129f35f29c5d431837d2 (patch)
tree6ba3dc1d0bcb2b491945edec6af6bf2b2ad6c920 /apps/files_sharing/lib
parent43ca07809d7d95f4896e9b1839c02d1344b51f83 (diff)
downloadnextcloud-server-b80c57dab362b00b4d5a129f35f29c5d431837d2.tar.gz
nextcloud-server-b80c57dab362b00b4d5a129f35f29c5d431837d2.zip
feat(files_sharing): use label as title and file drop destination if available
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
index 8f5ea9fd0be..e125100eb68 100644
--- a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
+++ b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
@@ -96,6 +96,7 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider
$shareTmpl['filename'] = $shareNode->getName();
$shareTmpl['directory_path'] = $share->getTarget();
+ $shareTmpl['label'] = $share->getLabel();
$shareTmpl['note'] = $share->getNote();
$shareTmpl['mimetype'] = $shareNode->getMimetype();
$shareTmpl['previewSupported'] = $this->previewManager->isMimeSupported($shareNode->getMimetype());
@@ -240,6 +241,11 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider
$response->setHeaderDetails($this->l10n->t('shared by %s', [$shareTmpl['shareOwner']]));
}
+ // If the share has a label, use it as the title
+ if ($shareTmpl['label'] !== '') {
+ $response->setHeaderTitle($shareTmpl['label']);
+ }
+
$isNoneFileDropFolder = $shareIsFolder === false || $share->getPermissions() !== Constants::PERMISSION_CREATE;
if ($isNoneFileDropFolder && !$share->getHideDownload()) {