From fbad651ebd31d09406ef141e61ea396ad1eda710 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 21 Oct 2014 15:14:19 +0200 Subject: Make config.ini editable in the admin interface --- config/appconfig.php | 26 +++++++++++++++++++++++--- config/schema.json | 3 +++ 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/appconfig.php b/config/appconfig.php index 89c02a1de..e738b22cd 100644 --- a/config/appconfig.php +++ b/config/appconfig.php @@ -13,11 +13,11 @@ namespace OCA\News\Config; -use OCP\INavigationManager; -use OCP\IURLGenerator; +use \OCP\INavigationManager; +use \OCP\IURLGenerator; use \OCP\Backgroundjob; use \OCP\Util; - +use \OCP\App; // Used to parse app.json file, should be in core at some point class AppConfig { @@ -97,6 +97,17 @@ class AppConfig { } + /** + * Registers all config options + */ + public function registerAll() { + $this->registerNavigation(); + $this->registerBackgroundJobs(); + $this->registerHooks(); + $this->registerAdmin(); + } + + /** * Parses the navigation and creates a navigation entry if needed */ @@ -120,6 +131,15 @@ class AppConfig { } + /** + * Registers admin pages + */ + public function registerAdmin() { + if ($this->config['admin']) { + App::registerAdmin($this->config['id'], 'admin/admin'); + } + } + /** * Registers all jobs in the config diff --git a/config/schema.json b/config/schema.json index 7e44878c9..c65a1c8dd 100644 --- a/config/schema.json +++ b/config/schema.json @@ -16,6 +16,9 @@ "type": "string", "enum": ["AGPL", "MIT", "GPL", "LGPL", "BSD","Apache"] }, + "admin": { + "type": "boolean" + }, "version": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]+)*$" -- cgit v1.2.3