diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-07 15:42:43 -0500 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-09 21:43:01 -0500 |
commit | 5b4adf66e51e21b3ecbd683397a362b60f792a50 (patch) | |
tree | 8bdc129ac9fd6575ee41be438ff667e49f7110a2 /settings | |
parent | ca9d25169dcdd2923a356e2a797d8704506a3787 (diff) | |
download | nextcloud-server-5b4adf66e51e21b3ecbd683397a362b60f792a50.tar.gz nextcloud-server-5b4adf66e51e21b3ecbd683397a362b60f792a50.zip |
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
OCP\Defaults or OC_Defaults (which is extended by
OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
it hard to work on theme values
* this extended the public interface with the missing
methods and uses them everywhere to only rely on the
public interface
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Application.php | 7 | ||||
-rw-r--r-- | settings/Mailer/NewUserMailHelper.php | 8 | ||||
-rw-r--r-- | settings/templates/personal.php | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/settings/Application.php b/settings/Application.php index bf149def94d..8ec8d5eb8a5 100644 --- a/settings/Application.php +++ b/settings/Application.php @@ -35,11 +35,10 @@ use OC\App\AppStore\Fetcher\CategoryFetcher; use OC\AppFramework\Utility\TimeFactory; use OC\Authentication\Token\IProvider; use OC\Server; -use OC\ServerContainer; use OC\Settings\Mailer\NewUserMailHelper; use OC\Settings\Middleware\SubadminMiddleware; -use OCA\Theming\ThemingDefaults; use OCP\AppFramework\App; +use OCP\Defaults; use OCP\IContainer; use OCP\Settings\IManager; use OCP\Util; @@ -94,9 +93,11 @@ class Application extends App { $container->registerService(NewUserMailHelper::class, function (IContainer $c) { /** @var Server $server */ $server = $c->query('ServerContainer'); + /** @var Defaults $defaults */ + $defaults = $server->query(Defaults::class); return new NewUserMailHelper( - $server->getThemingDefaults(), + $defaults, $server->getURLGenerator(), $server->getL10N('settings'), $server->getMailer(), diff --git a/settings/Mailer/NewUserMailHelper.php b/settings/Mailer/NewUserMailHelper.php index 15b912f803a..a381c32efbf 100644 --- a/settings/Mailer/NewUserMailHelper.php +++ b/settings/Mailer/NewUserMailHelper.php @@ -23,8 +23,8 @@ namespace OC\Settings\Mailer; use OC\Mail\EMailTemplate; use OC\Mail\IEMailTemplate; -use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Defaults; use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; @@ -34,7 +34,7 @@ use OCP\Security\ICrypto; use OCP\Security\ISecureRandom; class NewUserMailHelper { - /** @var ThemingDefaults */ + /** @var Defaults */ private $themingDefaults; /** @var IURLGenerator */ private $urlGenerator; @@ -54,7 +54,7 @@ class NewUserMailHelper { private $fromAddress; /** - * @param ThemingDefaults $themingDefaults + * @param Defaults $themingDefaults * @param IURLGenerator $urlGenerator * @param IL10N $l10n * @param IMailer $mailer @@ -64,7 +64,7 @@ class NewUserMailHelper { * @param ICrypto $crypto * @param string $fromAddress */ - public function __construct(ThemingDefaults $themingDefaults, + public function __construct(Defaults $themingDefaults, IURLGenerator $urlGenerator, IL10N $l10n, IMailer $mailer, diff --git a/settings/templates/personal.php b/settings/templates/personal.php index d94fbb33770..1fe8f859fe6 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -5,7 +5,7 @@ */ /** @var $_ mixed[]|\OCP\IURLGenerator[] */ -/** @var \OC_Defaults $theme */ +/** @var \OCP\Defaults $theme */ ?> <div id="app-navigation"> |