diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php index 07dfe75ec6..03356c1138 100644 --- a/apps/theming/lib/Settings/Admin.php +++ b/apps/theming/lib/Settings/Admin.php @@ -23,7 +23,7 @@ namespace OCA\Theming\Settings; -use OCA\Theming\Template; +use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\IL10N; @@ -44,7 +44,7 @@ class Admin implements ISettings { /** @var IURLGenerator */ private $urlGenerator; - public function __construct(IConfig $config, IL10N $l, Template $themingDefaults, IURLGenerator $urlGenerator) { + public function __construct(IConfig $config, IL10N $l, ThemingDefaults $themingDefaults, IURLGenerator $urlGenerator) { $this->config = $config; $this->l = $l; $this->themingDefaults = $themingDefaults; diff --git a/apps/theming/lib/Template.php b/apps/theming/lib/ThemingDefaults.php similarity index 91% rename from apps/theming/lib/Template.php rename to apps/theming/lib/ThemingDefaults.php index 25730aad95..a7af208b96 100644 --- a/apps/theming/lib/Template.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -1,11 +1,6 @@ - * @copyright Copyright (c) 2016 Lukas Reschke - * - * @author Bjoern Schiessle - * @author Joas Schilling - * @author Lukas Reschke * * @license GNU AGPL version 3 or any later version * @@ -24,20 +19,19 @@ * */ + namespace OCA\Theming; + + + use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; -/** - * Class Template - * - * Handle all the values which can be modified by this app - * - * @package OCA\Theming - */ -class Template extends \OC_Defaults { + +class ThemingDefaults extends \OC_Defaults { + /** @var IConfig */ private $config; /** @var IL10N */ @@ -92,7 +86,7 @@ class Template extends \OC_Defaults { public function getEntity() { return $this->config->getAppValue('theming', 'name', $this->name); } - + public function getBaseUrl() { return $this->config->getAppValue('theming', 'url', $this->url); } @@ -168,4 +162,5 @@ class Template extends \OC_Defaults { return $returnValue; } + } diff --git a/apps/theming/tests/TemplateTest.php b/apps/theming/tests/ThemingDefaultsTest.php similarity index 98% rename from apps/theming/tests/TemplateTest.php rename to apps/theming/tests/ThemingDefaultsTest.php index c3c792657e..3440282531 100644 --- a/apps/theming/tests/TemplateTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -24,12 +24,13 @@ namespace OCA\Theming\Tests; use OCA\Theming\Template; +use OCA\Theming\ThemingDefaults; use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; use Test\TestCase; -class TemplateTest extends TestCase { +class ThemingDefaultsTest extends TestCase { /** @var IConfig */ private $config; /** @var IL10N */ @@ -64,7 +65,7 @@ class TemplateTest extends TestCase { ->expects($this->at(3)) ->method('getMailHeaderColor') ->willReturn('#000'); - $this->template = new Template( + $this->template = new ThemingDefaults( $this->config, $this->l10n, $this->urlGenerator, diff --git a/lib/private/Server.php b/lib/private/Server.php index 53c8ee8492..2bbc4871d0 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -82,7 +82,7 @@ use OC\Security\SecureRandom; use OC\Security\TrustedDomainHelper; use OC\Session\CryptoWrapper; use OC\Tagging\TagMapper; -use OCA\Theming\Template; +use OCA\Theming\ThemingDefaults; use OCP\IL10N; use OCP\IServerContainer; use OCP\Security\IContentSecurityPolicyManager; @@ -651,7 +651,7 @@ class Server extends ServerContainer implements IServerContainer { } if ($classExists && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) { - return new Template( + return new ThemingDefaults( $this->getConfig(), $this->getL10N('theming'), $this->getURLGenerator(),