]> source.dussan.org Git - nextcloud-server.git/commitdiff
move calendar settings into their own group
authorRobin Appelman <robin@icewind.nl>
Tue, 25 Aug 2020 17:11:28 +0000 (19:11 +0200)
committerRobin Appelman <robin@icewind.nl>
Tue, 25 Aug 2020 17:11:28 +0000 (19:11 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/composer/composer/autoload_classmap.php
apps/dav/composer/composer/autoload_static.php
apps/dav/lib/CalDAV/Activity/Setting/CalDAVSetting.php [new file with mode: 0644]
apps/dav/lib/CalDAV/Activity/Setting/Calendar.php
apps/dav/lib/CalDAV/Activity/Setting/Event.php
apps/dav/lib/CalDAV/Activity/Setting/Todo.php

index 0e465971a5eed610bd6e5db07412f0c72e9df743..aaa5e82da04554b9c9efbed1865b0367d0c4e23b 100644 (file)
@@ -27,6 +27,7 @@ return array(
     'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Provider/Calendar.php',
     'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir . '/../lib/CalDAV/Activity/Provider/Event.php',
     'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Provider/Todo.php',
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => $baseDir . '/../lib/CalDAV/Activity/Setting/CalDAVSetting.php',
     'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Setting/Calendar.php',
     'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir . '/../lib/CalDAV/Activity/Setting/Event.php',
     'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Setting/Todo.php',
index 4788a41ef0092f60772c7957948d50eaa98c30c3..0dc34f5a3172b0ee2222fc50dc9655f580f8d939 100644 (file)
@@ -42,6 +42,7 @@ class ComposerStaticInitDAV
         'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Calendar.php',
         'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Event.php',
         'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Todo.php',
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/CalDAVSetting.php',
         'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Calendar.php',
         'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Event.php',
         'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Todo.php',
diff --git a/apps/dav/lib/CalDAV/Activity/Setting/CalDAVSetting.php b/apps/dav/lib/CalDAV/Activity/Setting/CalDAVSetting.php
new file mode 100644 (file)
index 0000000..b20c273
--- /dev/null
@@ -0,0 +1,47 @@
+<?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\DAV\CalDAV\Activity\Setting;
+
+use OCP\Activity\ActivitySettings;
+use OCP\IL10N;
+
+abstract class CalDAVSetting extends ActivitySettings {
+       /** @var IL10N */
+       protected $l;
+
+       /**
+        * @param IL10N $l
+        */
+       public function __construct(IL10N $l) {
+               $this->l = $l;
+       }
+
+       public function getGroupIdentifier() {
+               return 'calendar';
+       }
+
+       public function getGroupName() {
+               return $this->l->t("Calendar and tasks");
+       }
+}
index b9475535e4dfe8bcbf011db85e6726c3af7fb117..06cbe33946d12b6d2345a45b6ed01b6bb69d381b 100644 (file)
 
 namespace OCA\DAV\CalDAV\Activity\Setting;
 
-use OCP\Activity\ISetting;
-use OCP\IL10N;
-
-class Calendar implements ISetting {
-
-       /** @var IL10N */
-       protected $l;
-
-       /**
-        * @param IL10N $l
-        */
-       public function __construct(IL10N $l) {
-               $this->l = $l;
-       }
-
+class Calendar extends CalDAVSetting {
        /**
         * @return string Lowercase a-z and underscore only identifier
         * @since 11.0.0
index 1cd3fc3a051c5585a40ec70ab55f7b93bc4ac523..d0c1676773c6831924a9dbd4fc87e31f4af6b415 100644 (file)
 
 namespace OCA\DAV\CalDAV\Activity\Setting;
 
-use OCP\Activity\ISetting;
-use OCP\IL10N;
-
-class Event implements ISetting {
-
-       /** @var IL10N */
-       protected $l;
-
-       /**
-        * @param IL10N $l
-        */
-       public function __construct(IL10N $l) {
-               $this->l = $l;
-       }
-
+class Event extends CalDAVSetting {
        /**
         * @return string Lowercase a-z and underscore only identifier
         * @since 11.0.0
index 2dfc85957c6eb8215ac1ef4052fee184281af56c..5ebc4ec2404624c0d4a39f6064c1cd5bf5bf8783 100644 (file)
 
 namespace OCA\DAV\CalDAV\Activity\Setting;
 
-use OCP\Activity\ISetting;
-use OCP\IL10N;
-
-class Todo implements ISetting {
-
-       /** @var IL10N */
-       protected $l;
-
-       /**
-        * @param IL10N $l
-        */
-       public function __construct(IL10N $l) {
-               $this->l = $l;
-       }
+class Todo extends CalDAVSetting {
 
        /**
         * @return string Lowercase a-z and underscore only identifier