diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-08-11 11:24:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 11:24:23 +0200 |
commit | 8fc877ff7dbe7e51a6da93f076f27216b57bc8cb (patch) | |
tree | d34dc9fea0323ea810d4c76a07eff87c9e5a8038 /apps/files/lib | |
parent | 5d3ecfdffdf97e7b7e67263dd582618c3e24e874 (diff) | |
parent | 227e362842a2340591608d6cb209e46a817f3403 (diff) | |
download | nextcloud-server-8fc877ff7dbe7e51a6da93f076f27216b57bc8cb.tar.gz nextcloud-server-8fc877ff7dbe7e51a6da93f076f27216b57bc8cb.zip |
Merge pull request #22117 from nextcloud/activity-settings-grouping
allow grouping of activity settings
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Activity/Settings/FavoriteAction.php | 16 | ||||
-rw-r--r-- | apps/files/lib/Activity/Settings/FileActivitySettings.php | 48 | ||||
-rw-r--r-- | apps/files/lib/Activity/Settings/FileChanged.php | 16 | ||||
-rw-r--r-- | apps/files/lib/Activity/Settings/FileCreated.php | 16 | ||||
-rw-r--r-- | apps/files/lib/Activity/Settings/FileDeleted.php | 16 | ||||
-rw-r--r-- | apps/files/lib/Activity/Settings/FileFavorite.php | 16 | ||||
-rw-r--r-- | apps/files/lib/Activity/Settings/FileRestored.php | 16 |
7 files changed, 54 insertions, 90 deletions
diff --git a/apps/files/lib/Activity/Settings/FavoriteAction.php b/apps/files/lib/Activity/Settings/FavoriteAction.php index 9db53eada8e..017669a137c 100644 --- a/apps/files/lib/Activity/Settings/FavoriteAction.php +++ b/apps/files/lib/Activity/Settings/FavoriteAction.php @@ -23,21 +23,7 @@ namespace OCA\Files\Activity\Settings; -use OCP\Activity\ISetting; -use OCP\IL10N; - -class FavoriteAction implements ISetting { - - /** @var IL10N */ - protected $l; - - /** - * @param IL10N $l - */ - public function __construct(IL10N $l) { - $this->l = $l; - } - +class FavoriteAction extends FileActivitySettings { /** * @return string Lowercase a-z and underscore only identifier * @since 11.0.0 diff --git a/apps/files/lib/Activity/Settings/FileActivitySettings.php b/apps/files/lib/Activity/Settings/FileActivitySettings.php new file mode 100644 index 00000000000..0ec7cb27be5 --- /dev/null +++ b/apps/files/lib/Activity/Settings/FileActivitySettings.php @@ -0,0 +1,48 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCA\Files\Activity\Settings; + +use OCP\Activity\ActivitySettings; +use OCP\IL10N; + +abstract class FileActivitySettings extends ActivitySettings { + /** @var IL10N */ + protected $l; + + /** + * @param IL10N $l + */ + public function __construct(IL10N $l) { + $this->l = $l; + } + + public function getGroupIdentifier() { + return 'files'; + } + + public function getGroupName() { + return $this->l->t('Files'); + } +} diff --git a/apps/files/lib/Activity/Settings/FileChanged.php b/apps/files/lib/Activity/Settings/FileChanged.php index 503201bd129..bf3780a575f 100644 --- a/apps/files/lib/Activity/Settings/FileChanged.php +++ b/apps/files/lib/Activity/Settings/FileChanged.php @@ -23,21 +23,7 @@ namespace OCA\Files\Activity\Settings; -use OCP\Activity\ISetting; -use OCP\IL10N; - -class FileChanged implements ISetting { - - /** @var IL10N */ - protected $l; - - /** - * @param IL10N $l - */ - public function __construct(IL10N $l) { - $this->l = $l; - } - +class FileChanged extends FileActivitySettings { /** * @return string Lowercase a-z and underscore only identifier * @since 11.0.0 diff --git a/apps/files/lib/Activity/Settings/FileCreated.php b/apps/files/lib/Activity/Settings/FileCreated.php index 481c719d024..589f905286a 100644 --- a/apps/files/lib/Activity/Settings/FileCreated.php +++ b/apps/files/lib/Activity/Settings/FileCreated.php @@ -23,21 +23,7 @@ namespace OCA\Files\Activity\Settings; -use OCP\Activity\ISetting; -use OCP\IL10N; - -class FileCreated implements ISetting { - - /** @var IL10N */ - protected $l; - - /** - * @param IL10N $l - */ - public function __construct(IL10N $l) { - $this->l = $l; - } - +class FileCreated extends FileActivitySettings { /** * @return string Lowercase a-z and underscore only identifier * @since 11.0.0 diff --git a/apps/files/lib/Activity/Settings/FileDeleted.php b/apps/files/lib/Activity/Settings/FileDeleted.php index d4e56b6c717..05754463bc2 100644 --- a/apps/files/lib/Activity/Settings/FileDeleted.php +++ b/apps/files/lib/Activity/Settings/FileDeleted.php @@ -23,21 +23,7 @@ namespace OCA\Files\Activity\Settings; -use OCP\Activity\ISetting; -use OCP\IL10N; - -class FileDeleted implements ISetting { - - /** @var IL10N */ - protected $l; - - /** - * @param IL10N $l - */ - public function __construct(IL10N $l) { - $this->l = $l; - } - +class FileDeleted extends FileActivitySettings { /** * @return string Lowercase a-z and underscore only identifier * @since 11.0.0 diff --git a/apps/files/lib/Activity/Settings/FileFavorite.php b/apps/files/lib/Activity/Settings/FileFavorite.php index ac62242f703..72ba01e537a 100644 --- a/apps/files/lib/Activity/Settings/FileFavorite.php +++ b/apps/files/lib/Activity/Settings/FileFavorite.php @@ -23,21 +23,7 @@ namespace OCA\Files\Activity\Settings; -use OCP\Activity\ISetting; -use OCP\IL10N; - -class FileFavorite implements ISetting { - - /** @var IL10N */ - protected $l; - - /** - * @param IL10N $l - */ - public function __construct(IL10N $l) { - $this->l = $l; - } - +class FileFavorite extends FileActivitySettings { /** * @return string Lowercase a-z and underscore only identifier * @since 11.0.0 diff --git a/apps/files/lib/Activity/Settings/FileRestored.php b/apps/files/lib/Activity/Settings/FileRestored.php index 59b722ddf85..f149554bc88 100644 --- a/apps/files/lib/Activity/Settings/FileRestored.php +++ b/apps/files/lib/Activity/Settings/FileRestored.php @@ -23,21 +23,7 @@ namespace OCA\Files\Activity\Settings; -use OCP\Activity\ISetting; -use OCP\IL10N; - -class FileRestored implements ISetting { - - /** @var IL10N */ - protected $l; - - /** - * @param IL10N $l - */ - public function __construct(IL10N $l) { - $this->l = $l; - } - +class FileRestored extends FileActivitySettings { /** * @return string Lowercase a-z and underscore only identifier * @since 11.0.0 |