summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-20 13:48:51 +0200
committerJoas Schilling <coding@schilljs.com>2017-06-20 13:48:51 +0200
commit90fa27694a6f454820487dcb1ca4e4ceec90a9a1 (patch)
treeec6821e7aff73031293a9ef3f6a56a3baa672630 /apps/sharebymail
parent8b0546e3f9741980ee2c63b3aca04392408b2e02 (diff)
downloadnextcloud-server-90fa27694a6f454820487dcb1ca4e4ceec90a9a1.tar.gz
nextcloud-server-90fa27694a6f454820487dcb1ca4e4ceec90a9a1.zip
Use PNG version of the icons for shipped activities
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/sharebymail')
-rw-r--r--apps/sharebymail/lib/Activity.php64
1 files changed, 48 insertions, 16 deletions
diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php
index 73751cb241e..df9cb36e0d7 100644
--- a/apps/sharebymail/lib/Activity.php
+++ b/apps/sharebymail/lib/Activity.php
@@ -117,8 +117,12 @@ class Activity implements IProvider {
]))
->setRichSubject($this->l->t('Shared with {email}'), [
'email' => $parsedParameters['email'],
- ])
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ]);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_BY) {
$event->setParsedSubject($this->l->t('Shared with %1$s by %2$s', [
$parsedParameters['email']['name'],
@@ -127,20 +131,32 @@ class Activity implements IProvider {
->setRichSubject($this->l->t('Shared with {email} by {actor}'), [
'email' => $parsedParameters['email'],
'actor' => $parsedParameters['actor'],
- ])
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ]);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) {
$event->setParsedSubject($this->l->t('Password for mail share sent to %1$s', [
$parsedParameters['email']['name']
]))
->setRichSubject($this->l->t('Password for mail share sent to {email}'), [
'email' => $parsedParameters['email']
- ])
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ]);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) {
$event->setParsedSubject($this->l->t('Password for mail share sent to you'))
- ->setRichSubject($this->l->t('Password for mail share sent to you'))
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('Password for mail share sent to you'));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else {
throw new \InvalidArgumentException();
}
@@ -162,29 +178,45 @@ class Activity implements IProvider {
$parsedParameters['file']['path'],
$parsedParameters['email']['name'],
]))
- ->setRichSubject($this->l->t('You shared {file} with {email} by mail'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('You shared {file} with {email} by mail'), $parsedParameters);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_BY) {
$event->setParsedSubject($this->l->t('%3$s shared %1$s with %2$s by mail', [
$parsedParameters['file']['path'],
$parsedParameters['email']['name'],
$parsedParameters['actor']['name'],
]))
- ->setRichSubject($this->l->t('{actor} shared {file} with {email} by mail'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('{actor} shared {file} with {email} by mail'), $parsedParameters);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) {
$event->setParsedSubject($this->l->t('Password to access %1$s was sent to %2s', [
$parsedParameters['file']['path'],
$parsedParameters['email']['name']
]))
- ->setRichSubject($this->l->t('Password to access {file} was sent to {email}'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('Password to access {file} was sent to {email}'), $parsedParameters);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) {
$event->setParsedSubject(
$this->l->t('Password to access %1$s was sent to you',
[$parsedParameters['file']['path']]))
- ->setRichSubject($this->l->t('Password to access {file} was sent to you'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('Password to access {file} was sent to you'), $parsedParameters);
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ }
} else {
throw new \InvalidArgumentException();