summaryrefslogtreecommitdiffstats
path: root/appinfo
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 15:14:19 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 15:14:19 +0200
commitfbad651ebd31d09406ef141e61ea396ad1eda710 (patch)
treeb57b142031c4e291856cc607fb3697b537b48b49 /appinfo
parentb02f22f86b6e89483948e5bf9605558a78046efd (diff)
Make config.ini editable in the admin interface
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.json1
-rw-r--r--appinfo/app.php5
-rw-r--r--appinfo/application.php17
-rw-r--r--appinfo/preupdate.php0
-rw-r--r--appinfo/routes.php3
5 files changed, 21 insertions, 5 deletions
diff --git a/appinfo/app.json b/appinfo/app.json
index 5e110c8a9..6d8ed231d 100644
--- a/appinfo/app.json
+++ b/appinfo/app.json
@@ -34,6 +34,7 @@
"hooks": {
"OC_User::pre_deleteUser": "OCA\\News\\Hooks\\User::deleteUser"
},
+ "admin": true,
"categories": ["Multimedia"],
"dependencies": {
"databases": ["pgsql", "sqlite3", "mysql"],
diff --git a/appinfo/app.php b/appinfo/app.php
index a6de66ce2..8188d3eeb 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -26,6 +26,5 @@ set_error_handler(function ($code, $message) {
$container = new Application();
$config = $container->getAppConfig();
-$config->registerNavigation();
-$config->registerBackgroundJobs();
-$config->registerHooks(); \ No newline at end of file
+$config->registerAll();
+$config->testDependencies(); \ No newline at end of file
diff --git a/appinfo/application.php b/appinfo/application.php
index cdbaa82d6..e410ce701 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -21,6 +21,7 @@ use \OCP\User;
use \OCA\News\Config\AppConfig;
use \OCA\News\Config\Config;
+use \OCA\News\Controller\AdminController;
use \OCA\News\Controller\PageController;
use \OCA\News\Controller\FolderController;
use \OCA\News\Controller\FeedController;
@@ -92,6 +93,15 @@ class Application extends App {
);
});
+ $container->registerService('AdminController', function($c) {
+ return new AdminController(
+ $c->query('AppName'),
+ $c->query('Request'),
+ $c->query('Config'),
+ $c->query('ConfigPath')
+ );
+ });
+
$container->registerService('FolderController', function($c) {
return new FolderController(
$c->query('AppName'),
@@ -329,13 +339,17 @@ class Application extends App {
return $view;
});
+ $container->registerService('ConfigPath', function() {
+ return 'config.ini';
+ });
+
$container->registerService('Config', function($c) {
$config = new Config(
$c->query('ConfigView'),
$c->query('Logger'),
$c->query('LoggerParameters')
);
- $config->read('config.ini', true);
+ $config->read($c->query('ConfigPath'), true);
return $config;
});
@@ -470,6 +484,5 @@ class Application extends App {
}
- public function dispatchPart($controller, $)
}
diff --git a/appinfo/preupdate.php b/appinfo/preupdate.php
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/appinfo/preupdate.php
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 7703de1c7..930fdb136 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -23,6 +23,9 @@ $application->registerRoutes($this, ['routes' => [
['name' => 'page#update_settings', 'url' => '/settings', 'verb' => 'PUT'],
['name' => 'page#manifest', 'url' => '/manifest.webapp', 'verb' => 'GET'],
+ // admin
+ ['name' => 'admin#update', 'url' => '/admin', 'verb' => 'PUT'],
+
// folders
['name' => 'folder#index', 'url' => '/folders', 'verb' => 'GET'],
['name' => 'folder#create', 'url' => '/folders', 'verb' => 'POST'],