diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-12 19:32:35 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-21 15:02:19 +0200 |
commit | 2250dbec215ba6336160ae1b71102ae072863f1a (patch) | |
tree | c02b4055c1022ce4f45791015c4e84a33e92afe4 /lib/private/Share20 | |
parent | 1ce519ad38e5c7f56a2c8007517570cac3c94bec (diff) | |
download | nextcloud-server-2250dbec215ba6336160ae1b71102ae072863f1a.tar.gz nextcloud-server-2250dbec215ba6336160ae1b71102ae072863f1a.zip |
add a nice looking button as direct link to the sharre
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 90fa5044aeb..f5e32de424e 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1318,14 +1318,6 @@ class DefaultShareProvider implements IShareProvider { $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; $plainHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); $htmlHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); - $link = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]); - if($share->getNode()->getType() === \OCP\Files\FileInfo::TYPE_FILE) { - $plainLink = $this->l->t('Direct link to the file: %s', [$link]); - $htmlLink = $this->l->t('<a href="%s">Direct link to the file.</a>', [$link]); - } else { - $plainLink = $this->l->t('Direct link to the folder: %s', [$link]); - $htmlLink = $this->l->t('<a href="%s">Direct link to the folder.</a>', [$link]); - } $message = $this->mailer->createMessage(); $emailTemplate = $this->mailer->createEMailTemplate('defaultShareProvider.sendNote'); @@ -1334,7 +1326,13 @@ class DefaultShareProvider implements IShareProvider { $emailTemplate->addHeader(); $emailTemplate->addHeading($htmlHeading, $plainHeading); $emailTemplate->addBodyText(htmlspecialchars($note), $note); - $emailTemplate->addBodyText($htmlLink, $plainLink); + + $link = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]); + $emailTemplate->addBodyButton( + $this->l->t('Open »%s«', [$filename]), + $link + ); + // The "From" contains the sharers name $instanceName = $this->defaults->getName(); |