summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-01-27 20:47:41 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-01-28 08:45:07 +0100
commitd8e9cefcfeaf8a98d1af41a118915d0bab34e809 (patch)
treed2c512187ac614130ef411620504517ab9d6a8a5 /apps
parent35502b889299e2838e91f8303851d2ca38ad443d (diff)
downloadnextcloud-server-d8e9cefcfeaf8a98d1af41a118915d0bab34e809.tar.gz
nextcloud-server-d8e9cefcfeaf8a98d1af41a118915d0bab34e809.zip
Move the Personal sections to the settings app
There is no need to have weird magic in the manager. This should be properly registered in the right way. The settings code is messy anyways. This is a start to make it a tad more clean. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/appinfo/info.xml6
-rw-r--r--apps/settings/composer/composer/autoload_classmap.php3
-rw-r--r--apps/settings/composer/composer/autoload_static.php3
-rw-r--r--apps/settings/lib/Sections/Personal/PersonalInfo.php59
-rw-r--r--apps/settings/lib/Sections/Personal/Security.php59
-rw-r--r--apps/settings/lib/Sections/Personal/SyncClients.php59
6 files changed, 189 insertions, 0 deletions
diff --git a/apps/settings/appinfo/info.xml b/apps/settings/appinfo/info.xml
index f636198edd6..d774988f4a9 100644
--- a/apps/settings/appinfo/info.xml
+++ b/apps/settings/appinfo/info.xml
@@ -16,4 +16,10 @@
<dependencies>
<nextcloud min-version="19" max-version="19"/>
</dependencies>
+
+ <settings>
+ <personal-section>OCA\Settings\Sections\Personal\PersonalInfo</personal-section>
+ <personal-section>OCA\Settings\Sections\Personal\Security</personal-section>
+ <personal-section>OCA\Settings\Sections\Personal\SyncClients</personal-section>
+ </settings>
</info>
diff --git a/apps/settings/composer/composer/autoload_classmap.php b/apps/settings/composer/composer/autoload_classmap.php
index a59c31701e8..ac7bd9577e0 100644
--- a/apps/settings/composer/composer/autoload_classmap.php
+++ b/apps/settings/composer/composer/autoload_classmap.php
@@ -41,4 +41,7 @@ return array(
'OCA\\Settings\\Personal\\Security' => $baseDir . '/../lib/Settings/Personal/Security.php',
'OCA\\Settings\\Personal\\Security\\Authtokens' => $baseDir . '/../lib/Settings/Personal/Security/Authtokens.php',
'OCA\\Settings\\Personal\\ServerDevNotice' => $baseDir . '/../lib/Settings/Personal/ServerDevNotice.php',
+ 'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => $baseDir . '/../lib/Sections/Personal/PersonalInfo.php',
+ 'OCA\\Settings\\Sections\\Personal\\Security' => $baseDir . '/../lib/Sections/Personal/Security.php',
+ 'OCA\\Settings\\Sections\\Personal\\SyncClients' => $baseDir . '/../lib/Sections/Personal/SyncClients.php',
);
diff --git a/apps/settings/composer/composer/autoload_static.php b/apps/settings/composer/composer/autoload_static.php
index 2545c97d220..36ae0f3a5d0 100644
--- a/apps/settings/composer/composer/autoload_static.php
+++ b/apps/settings/composer/composer/autoload_static.php
@@ -56,6 +56,9 @@ class ComposerStaticInitSettings
'OCA\\Settings\\Personal\\Security' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security.php',
'OCA\\Settings\\Personal\\Security\\Authtokens' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/Authtokens.php',
'OCA\\Settings\\Personal\\ServerDevNotice' => __DIR__ . '/..' . '/../lib/Settings/Personal/ServerDevNotice.php',
+ 'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => __DIR__ . '/..' . '/../lib/Sections/Personal/PersonalInfo.php',
+ 'OCA\\Settings\\Sections\\Personal\\Security' => __DIR__ . '/..' . '/../lib/Sections/Personal/Security.php',
+ 'OCA\\Settings\\Sections\\Personal\\SyncClients' => __DIR__ . '/..' . '/../lib/Sections/Personal/SyncClients.php',
);
public static function getInitializer(ClassLoader $loader)
diff --git a/apps/settings/lib/Sections/Personal/PersonalInfo.php b/apps/settings/lib/Sections/Personal/PersonalInfo.php
new file mode 100644
index 00000000000..9457da5ff03
--- /dev/null
+++ b/apps/settings/lib/Sections/Personal/PersonalInfo.php
@@ -0,0 +1,59 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.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\Settings\Sections\Personal;
+
+use OCP\IL10N;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
+
+class PersonalInfo implements IIconSection {
+
+ /** @var IL10N */
+ private $l;
+
+ /** @var IURLGenerator */
+ private $urlGenerator;
+
+ public function __construct(IL10N $l, IURLGenerator $urlGenerator) {
+ $this->l = $l;
+ $this->urlGenerator = $urlGenerator;
+ }
+
+ public function getIcon() {
+ return $this->urlGenerator->imagePath('core', 'actions/user.svg');
+ }
+
+ public function getID(): string {
+ return 'personal-info';
+ }
+
+ public function getName(): string {
+ return $this->l->t('Personal info');
+ }
+
+ public function getPriority(): int {
+ return 0;
+ }
+}
diff --git a/apps/settings/lib/Sections/Personal/Security.php b/apps/settings/lib/Sections/Personal/Security.php
new file mode 100644
index 00000000000..31a1bb2e090
--- /dev/null
+++ b/apps/settings/lib/Sections/Personal/Security.php
@@ -0,0 +1,59 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.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\Settings\Sections\Personal;
+
+use OCP\IL10N;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
+
+class Security implements IIconSection {
+
+ /** @var IL10N */
+ private $l;
+
+ /** @var IURLGenerator */
+ private $urlGenerator;
+
+ public function __construct(IL10N $l, IURLGenerator $urlGenerator) {
+ $this->l = $l;
+ $this->urlGenerator = $urlGenerator;
+ }
+
+ public function getIcon() {
+ return $this->urlGenerator->imagePath('settings', 'password.svg');
+ }
+
+ public function getID(): string {
+ return 'security';
+ }
+
+ public function getName(): string {
+ return $this->l->t('Security');
+ }
+
+ public function getPriority(): int {
+ return 5;
+ }
+}
diff --git a/apps/settings/lib/Sections/Personal/SyncClients.php b/apps/settings/lib/Sections/Personal/SyncClients.php
new file mode 100644
index 00000000000..7670d387d34
--- /dev/null
+++ b/apps/settings/lib/Sections/Personal/SyncClients.php
@@ -0,0 +1,59 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.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\Settings\Sections\Personal;
+
+use OCP\IL10N;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
+
+class SyncClients implements IIconSection {
+
+ /** @var IL10N */
+ private $l;
+
+ /** @var IURLGenerator */
+ private $urlGenerator;
+
+ public function __construct(IL10N $l, IURLGenerator $urlGenerator) {
+ $this->l = $l;
+ $this->urlGenerator = $urlGenerator;
+ }
+
+ public function getIcon() {
+ return $this->urlGenerator->imagePath('core', 'clients/phone.svg');
+ }
+
+ public function getID(): string {
+ return 'sync-clients';
+ }
+
+ public function getName(): string {
+ return $this->l->t('Mobile & desktop');
+ }
+
+ public function getPriority(): int {
+ return 15;
+ }
+}