Browse Source
rename "Tenmplate" to "ThemingDefaults" to make the auto loader happy"
pull/796/head
Bjoern Schiessle
10 years ago
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
4 changed files with
16 additions and
20 deletions
-
apps/theming/lib/Settings/Admin.php
-
apps/theming/lib/ThemingDefaults.php
-
apps/theming/tests/ThemingDefaultsTest.php
-
lib/private/Server.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; |
|
|
|
|
|
|
|
@ -1,11 +1,6 @@ |
|
|
|
<?php |
|
|
|
/** |
|
|
|
* @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org> |
|
|
|
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch> |
|
|
|
* |
|
|
|
* @author Bjoern Schiessle <bjoern@schiessle.org> |
|
|
|
* @author Joas Schilling <coding@schilljs.com> |
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch> |
|
|
|
* |
|
|
|
* @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; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -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, |
|
|
|
@ -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(), |
|
|
|
|