summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-10 15:21:25 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-10 15:21:25 +0200
commit1eb8b951c2eb6388efdd628c878110d78ae4e77d (patch)
tree30f62ea3dd0acf69384cd57d34024c8e82bbea13 /apps/updatenotification
parent518545fc2fc93f31d1885f143a0386c5449679f4 (diff)
downloadnextcloud-server-1eb8b951c2eb6388efdd628c878110d78ae4e77d.tar.gz
nextcloud-server-1eb8b951c2eb6388efdd628c878110d78ae4e77d.zip
more admin page splitup improvements
* bump version to ensure tables are created * make updatenotification app use settings api * change IAdmin::render() to getForm() and change return type from Template to TemplateResponse * adjust User_LDAP accordingly, as well as built-in forms * add IDateTimeFormatter to AppFramework/DependencyInjection/DIContainer.php. This is important so that \OC::$server->query() is able to resolve the constructor parameters. We should ensure that all OCP/* stuff that is available from \OC::$server is available here. Kudos to @LukasReschke * make sure apps that have settings info in their info.xml are loaded before triggering adding the settings setup method
Diffstat (limited to 'apps/updatenotification')
-rw-r--r--apps/updatenotification/admin.php26
-rw-r--r--apps/updatenotification/appinfo/info.xml6
-rw-r--r--apps/updatenotification/lib/Controller/AdminController.php28
3 files changed, 32 insertions, 28 deletions
diff --git a/apps/updatenotification/admin.php b/apps/updatenotification/admin.php
deleted file mode 100644
index 81c7a8fb557..00000000000
--- a/apps/updatenotification/admin.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Lukas Reschke <lukas@statuscode.ch>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-$app = new \OCA\UpdateNotification\AppInfo\Application();
-/** @var OCA\UpdateNotification\Controller\AdminController $controller */
-$controller = $app->getContainer()->query('AdminController');
-return $controller->displayPanel()->render();
diff --git a/apps/updatenotification/appinfo/info.xml b/apps/updatenotification/appinfo/info.xml
index 4070e90f221..2fe400a3587 100644
--- a/apps/updatenotification/appinfo/info.xml
+++ b/apps/updatenotification/appinfo/info.xml
@@ -5,7 +5,7 @@
<description>Displays update notifications for ownCloud and provides the SSO for the updater.</description>
<licence>AGPL</licence>
<author>Lukas Reschke</author>
- <version>1.1.0</version>
+ <version>1.1.1</version>
<namespace>UpdateNotification</namespace>
<default_enable/>
<dependencies>
@@ -15,4 +15,8 @@
<background-jobs>
<job>OCA\UpdateNotification\Notification\BackgroundJob</job>
</background-jobs>
+
+ <settings>
+ <admin>OCA\UpdateNotification\Controller\AdminController</admin>
+ </settings>
</info>
diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php
index ada04bdd68c..5f137120435 100644
--- a/apps/updatenotification/lib/Controller/AdminController.php
+++ b/apps/updatenotification/lib/Controller/AdminController.php
@@ -34,8 +34,9 @@ use OCP\IDateTimeFormatter;
use OCP\IL10N;
use OCP\IRequest;
use OCP\Security\ISecureRandom;
+use OCP\Settings\IAdmin;
-class AdminController extends Controller {
+class AdminController extends Controller implements IAdmin {
/** @var IJobList */
private $jobList;
/** @var ISecureRandom */
@@ -144,4 +145,29 @@ class AdminController extends Controller {
return new DataResponse($newToken);
}
+
+ /**
+ * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
+ */
+ public function getForm() {
+ return $this->displayPanel();
+ }
+
+ /**
+ * @return string the section ID, e.g. 'sharing'
+ */
+ public function getSection() {
+ return 'server';
+ }
+
+ /**
+ * @return int whether the form should be rather on the top or bottom of
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
+ *
+ * E.g.: 70
+ */
+ public function getPriority() {
+ return 5;
+ }
}