From 8b0546e3f9741980ee2c63b3aca04392408b2e02 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Jun 2017 12:40:45 +0200 Subject: [PATCH 1/3] Add a flag to allow checking if SVGs are okay Signed-off-by: Joas Schilling --- lib/private/Activity/Manager.php | 17 +++++++++++++++++ lib/public/Activity/IManager.php | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index a8810a3e16..bbb6f69415 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -57,6 +57,9 @@ class Manager implements IManager { /** @var int */ protected $formattingObjectId; + /** @var bool */ + protected $requirePNG; + /** @var string */ protected $currentUserId; @@ -465,6 +468,20 @@ class Manager implements IManager { && $this->formattingObjectId === $this->request->getParam('object_id'); } + /** + * @param bool $status Set to true, when parsing events should not use SVG icons + */ + public function setRequirePNG($status) { + $this->requirePNG = $status; + } + + /** + * @return bool + */ + public function getRequirePNG() { + return $this->requirePNG; + } + /** * @param string $app * @param string $text diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index f5b495807c..4cdea0e2f7 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -206,6 +206,18 @@ interface IManager { */ public function isFormattingFilteredObject(); + /** + * @param bool $status Set to true, when parsing events should not use SVG icons + * @since 12.0.1 + */ + public function setRequirePNG($status); + + /** + * @return bool + * @since 12.0.1 + */ + public function getRequirePNG(); + /** * @param string $app * @param string $text From 90fa27694a6f454820487dcb1ca4e4ceec90a9a1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Jun 2017 13:48:51 +0200 Subject: [PATCH 2/3] Use PNG version of the icons for shipped activities Signed-off-by: Joas Schilling --- apps/comments/img/comments-dark.svg | 1 + apps/comments/lib/Activity/Provider.php | 6 +- .../lib/CalDAV/Activity/Provider/Calendar.php | 6 +- .../lib/CalDAV/Activity/Provider/Event.php | 6 +- .../dav/lib/CalDAV/Activity/Provider/Todo.php | 6 +- apps/files/img/add-color.png | Bin 0 -> 4217 bytes apps/files/img/change.png | Bin 0 -> 4217 bytes apps/files/img/delete-color.png | Bin 0 -> 4217 bytes apps/files/lib/Activity/FavoriteProvider.php | 28 +++-- apps/files/lib/Activity/Provider.php | 96 +++++++++++++++--- .../lib/Activity/Providers/Downloads.php | 12 ++- .../lib/Activity/Providers/Groups.php | 12 ++- .../lib/Activity/Providers/PublicLinks.php | 12 ++- .../lib/Activity/Providers/RemoteShares.php | 12 ++- .../lib/Activity/Providers/Users.php | 12 ++- apps/sharebymail/lib/Activity.php | 64 +++++++++--- apps/systemtags/lib/Activity/Provider.php | 14 ++- .../lib/Activity/Provider.php | 19 ++-- core/img/actions/checkmark.png | Bin 0 -> 4217 bytes core/img/actions/comment.png | Bin 0 -> 4217 bytes core/img/actions/download.png | Bin 0 -> 4217 bytes core/img/actions/password.png | Bin 0 -> 4217 bytes core/img/actions/share.png | Bin 0 -> 4217 bytes core/img/actions/star.png | Bin 0 -> 4217 bytes core/img/actions/starred.png | Bin 0 -> 4217 bytes core/img/actions/tag.png | Bin 0 -> 4217 bytes core/img/places/calendar-dark.png | Bin 0 -> 4217 bytes settings/Activity/Provider.php | 14 ++- settings/Activity/SecurityProvider.php | 22 ++-- settings/img/personal.png | Bin 0 -> 4217 bytes 30 files changed, 272 insertions(+), 70 deletions(-) create mode 100644 apps/comments/img/comments-dark.svg create mode 100644 apps/files/img/add-color.png create mode 100644 apps/files/img/change.png create mode 100644 apps/files/img/delete-color.png create mode 100644 core/img/actions/checkmark.png create mode 100644 core/img/actions/comment.png create mode 100644 core/img/actions/download.png create mode 100644 core/img/actions/password.png create mode 100644 core/img/actions/share.png create mode 100644 core/img/actions/star.png create mode 100644 core/img/actions/starred.png create mode 100644 core/img/actions/tag.png create mode 100644 core/img/places/calendar-dark.png create mode 100644 settings/img/personal.png diff --git a/apps/comments/img/comments-dark.svg b/apps/comments/img/comments-dark.svg new file mode 100644 index 0000000000..d331ea7711 --- /dev/null +++ b/apps/comments/img/comments-dark.svg @@ -0,0 +1 @@ + diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php index c55982827b..7bf686e796 100644 --- a/apps/comments/lib/Activity/Provider.php +++ b/apps/comments/lib/Activity/Provider.php @@ -87,7 +87,11 @@ class Provider implements IProvider { if ($event->getSubject() === 'add_comment_subject') { $this->parseMessage($event); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/comment.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/comment.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/comment.svg'))); + } if ($this->activityManager->isFormattingFilteredObject()) { try { diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index d7730da61f..6082e68dcd 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -84,7 +84,11 @@ class Calendar extends Base { $this->l = $this->languageFactory->get('dav', $language); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg'))); + } if ($event->getSubject() === self::SUBJECT_ADD) { $subject = $this->l->t('{actor} created calendar {calendar}'); diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index daaace6b5b..b591eaa351 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -80,7 +80,11 @@ class Event extends Base { $this->l = $this->languageFactory->get('dav', $language); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg'))); + } if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event') { $subject = $this->l->t('{actor} created event {event} in calendar {calendar}'); diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php index 747b39ddb7..0ad1d13745 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php @@ -40,7 +40,11 @@ class Todo extends Event { $this->l = $this->languageFactory->get('dav', $language); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg'))); + } if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo') { $subject = $this->l->t('{actor} created todo {todo} in list {calendar}'); diff --git a/apps/files/img/add-color.png b/apps/files/img/add-color.png new file mode 100644 index 0000000000000000000000000000000000000000..2211eb6e0bc19b74692db585aad55dca51222bed GIT binary patch literal 4217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DX&fk8mq z)5S3)f|F4};Qo7{no%&YA;3ts^;a2qQ1ogsd}Ux{_>Uq+1c!wPHQ1H>XLtdW;D$?H zW8ej{K?#o}z(kU28Ymuhz-S1JhQNS_0A@jiUc%wZ`~QLE9x`AA7DQ(ln1PTHj+ub$ z?+i>}K8Ov%S`4p%z%ghCs(J Vv2%YLOU{D4@9FC2vd$@?2>@z4D?k7M literal 0 HcmV?d00001 diff --git a/apps/files/img/change.png b/apps/files/img/change.png new file mode 100644 index 0000000000000000000000000000000000000000..1465882d72e340253078e8c906b97c0278b308b0 GIT binary patch literal 4217 zcmeH~yK7WI6vpp1l8vkce7_*RKnw_iq!Wy+m_-aC7K#=&RUUJ}^x)BvBw4&vC?u0tS0zbLU!^>7_(-wP+w=BofuL4J zmG*;OpdYLQ%fN5&seu>hd*C7X2|6MhV7UUmfxj(cnz+kgIf#}bnd4vvv|8AY)1c1) zy_GC6Sw`750!^n+7~2=u3gC*NBfgYu$MPA(77OLQhI4JBnsN9Wrn=gS(t-++%-8+~ z?u#Bj-MVz4UV^+LzwloJ$G{e#9PJLhGTG$QuE^u?eT3J=ADJIGMc5`AoTK~jX&d_a zp?-}@zaTX7Klrqg+m$K_p`xz6#;bkq8r^nGaXZ*^IlQ(;Ew;pS7`*ZlZq~f<599IK zqOMM{@5XWi`~a=IbHXykV08YNZGN8He}-Rqv*J3{*7W$cPW3;)Jv;Sw1TMM3sGIRS;MzOU z{s`wzkP=I79M5Xn&w=&LS3iYoy~E$s6uD`#)H`}lqd;G|u>;Tt>IBd_35p4N>JH7u zBxq-C=;TvQ>V0Etl6F4N^()HY0N4RmHXsfyuJ=Hv+#T=$=%aQ{x%=hG%;S^8{R*t? L9V$=lIdT3U!u;TL literal 0 HcmV?d00001 diff --git a/apps/files/img/delete-color.png b/apps/files/img/delete-color.png new file mode 100644 index 0000000000000000000000000000000000000000..1d563db1c8da06f7c2a8c53aaa83c0f2b9b62159 GIT binary patch literal 4217 zcmeHJu}T9$6nqIPCK3qPh*iMS{Dg91(gYEUNDvi7uoF@lNn>Z@2LwSx0#<&9y;_Qm zy^U=WXUwg6XL6g}D{Q<6o4wtg_hxpoEPJ_C+bral^CD8HR)THxCARrF{5D&yPjtD{ z%5GC+VUaB(o$Do$;%YTm+o|U=rQ+KMFlnR?qz>2}coI2(7OC4&Vu%7?I5i z9pSYt21CH4usYyEZi@O~O%D550Z9rb$L3lm(gE11yhQx8{YH_wGRoUF;Knzj4` zJ4*B*p%Z9)Kkz-!_GeZZ;lm{M4WOWrPl~WTL?YmHkUH?M9hiN*>XmEn0ZpiG)Pjfg GgNrXW_o74q literal 0 HcmV?d00001 diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php index 941579e730..318ce66e67 100644 --- a/apps/files/lib/Activity/FavoriteProvider.php +++ b/apps/files/lib/Activity/FavoriteProvider.php @@ -97,11 +97,19 @@ class FavoriteProvider implements IProvider { public function parseShortVersion(IEvent $event) { if ($event->getSubject() === self::SUBJECT_ADDED) { - $event->setParsedSubject($this->l->t('Added to favorites')) - ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); + $event->setParsedSubject($this->l->t('Added to favorites')); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); + } } else if ($event->getSubject() === self::SUBJECT_REMOVED) { - $event->setParsedSubject($this->l->t('Removed from favorites')) - ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg'))); + $event->setParsedSubject($this->l->t('Removed from favorites')); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg'))); + } } else { throw new \InvalidArgumentException(); } @@ -120,10 +128,18 @@ class FavoriteProvider implements IProvider { if ($event->getSubject() === self::SUBJECT_ADDED) { $subject = $this->l->t('You added {file} to your favorites'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); + } } else if ($event->getSubject() === self::SUBJECT_REMOVED) { $subject = $this->l->t('You removed {file} from your favorites'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg'))); + } } else { throw new \InvalidArgumentException(); } diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php index c3289ed370..736b930b7a 100644 --- a/apps/files/lib/Activity/Provider.php +++ b/apps/files/lib/Activity/Provider.php @@ -110,21 +110,41 @@ class Provider implements IProvider { if ($event->getSubject() === 'created_by') { $subject = $this->l->t('Created by {user}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + } } else if ($event->getSubject() === 'changed_by') { $subject = $this->l->t('Changed by {user}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'deleted_by') { $subject = $this->l->t('Deleted by {user}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg'))); + } } else if ($event->getSubject() === 'restored_by') { $subject = $this->l->t('Restored by {user}'); } else if ($event->getSubject() === 'renamed_by') { $subject = $this->l->t('Renamed by {user}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'moved_by') { $subject = $this->l->t('Moved by {user}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else { throw new \InvalidArgumentException(); } @@ -151,41 +171,85 @@ class Provider implements IProvider { if ($event->getSubject() === 'created_self') { $subject = $this->l->t('You created {file}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + } } else if ($event->getSubject() === 'created_by') { $subject = $this->l->t('{user} created {file}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + } } else if ($event->getSubject() === 'created_public') { $subject = $this->l->t('{file} was created in a public folder'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg'))); + } } else if ($event->getSubject() === 'changed_self') { $subject = $this->l->t('You changed {file}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'changed_by') { $subject = $this->l->t('{user} changed {file}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'deleted_self') { $subject = $this->l->t('You deleted {file}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg'))); + } } else if ($event->getSubject() === 'deleted_by') { $subject = $this->l->t('{user} deleted {file}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg'))); + } } else if ($event->getSubject() === 'restored_self') { $subject = $this->l->t('You restored {file}'); } else if ($event->getSubject() === 'restored_by') { $subject = $this->l->t('{user} restored {file}'); } else if ($event->getSubject() === 'renamed_self') { $subject = $this->l->t('You renamed {oldfile} to {newfile}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'renamed_by') { $subject = $this->l->t('{user} renamed {oldfile} to {newfile}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'moved_self') { $subject = $this->l->t('You moved {oldfile} to {newfile}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else if ($event->getSubject() === 'moved_by') { $subject = $this->l->t('{user} moved {oldfile} to {newfile}'); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg'))); + } } else { throw new \InvalidArgumentException(); } diff --git a/apps/files_sharing/lib/Activity/Providers/Downloads.php b/apps/files_sharing/lib/Activity/Providers/Downloads.php index eb14c16266..1e1688d7b0 100644 --- a/apps/files_sharing/lib/Activity/Providers/Downloads.php +++ b/apps/files_sharing/lib/Activity/Providers/Downloads.php @@ -51,7 +51,11 @@ class Downloads extends Base { throw new \InvalidArgumentException(); } - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; @@ -76,7 +80,11 @@ class Downloads extends Base { throw new \InvalidArgumentException(); } - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; diff --git a/apps/files_sharing/lib/Activity/Providers/Groups.php b/apps/files_sharing/lib/Activity/Providers/Groups.php index 06ccdaa98b..683927d573 100644 --- a/apps/files_sharing/lib/Activity/Providers/Groups.php +++ b/apps/files_sharing/lib/Activity/Providers/Groups.php @@ -51,7 +51,11 @@ class Groups extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; @@ -78,7 +82,11 @@ class Groups extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; diff --git a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php index b22ae0aa9b..98e4ebda2d 100644 --- a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php +++ b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php @@ -58,7 +58,11 @@ class PublicLinks extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; @@ -90,7 +94,11 @@ class PublicLinks extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; diff --git a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php index 4e7d8ef3e2..6ac0be76ff 100644 --- a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php +++ b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php @@ -73,7 +73,11 @@ class RemoteShares extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; @@ -100,7 +104,11 @@ class RemoteShares extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; diff --git a/apps/files_sharing/lib/Activity/Providers/Users.php b/apps/files_sharing/lib/Activity/Providers/Users.php index eaab35bba9..02f47f3775 100644 --- a/apps/files_sharing/lib/Activity/Providers/Users.php +++ b/apps/files_sharing/lib/Activity/Providers/Users.php @@ -60,7 +60,11 @@ class Users extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; @@ -92,7 +96,11 @@ class Users extends Base { throw new \InvalidArgumentException(); } - $event->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'))); + } $this->setSubjects($event, $subject, $parsedParameters); return $event; diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php index 73751cb241..df9cb36e0d 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(); diff --git a/apps/systemtags/lib/Activity/Provider.php b/apps/systemtags/lib/Activity/Provider.php index 5ef20c281b..db7ff94fd1 100644 --- a/apps/systemtags/lib/Activity/Provider.php +++ b/apps/systemtags/lib/Activity/Provider.php @@ -104,7 +104,12 @@ class Provider implements IProvider { */ public function parseShortVersion(IEvent $event) { $parsedParameters = $this->getParameters($event); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg'))); + + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg'))); + } if ($event->getSubject() === self::ASSIGN_TAG) { if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { @@ -157,7 +162,12 @@ class Provider implements IProvider { */ public function parseLongVersion(IEvent $event) { $parsedParameters = $this->getParameters($event); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg'))); + + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg'))); + } if ($event->getSubject() === self::CREATE_TAG) { if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { diff --git a/apps/twofactor_backupcodes/lib/Activity/Provider.php b/apps/twofactor_backupcodes/lib/Activity/Provider.php index 9c7aaeae63..739ac9bbe1 100644 --- a/apps/twofactor_backupcodes/lib/Activity/Provider.php +++ b/apps/twofactor_backupcodes/lib/Activity/Provider.php @@ -24,8 +24,8 @@ namespace OCA\TwoFactorBackupCodes\Activity; use InvalidArgumentException; use OCP\Activity\IEvent; +use OCP\Activity\IManager; use OCP\Activity\IProvider; -use OCP\ILogger; use OCP\IURLGenerator; use OCP\L10N\IFactory as L10nFactory; @@ -37,17 +37,17 @@ class Provider implements IProvider { /** @var IURLGenerator */ private $urlGenerator; - /** @var ILogger */ - private $logger; + /** @var IManager */ + private $activityManager; /** * @param L10nFactory $l10n * @param IURLGenerator $urlGenerator - * @param ILogger $logger + * @param IManager $activityManager */ - public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, ILogger $logger) { - $this->logger = $logger; + public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, IManager $activityManager) { $this->urlGenerator = $urlGenerator; + $this->activityManager = $activityManager; $this->l10n = $l10n; } @@ -61,7 +61,12 @@ class Provider implements IProvider { switch ($event->getSubject()) { case 'codes_generated': $event->setParsedSubject($l->t('You created two-factor backup codes for your account')); - $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'))); + + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png'))); + } else { + $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'))); + } break; default: throw new InvalidArgumentException(); diff --git a/core/img/actions/checkmark.png b/core/img/actions/checkmark.png new file mode 100644 index 0000000000000000000000000000000000000000..eb938698fd2183727f80b7e2f61b5d2afc550871 GIT binary patch literal 4217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DX&fk8mq z)5S3)f|F4};Qo7{no%$s0;3@?upz)qC+n4g_WTCoUv#n$#Tqpr?->vu1Y#Z(89H!O zfp$Cv;{Q-gS4W^*4s%2`9X!sU0<`1_lFwn5uLO#*(Aoi@1oxOy%Z-2rM3UiBC7_;1 z)Uf;=(2&1C90SC}0!5(0hd>MqZWv8cu!DRKvK*$FSVt%T^u)7dO&QFEeGlWgHRwztRv)sYVQLv)hq|Q07wwy2sxm-d$h2e7)QwB zv78lV05xb_Apt7eu?0I-Er)pknmdKI;Vst0M8$lvH$=8 literal 0 HcmV?d00001 diff --git a/core/img/actions/comment.png b/core/img/actions/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..0dec289e38b03abe522d137fbd9b7e36c1b41386 GIT binary patch literal 4217 zcmeHJyGjE=6rK1^G!S1PN+hjVi-j7AM9d-t5ev2Q6T~zjb~YkdSXoH)0~9Q+Vxtzm zu(J}eu=WLlLX3KjW+gi$>`r#GX}oY|c6RSQ=k5%1XV#|T6MkQ}PYB`HV$o^zA)=`P zZ6cL=Mdw|N%_W3rZYMlqE8QhTpkIqdW@f#fP~h$fKL1wT8Sq$?55R927z74@Akdlz zI>EIh?tu&73^)OvfwHXzk(0n4@D6+_f-#IG2f37N6y8^Ws%R;Ha)qsAz#X*hps<_} zxv5dqI`Ee3CI>k^rUtbPR*#Vz;`+}VLyww&wt*-8qgy>Sf2 z@5Fl<0qlDwonBgvggtmT)dx4ltbW7|Ui=OOCTN?u3`w zg~k$*9VgDj4j@mxKDNWH6uSiPk0OaEk=S+CK=2|ZVV6@mz7G*RX@#y~8!pb*wh?}hd literal 0 HcmV?d00001 diff --git a/core/img/actions/download.png b/core/img/actions/download.png new file mode 100644 index 0000000000000000000000000000000000000000..6808969b30bfafaed6fb017a0eef55762dc18241 GIT binary patch literal 4217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DX&fk8mq z)5S3)f|F4};Qo7{nh_2d$?*Sw0(wX?lZk*~G?yNAz-S1JhQMeDjE2By2q1?*1F+@+ z)pUd~p$dwSevo_vE<->P#27${8l0BH97Rh<5VV|@jv(4{S~!Aa%ck++Uo6|g0+Rc$sk{N My85}Sb4q9e00IQi9smFU literal 0 HcmV?d00001 diff --git a/core/img/actions/password.png b/core/img/actions/password.png new file mode 100644 index 0000000000000000000000000000000000000000..afe3e31a658ddcd2baa7d7465d2f28491fb46877 GIT binary patch literal 4217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DX&fk8mq z)5S3)f|F4};Qo7{no&S<2(Oz{2vDf$$`{> z)KV3I4BQLExGY8&2dSm1BS5}Fw}cRX3Q!MK04QG3gZ&XuECPrnp%}z|48+Ke0_mYj zngAs(WP?E#2>~%W0EwYHVgkA%a`>PWj_d%CZ*c*T9I{%FUWx%In;{zt3U*vT3MhfB z_A@SpFmXm00}l-{5E&5CLy~$XWRnMiJ?a2_@rfRnl*SNNyGEm6Gz3ONU^E0qLtr!n i20R2Pt>H%X5B(6>`^PU#L?oCWRAd3D4 zY7T+J980Hiz17e3S^kpx z7gNj<^b$OSpYQ?B!y4$gY$U=P_#MFlZR?<8qUD~2sNlBkZpWhIcqk#bl30Q*(2y>B z;Ysgk!jD#IyY1&QfkB)ewT=_CHl{Zjz|(b*Q~R9b^bh(`kJ=YGxeDJQE@0R;)oy6L zMso7a5m+Voxx=P6K$SXH_F;VhAK@+BgKa=PZxj~=2+vCQN@x<4pf=hGke{befdi0O z6)(^!%K0za>kiu@?N^}f=Q`pD5S5VHw3)6!KX?%>mn&GXUAz4TsN{N;Pk0Lkin@MJ zpG`ia1`CmvG)c4pYe}72wd)m$nsvBM36vq-Y9QA*9VE?GGbN=n{tT=FZ&Je3R|wBK zuG+n$|7qw3FQTJT1?3SufeBa-!!QHk=&W)en+1Vv)h5fPLG@x5`CFk(hb6mg-h`~fb6?6P#{Ul2Fy!kD0| z5CsL-hLDI4j0y$?jfju<78Uh;(Sb7ERXtrzvhss7J=Ilp@6D~MTa!}mk5;=4F%nD?6jN)FGFYmEjYI~-^v+n zD>nbv&;WMCm<`H8NB}zcaci#4sEwIQApvZ`!~7U8+Kk$msgyQ=9M*OAT}r(SX#&vL zjZk!X=e;)LI?ysH*hFd2dXUjP=v=#=A;snk_C8yDvcBv6I|Z;Dj>1xyOMSpupEi@C zx(jPy3Cx9_`f8VWE=Pc+3Hm`tuO{t3&D*z3gf(M{X=xB!M z8I#V!8`tEdLiCD>1Fp$6yw`f`x1m!>0cfIq?K%xPI&^J&RZ9SCy%zkPsx4mC55RM9UpxCMsH{r2U?0R?)e2w~ zV&$s?ny?q_Yxo!KVd#fRs7n80$%!($3hWBHnD$MGl`jLjlp3sADk_7ZDjBEmyu1!t zk}hZlNmXW1~W1!nk>6Z^>>m@|w3t$(cb#M2H)p^JcDf#t($c zs>%R_J7VpJIYxw6uHbL~z`%D7rG2sPeqhxaVTC()*8=5r9qnyLx=K}~eBuk&1SdU$ z8vO!WgIfSX#cW0idZBQ-7#k|+W}Se&VfO2XfXWIflHFkNev;uHmK6CxS%TD2Wh1RrNx z0WfL%nl&r5q^cIG=9(KfPc}N20H+A_@~&Yx_CbJ^N1a%93zMc z1CUmO-ccI?q+h;!ayF;M_X1zKpTxLdVi%Q1&P_&Rl4&x(B?}qmjaXku?^h?a#B}~k dhhGDWz5aR4;P{DK=hus$j(zd=;k~CW{{{ESuJix^ literal 0 HcmV?d00001 diff --git a/core/img/actions/tag.png b/core/img/actions/tag.png new file mode 100644 index 0000000000000000000000000000000000000000..6a466b367b3531f7b03218484fb83a3b1ce7a41d GIT binary patch literal 4217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DX&fk8mq z)5S3)f|F4};Qo7{nt=t3NY=9g*&IL&69duc7^M6w5dQ!%s15D`4g608z5!GN3`y#P zk3b`daR5lobs(m?BR-Mf0Gc=g-2s1q4%!C98-e&I4#!b7Bt9cq@(;-N0Ad)h1TuaD zF}5h8nj=8@7G}YDn9WG^ZX|h_Iv7p1BbbmZfMq|B5U6xP2iU}5YBYe1{Xk4n!u$p_ z0OlhQT?oW55C>!+%i&^^9TFgmzGJcE5m4+d7I9n-0Ev_B2y70(XAwR*vK+C2M4#ew z09hdcs>DEfo{+($$deorqmBT^02mC4kN~w020Tp+Ye#^hnP>nC32K%TFM;Oat6Q)- zj9QL(1vFh3s|`d5QtAkbEQh&|Tt`sFa&jF(Rm+hbu^z}FR5#GXa$+4pQ_BfCf-aWh ras*v1M|Q+YAP3ZpBRikN3>!H#i)w#Ov9=YcBgEk8>gTe~DWM4fE*+uM literal 0 HcmV?d00001 diff --git a/core/img/places/calendar-dark.png b/core/img/places/calendar-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..88e8ea64db922801706e2e270a13b7582864c1e4 GIT binary patch literal 4217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DX&fk8mq z)5S3)f|F4};Qo7{no)o=1iXPV&!HH^CKXVsA8h%5psgSbatNsaq=%q>Mm(m1G$R9i zYLV5!*hJ}Pf~g)T8r=aZK!+^H;}}?w5~6V#0Wuq82Ueg86nzcEu%JV?1f&UF3>P1p zTA0`?AOmC<23QFcff*l1cq6cIL$S$k^BmrtVKLcV?3?)V_$V`ygI4uXtjX;o?xGzvP|I&Pr*F9bR KT-G@yGywoYebHlanguageFactory = $languageFactory; $this->url = $url; $this->userManager = $userManager; + $this->activityManager = $activityManager; } /** @@ -79,7 +85,11 @@ class Provider implements IProvider { $this->l = $this->languageFactory->get('settings', $language); - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('settings', 'personal.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('settings', 'personal.png'))); + } else { + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('settings', 'personal.svg'))); + } if ($event->getSubject() === self::PASSWORD_CHANGED_BY) { $subject = $this->l->t('{actor} changed your password'); diff --git a/settings/Activity/SecurityProvider.php b/settings/Activity/SecurityProvider.php index 74747f684d..7b27fde363 100644 --- a/settings/Activity/SecurityProvider.php +++ b/settings/Activity/SecurityProvider.php @@ -24,8 +24,8 @@ namespace OC\Settings\Activity; use InvalidArgumentException; use OCP\Activity\IEvent; +use OCP\Activity\IManager; use OCP\Activity\IProvider; -use OCP\ILogger; use OCP\IURLGenerator; use OCP\L10N\IFactory as L10nFactory; @@ -37,13 +37,13 @@ class SecurityProvider implements IProvider { /** @var IURLGenerator */ private $urlGenerator; - /** @var ILogger */ - private $logger; + /** @var IManager */ + private $activityManager; - public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, ILogger $logger) { - $this->logger = $logger; + public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, IManager $activityManager) { $this->urlGenerator = $urlGenerator; $this->l10n = $l10n; + $this->activityManager = $activityManager; } public function parse($language, IEvent $event, IEvent $previousEvent = null) { @@ -59,14 +59,22 @@ class SecurityProvider implements IProvider { $event->setParsedSubject($l->t('You successfully logged in using two-factor authentication (%1$s)', [ $params['provider'], ])); - $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png'))); + } else { + $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'))); + } break; case 'twofactor_failed': $params = $event->getSubjectParameters(); $event->setParsedSubject($l->t('A login attempt using two-factor authentication failed (%1$s)', [ $params['provider'], ])); - $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'))); + if ($this->activityManager->getRequirePNG()) { + $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png'))); + } else { + $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'))); + } break; default: throw new InvalidArgumentException(); diff --git a/settings/img/personal.png b/settings/img/personal.png new file mode 100644 index 0000000000000000000000000000000000000000..3c9c7345f65d1fbc1857f0988a96c16aca72be46 GIT binary patch literal 4217 zcmeH~%_~Gv7{<@Y$9y!5C{oO@YH8F-aC|WJOs`CYvc1%EBK&kp)@U*;ui$ zu_H1*8c{>Z#|CAPkMO)Tw`Okln)lr99UE``=G=4cbD#6hx#!$-?@Ujq%k8Xk3L)IV zfWH@|kFXcwHxi8|Q8>bZfrt>UGQuVn7AuAD)Cc`-ef`MHp;=TW|+9 z!5E-(mPP~IPr$bhakMuAOQIOAXF#uWrTrWl(wZK#a8x?UR?eB;I}EQR61d?eVB-p* z`vCb&J&jNvN6QkWjGj1#Da{L4E0aKiYYN>ZS1XgiKGzgFw$`cy_9T*JOTAD&gKSIi z6Ph}m4b}neZps=qTGG>W325#Q z*}eaZONSNkFe_^tGD+7l6JKx4{u0&3|Z)z*keuwX+-FqLabS KkbkXxXzB-nu;!8g literal 0 HcmV?d00001 From ca3a6ec6077e4248d56550b1acb19ab72546e808 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Jun 2017 14:25:24 +0200 Subject: [PATCH 3/3] Fix tests Signed-off-by: Joas Schilling --- .../tests/Unit/Activity/ProviderTest.php | 12 ++++++------ tests/Settings/Activity/SecurityProviderTest.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php index e1a13c89c1..a56098556e 100644 --- a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php @@ -25,8 +25,8 @@ namespace OCA\TwoFactorBackupCodes\Test\Unit\Activity; use InvalidArgumentException; use OCA\TwoFactorBackupCodes\Activity\Provider; use OCP\Activity\IEvent; +use OCP\Activity\IManager; use OCP\IL10N; -use OCP\ILogger; use OCP\IURLGenerator; use OCP\L10N\IFactory; use PHPUnit_Framework_MockObject_MockObject; @@ -34,14 +34,14 @@ use Test\TestCase; class ProviderTest extends TestCase { - /** @var IL10N|PHPUnit_Framework_MockObject_MockObject */ + /** @var IFactory|PHPUnit_Framework_MockObject_MockObject */ private $l10n; /** @var IURLGenerator|PHPUnit_Framework_MockObject_MockObject */ private $urlGenerator; - /** @var ILogger|PHPUnit_Framework_MockObject_MockObject */ - private $logger; + /** @var IManager|PHPUnit_Framework_MockObject_MockObject */ + private $activityManager; /** @var Provider */ private $provider; @@ -51,9 +51,9 @@ class ProviderTest extends TestCase { $this->l10n = $this->createMock(IFactory::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); - $this->logger = $this->createMock(ILogger::class); + $this->activityManager = $this->createMock(IManager::class); - $this->provider = new Provider($this->l10n, $this->urlGenerator, $this->logger); + $this->provider = new Provider($this->l10n, $this->urlGenerator, $this->activityManager); } public function testParseUnrelated() { diff --git a/tests/Settings/Activity/SecurityProviderTest.php b/tests/Settings/Activity/SecurityProviderTest.php index 2abc14654f..21fc28f3c3 100644 --- a/tests/Settings/Activity/SecurityProviderTest.php +++ b/tests/Settings/Activity/SecurityProviderTest.php @@ -25,8 +25,8 @@ namespace Tests\Settings\Activity; use InvalidArgumentException; use OC\Settings\Activity\SecurityProvider; use OCP\Activity\IEvent; +use OCP\Activity\IManager; use OCP\IL10N; -use OCP\ILogger; use OCP\IURLGenerator; use OCP\L10N\IFactory; use PHPUnit_Framework_MockObject_MockObject; @@ -34,14 +34,14 @@ use Test\TestCase; class SecurityProviderTest extends TestCase { - /** @var IL10N|PHPUnit_Framework_MockObject_MockObject */ + /** @var IFactory|PHPUnit_Framework_MockObject_MockObject */ private $l10n; /** @var IURLGenerator|PHPUnit_Framework_MockObject_MockObject */ private $urlGenerator; - /** @var ILogger|PHPUnit_Framework_MockObject_MockObject */ - private $logger; + /** @var IManager|PHPUnit_Framework_MockObject_MockObject */ + private $activityManager; /** @var SecurityProvider */ private $provider; @@ -51,9 +51,9 @@ class SecurityProviderTest extends TestCase { $this->l10n = $this->createMock(IFactory::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); - $this->logger = $this->createMock(ILogger::class); + $this->activityManager = $this->createMock(IManager::class); - $this->provider = new SecurityProvider($this->l10n, $this->urlGenerator, $this->logger); + $this->provider = new SecurityProvider($this->l10n, $this->urlGenerator, $this->activityManager); } public function testParseUnrelated() {