]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use PNG version of the icons for shipped activities
authorJoas Schilling <coding@schilljs.com>
Tue, 20 Jun 2017 11:48:51 +0000 (13:48 +0200)
committerJoas Schilling <coding@schilljs.com>
Fri, 7 Jul 2017 09:16:44 +0000 (11:16 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
30 files changed:
apps/comments/img/comments-dark.svg [new file with mode: 0644]
apps/comments/lib/Activity/Provider.php
apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
apps/dav/lib/CalDAV/Activity/Provider/Event.php
apps/dav/lib/CalDAV/Activity/Provider/Todo.php
apps/files/img/add-color.png [new file with mode: 0644]
apps/files/img/change.png [new file with mode: 0644]
apps/files/img/delete-color.png [new file with mode: 0644]
apps/files/lib/Activity/FavoriteProvider.php
apps/files/lib/Activity/Provider.php
apps/files_sharing/lib/Activity/Providers/Downloads.php
apps/files_sharing/lib/Activity/Providers/Groups.php
apps/files_sharing/lib/Activity/Providers/PublicLinks.php
apps/files_sharing/lib/Activity/Providers/RemoteShares.php
apps/files_sharing/lib/Activity/Providers/Users.php
apps/sharebymail/lib/Activity.php
apps/systemtags/lib/Activity/Provider.php
apps/twofactor_backupcodes/lib/Activity/Provider.php
core/img/actions/checkmark.png [new file with mode: 0644]
core/img/actions/comment.png [new file with mode: 0644]
core/img/actions/download.png [new file with mode: 0644]
core/img/actions/password.png [new file with mode: 0644]
core/img/actions/share.png [new file with mode: 0644]
core/img/actions/star.png [new file with mode: 0644]
core/img/actions/starred.png [new file with mode: 0644]
core/img/actions/tag.png [new file with mode: 0644]
core/img/places/calendar-dark.png [new file with mode: 0644]
settings/Activity/Provider.php
settings/Activity/SecurityProvider.php
settings/img/personal.png [new file with mode: 0644]

diff --git a/apps/comments/img/comments-dark.svg b/apps/comments/img/comments-dark.svg
new file mode 100644 (file)
index 0000000..d331ea7
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="32" width="32" viewBox="0 0 32 32"><path fill="#000" d="M16 3C7.163 3 0 7.925 0 14s7.163 11 16 11c.5 0 .98-.032 1.47-.063L26 32v-9.406c3.658-2.017 6-5.12 6-8.595 0-6.076-7.164-11-16-11z"/></svg>
index c55982827b3c5ea1200f5c9fe0ec2e15ca9c8732..7bf686e796e49e56952b043cd453dd795bea2d45 100644 (file)
@@ -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 {
index d7730da61f41bd3093063e59e030655abb6e658a..6082e68dcd2a868e8966eb7adcf7503056f416ae 100644 (file)
@@ -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}');
index daaace6b5be296191a30814dc380b80ce0726e11..b591eaa351c9ab515bdae39a64c81363d6545aaa 100644 (file)
@@ -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}');
index 747b39ddb7f1ca5e72bb5b2f56817692cebe64fd..0ad1d137455c181313a14afa7ac180bfa6aac4e0 100644 (file)
@@ -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 (file)
index 0000000..2211eb6
Binary files /dev/null and b/apps/files/img/add-color.png differ
diff --git a/apps/files/img/change.png b/apps/files/img/change.png
new file mode 100644 (file)
index 0000000..1465882
Binary files /dev/null and b/apps/files/img/change.png differ
diff --git a/apps/files/img/delete-color.png b/apps/files/img/delete-color.png
new file mode 100644 (file)
index 0000000..1d563db
Binary files /dev/null and b/apps/files/img/delete-color.png differ
index 941579e730d422f65dd9a1b259c61f2fef3db018..318ce66e6725d2a20fb658f2784700a29f44298c 100644 (file)
@@ -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();
                }
index c3289ed37038fa7fc9eeadc817ad365d23cd8df1..736b930b7aa8b2a0b638a5ff51ed815b57ab7439 100644 (file)
@@ -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();
                }
index eb14c16266cced51de811153f3c228563ac59684..1e1688d7b0f4ec13b8235cbb1813bbb1ce318cb2 100644 (file)
@@ -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;
index 06ccdaa98b30b5a9357e1bebaf1bf525555cbbfd..683927d5735de18c8b18cd925496ada25da08b3f 100644 (file)
@@ -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;
index b22ae0aa9b53d495b258eaa6db23b1bf26177bd3..98e4ebda2d8d7dd80b971243a4ae59f914e422c1 100644 (file)
@@ -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;
index 4e7d8ef3e27d4bd67cdc5cd09212857a7716470a..6ac0be76ff40af6c45cbfd0b4dac884e8e2ee09d 100644 (file)
@@ -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;
index eaab35bba9d0a07ade3f06080cbc58120654a212..02f47f3775ac9423e08c0b92fe1cd703cb7c7133 100644 (file)
@@ -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;
index 73751cb241e77781a806cad8bda5f318bb308b43..df9cb36e0d7fe5d64f0b802de84555072f96288b 100644 (file)
@@ -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();
index 5ef20c281bddfb94eef1d80a8f79cb14ec42ed18..db7ff94fd16feb6c9920231e8b982e2ba0e3e126 100644 (file)
@@ -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()) {
index 9c7aaeae6306e75e43d8384c872d2eceacd541b1..739ac9bbe13b62bd292a5e0c049a5757abc895ec 100644 (file)
@@ -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 (file)
index 0000000..eb93869
Binary files /dev/null and b/core/img/actions/checkmark.png differ
diff --git a/core/img/actions/comment.png b/core/img/actions/comment.png
new file mode 100644 (file)
index 0000000..0dec289
Binary files /dev/null and b/core/img/actions/comment.png differ
diff --git a/core/img/actions/download.png b/core/img/actions/download.png
new file mode 100644 (file)
index 0000000..6808969
Binary files /dev/null and b/core/img/actions/download.png differ
diff --git a/core/img/actions/password.png b/core/img/actions/password.png
new file mode 100644 (file)
index 0000000..afe3e31
Binary files /dev/null and b/core/img/actions/password.png differ
diff --git a/core/img/actions/share.png b/core/img/actions/share.png
new file mode 100644 (file)
index 0000000..8cc66f0
Binary files /dev/null and b/core/img/actions/share.png differ
diff --git a/core/img/actions/star.png b/core/img/actions/star.png
new file mode 100644 (file)
index 0000000..61727fc
Binary files /dev/null and b/core/img/actions/star.png differ
diff --git a/core/img/actions/starred.png b/core/img/actions/starred.png
new file mode 100644 (file)
index 0000000..aa5bced
Binary files /dev/null and b/core/img/actions/starred.png differ
diff --git a/core/img/actions/tag.png b/core/img/actions/tag.png
new file mode 100644 (file)
index 0000000..6a466b3
Binary files /dev/null and b/core/img/actions/tag.png differ
diff --git a/core/img/places/calendar-dark.png b/core/img/places/calendar-dark.png
new file mode 100644 (file)
index 0000000..88e8ea6
Binary files /dev/null and b/core/img/places/calendar-dark.png differ
index 7893b450a44c7fd53f936ea2fc1fc1070eeb709e..575b7e9b569dea18a51168f8baec1e44b4f51807 100644 (file)
@@ -22,6 +22,7 @@
 namespace OC\Settings\Activity;
 
 use OCP\Activity\IEvent;
+use OCP\Activity\IManager;
 use OCP\Activity\IProvider;
 use OCP\IL10N;
 use OCP\IURLGenerator;
@@ -50,6 +51,9 @@ class Provider implements IProvider {
        /** @var IUserManager */
        protected $userManager;
 
+       /** @var IManager */
+       private $activityManager;
+
        /** @var string[] cached displayNames - key is the UID and value the displayname */
        protected $displayNames = [];
 
@@ -57,11 +61,13 @@ class Provider implements IProvider {
         * @param IFactory $languageFactory
         * @param IURLGenerator $url
         * @param IUserManager $userManager
+        * @param IManager $activityManager
         */
-       public function __construct(IFactory $languageFactory, IURLGenerator $url, IUserManager $userManager) {
+       public function __construct(IFactory $languageFactory, IURLGenerator $url, IUserManager $userManager, IManager $activityManager) {
                $this->languageFactory = $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');
index 74747f684daf2fd3ff1340b6146310c1b2c18192..7b27fde363f1e55315f658e90723cc7caa3b1094 100644 (file)
@@ -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 (file)
index 0000000..3c9c734
Binary files /dev/null and b/settings/img/personal.png differ