summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php4
-rw-r--r--lib/private/Settings/Admin/Encryption.php12
-rw-r--r--lib/private/Settings/Admin/Logging.php12
-rw-r--r--lib/private/Settings/Admin/Server.php12
-rw-r--r--lib/private/Settings/Admin/Sharing.php12
-rw-r--r--lib/private/Settings/Admin/TipsTricks.php12
-rw-r--r--lib/private/legacy/app.php1
-rw-r--r--lib/public/Settings/IAdmin.php6
8 files changed, 28 insertions, 43 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 66ca59d26e2..5ddfebc2c7f 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -124,6 +124,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getDateTimeZone();
});
+ $this->registerService('OCP\\IDateTimeFormatter', function($c) {
+ return $this->getServer()->getDateTimeFormatter();
+ });
+
$this->registerService('OCP\\IDb', function($c) {
return $this->getServer()->getDb();
});
diff --git a/lib/private/Settings/Admin/Encryption.php b/lib/private/Settings/Admin/Encryption.php
index 38197f71143..331ddf54520 100644
--- a/lib/private/Settings/Admin/Encryption.php
+++ b/lib/private/Settings/Admin/Encryption.php
@@ -24,9 +24,9 @@
namespace OC\Settings\Admin;
use OC\Encryption\Manager;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IUserManager;
use OCP\Settings\IAdmin;
-use OCP\Template;
class Encryption implements IAdmin {
/** @var Manager */
@@ -41,9 +41,9 @@ class Encryption implements IAdmin {
}
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse
*/
- public function render() {
+ public function getForm() {
$parameters = [
// Encryption API
'encryptionEnabled' => $this->manager->isEnabled(),
@@ -51,11 +51,7 @@ class Encryption implements IAdmin {
'externalBackendsEnabled' => count($this->userManager->getBackends()) > 1,
];
- $form = new Template('settings', 'admin/encryption');
- foreach ($parameters as $key => $value) {
- $form->assign($key, $value);
- }
- return $form;
+ return new TemplateResponse('settings', 'admin/encryption', $parameters, '');
}
/**
diff --git a/lib/private/Settings/Admin/Logging.php b/lib/private/Settings/Admin/Logging.php
index ead55810ec1..b05ea93388d 100644
--- a/lib/private/Settings/Admin/Logging.php
+++ b/lib/private/Settings/Admin/Logging.php
@@ -24,9 +24,9 @@
namespace OC\Settings\Admin;
use OC\Log\File as LogFile;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\IAdmin;
-use OCP\Template;
class Logging implements IAdmin {
/** @var IConfig */
@@ -37,9 +37,9 @@ class Logging implements IAdmin {
}
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse
*/
- public function render() {
+ public function getForm() {
$logType = $this->config->getSystemValue('log_type', 'file');
$showLog = ($logType === 'file' || $logType === 'owncloud');
@@ -60,11 +60,7 @@ class Logging implements IAdmin {
'showLog' => $showLog,
];
- $form = new Template('settings', 'admin/logging');
- foreach ($parameters as $key => $value) {
- $form->assign($key, $value);
- }
- return $form;
+ return new TemplateResponse('settings', 'admin/logging', $parameters, '');
}
/**
diff --git a/lib/private/Settings/Admin/Server.php b/lib/private/Settings/Admin/Server.php
index c0f3584c0af..ee2da154da2 100644
--- a/lib/private/Settings/Admin/Server.php
+++ b/lib/private/Settings/Admin/Server.php
@@ -26,10 +26,10 @@ namespace OC\Settings\Admin;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\SqlitePlatform;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\Settings\IAdmin;
-use OCP\Template;
class Server implements IAdmin {
@@ -45,9 +45,9 @@ class Server implements IAdmin {
}
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse
*/
- public function render() {
+ public function getForm() {
try {
if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) {
$invalidTransactionIsolationLevel = false;
@@ -87,11 +87,7 @@ class Server implements IAdmin {
'mail_smtppassword' => $this->config->getSystemValue('mail_smtppassword', ''),
];
- $form = new Template('settings', 'admin/server');
- foreach ($parameters as $key => $value) {
- $form->assign($key, $value);
- }
- return $form;
+ return new TemplateResponse('settings', 'admin/server', $parameters, '');
}
/**
diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php
index 7fefa4008a0..088021f9057 100644
--- a/lib/private/Settings/Admin/Sharing.php
+++ b/lib/private/Settings/Admin/Sharing.php
@@ -23,9 +23,9 @@
namespace OC\Settings\Admin;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\IAdmin;
-use OCP\Template;
class Sharing implements IAdmin {
/** @var IConfig */
@@ -36,9 +36,9 @@ class Sharing implements IAdmin {
}
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse
*/
- public function render() {
+ public function getForm() {
$excludeGroupsList = !is_null(json_decode($this->config->getAppValue('core', 'shareapi_exclude_groups_list', '')))
? implode('|', $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '')) : '';
@@ -52,11 +52,7 @@ class Sharing implements IAdmin {
'shareExcludedGroupsList' => $excludeGroupsList,
];
- $form = new Template('settings', 'admin/sharing');
- foreach ($parameters as $key => $value) {
- $form->assign($key, $value);
- }
- return $form;
+ return new TemplateResponse('settings', 'admin/sharing', $parameters, '');
}
/**
diff --git a/lib/private/Settings/Admin/TipsTricks.php b/lib/private/Settings/Admin/TipsTricks.php
index a0465f5e3ca..331c33db1c1 100644
--- a/lib/private/Settings/Admin/TipsTricks.php
+++ b/lib/private/Settings/Admin/TipsTricks.php
@@ -23,9 +23,9 @@
namespace OC\Settings\Admin;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\IAdmin;
-use OCP\Template;
class TipsTricks implements IAdmin {
/** @var IConfig */
@@ -36,20 +36,16 @@ class TipsTricks implements IAdmin {
}
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse
*/
- public function render() {
+ public function getForm() {
$databaseOverload = (strpos($this->config->getSystemValue('dbtype'), 'sqlite') !== false);
$parameters = [
'databaseOverload' => $databaseOverload,
];
- $form = new Template('settings', 'admin/tipstricks');
- foreach ($parameters as $key => $value) {
- $form->assign($key, $value);
- }
- return $form;
+ return new TemplateResponse('settings', 'admin/tipstricks', $parameters, '');
}
/**
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 39f2f1a0efe..bba4f59555e 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -1200,6 +1200,7 @@ class OC_App {
}
self::setupBackgroundJobs($appData['background-jobs']);
if(isset($appData['settings']) && is_array($appData['settings'])) {
+ self::loadApp($appId, false);
\OC::$server->getSettingsManager()->setupSettings($appData['settings']);
}
diff --git a/lib/public/Settings/IAdmin.php b/lib/public/Settings/IAdmin.php
index ce52e3da725..74977256a18 100644
--- a/lib/public/Settings/IAdmin.php
+++ b/lib/public/Settings/IAdmin.php
@@ -23,14 +23,14 @@
namespace OCP\Settings;
-use OCP\Template;
+use OCP\AppFramework\Http\TemplateResponse;
interface IAdmin {
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
*/
- public function render();
+ public function getForm();
/**
* @return string the section ID, e.g. 'sharing'