mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
refactor(theming): migrate ThemingDefaults to OCP\AppFramework\Services\IAppConfig
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> [skip ci]
This commit is contained in:
parent
c75da67023
commit
289d1188b6
3 changed files with 220 additions and 208 deletions
|
|
@ -9,9 +9,9 @@ use OCA\Theming\AppInfo\Application;
|
|||
use OCA\Theming\Service\BackgroundService;
|
||||
use OCP\App\AppPathNotFoundException;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\AppFramework\Services\IAppConfig;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\Files\SimpleFS\ISimpleFile;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -68,27 +68,27 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
}
|
||||
|
||||
public function getName() {
|
||||
return strip_tags($this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_NAME, $this->name));
|
||||
return strip_tags($this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_NAME, $this->name));
|
||||
}
|
||||
|
||||
public function getHTMLName() {
|
||||
return $this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_NAME, $this->name);
|
||||
return $this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_NAME, $this->name);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return strip_tags($this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_NAME, $this->title));
|
||||
return strip_tags($this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_NAME, $this->title));
|
||||
}
|
||||
|
||||
public function getEntity() {
|
||||
return strip_tags($this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_NAME, $this->entity));
|
||||
return strip_tags($this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_NAME, $this->entity));
|
||||
}
|
||||
|
||||
public function getProductName() {
|
||||
return strip_tags($this->appConfig->getValueString('theming', ConfigLexicon::PRODUCT_NAME, $this->productName));
|
||||
return strip_tags($this->appConfig->getAppValueString(ConfigLexicon::PRODUCT_NAME, $this->productName));
|
||||
}
|
||||
|
||||
public function getBaseUrl() {
|
||||
return $this->appConfig->getValueString('theming', ConfigLexicon::BASE_URL, $this->url);
|
||||
return $this->appConfig->getAppValueString(ConfigLexicon::BASE_URL, $this->url);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -97,19 +97,19 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* @psalm-suppress InvalidReturnType
|
||||
*/
|
||||
public function getSlogan(?string $lang = null): string {
|
||||
return \OCP\Util::sanitizeHTML($this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_SLOGAN, parent::getSlogan($lang)));
|
||||
return \OCP\Util::sanitizeHTML($this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_SLOGAN, parent::getSlogan($lang)));
|
||||
}
|
||||
|
||||
public function getImprintUrl(): string {
|
||||
return $this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_IMPRINT_URL, '');
|
||||
return $this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_IMPRINT_URL, '');
|
||||
}
|
||||
|
||||
public function getPrivacyUrl(): string {
|
||||
return $this->appConfig->getValueString('theming', ConfigLexicon::INSTANCE_PRIVACY_URL, '');
|
||||
return $this->appConfig->getAppValueString(ConfigLexicon::INSTANCE_PRIVACY_URL, '');
|
||||
}
|
||||
|
||||
public function getDocBaseUrl(): string {
|
||||
return $this->appConfig->getValueString('theming', ConfigLexicon::DOC_BASE_URL, $this->docBaseUrl);
|
||||
return $this->appConfig->getAppValueString(ConfigLexicon::DOC_BASE_URL, $this->docBaseUrl);
|
||||
}
|
||||
|
||||
public function getShortFooter() {
|
||||
|
|
@ -223,7 +223,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
*/
|
||||
public function getDefaultColorPrimary(): string {
|
||||
// try admin color
|
||||
$defaultColor = $this->appConfig->getValueString(Application::APP_ID, 'primary_color', '');
|
||||
$defaultColor = $this->appConfig->getAppValueString('primary_color', '');
|
||||
if (preg_match('/^\#([0-9a-f]{3}|[0-9a-f]{6})$/i', $defaultColor)) {
|
||||
return $defaultColor;
|
||||
}
|
||||
|
|
@ -236,7 +236,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* Default background color only taking admin setting into account
|
||||
*/
|
||||
public function getDefaultColorBackground(): string {
|
||||
$defaultColor = $this->appConfig->getValueString(Application::APP_ID, 'background_color');
|
||||
$defaultColor = $this->appConfig->getAppValueString('background_color');
|
||||
if (preg_match('/^\#([0-9a-f]{3}|[0-9a-f]{6})$/i', $defaultColor)) {
|
||||
return $defaultColor;
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* @return string
|
||||
*/
|
||||
public function getLogo($useSvg = true): string {
|
||||
$logo = $this->appConfig->getValueString('theming', 'logoMime', '');
|
||||
$logo = $this->appConfig->getAppValueString('logoMime', '');
|
||||
|
||||
// short cut to avoid setting up the filesystem just to check if the logo is there
|
||||
//
|
||||
|
|
@ -269,7 +269,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
}
|
||||
}
|
||||
|
||||
$cacheBusterCounter = (string)$this->appConfig->getValueInt('theming', ConfigLexicon::CACHE_BUSTER);
|
||||
$cacheBusterCounter = (string)$this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER);
|
||||
if (!$logo || !$logoExists) {
|
||||
if ($useSvg) {
|
||||
$logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg');
|
||||
|
|
@ -296,28 +296,28 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* @return string
|
||||
*/
|
||||
public function getiTunesAppId() {
|
||||
return $this->appConfig->getValueString('theming', 'iTunesAppId', $this->iTunesAppId);
|
||||
return $this->appConfig->getAppValueString('iTunesAppId', $this->iTunesAppId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getiOSClientUrl() {
|
||||
return $this->appConfig->getValueString('theming', 'iOSClientUrl', $this->iOSClientUrl);
|
||||
return $this->appConfig->getAppValueString('iOSClientUrl', $this->iOSClientUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAndroidClientUrl() {
|
||||
return $this->appConfig->getValueString('theming', 'AndroidClientUrl', $this->AndroidClientUrl);
|
||||
return $this->appConfig->getAppValueString('AndroidClientUrl', $this->AndroidClientUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getFDroidClientUrl() {
|
||||
return $this->appConfig->getValueString('theming', 'FDroidClientUrl', $this->FDroidClientUrl);
|
||||
return $this->appConfig->getAppValueString('FDroidClientUrl', $this->FDroidClientUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -325,7 +325,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* @deprecated since Nextcloud 22 - https://github.com/nextcloud/server/issues/9940
|
||||
*/
|
||||
public function getScssVariables() {
|
||||
$cacheBuster = $this->appConfig->getValueInt('theming', ConfigLexicon::CACHE_BUSTER);
|
||||
$cacheBuster = $this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER);
|
||||
$cache = $this->cacheFactory->createDistributed('theming-' . (string)$cacheBuster . '-' . $this->urlGenerator->getBaseUrl());
|
||||
if ($value = $cache->get('getScssVariables')) {
|
||||
return $value;
|
||||
|
|
@ -333,10 +333,10 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
|
||||
$variables = [
|
||||
'theming-cachebuster' => "'" . $cacheBuster . "'",
|
||||
'theming-logo-mime' => "'" . $this->appConfig->getValueString('theming', 'logoMime') . "'",
|
||||
'theming-background-mime' => "'" . $this->appConfig->getValueString('theming', 'backgroundMime') . "'",
|
||||
'theming-logoheader-mime' => "'" . $this->appConfig->getValueString('theming', 'logoheaderMime') . "'",
|
||||
'theming-favicon-mime' => "'" . $this->appConfig->getValueString('theming', 'faviconMime') . "'"
|
||||
'theming-logo-mime' => "'" . $this->appConfig->getAppValueString('logoMime') . "'",
|
||||
'theming-background-mime' => "'" . $this->appConfig->getAppValueString('backgroundMime') . "'",
|
||||
'theming-logoheader-mime' => "'" . $this->appConfig->getAppValueString('logoheaderMime') . "'",
|
||||
'theming-favicon-mime' => "'" . $this->appConfig->getAppValueString('faviconMime') . "'"
|
||||
];
|
||||
|
||||
$variables['image-logo'] = "url('" . $this->imageManager->getImageUrl('logo') . "')";
|
||||
|
|
@ -345,13 +345,13 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
$variables['image-login-background'] = "url('" . $this->imageManager->getImageUrl('background') . "')";
|
||||
$variables['image-login-plain'] = 'false';
|
||||
|
||||
if ($this->appConfig->getValueString(Application::APP_ID, 'primary_color', '') !== '') {
|
||||
if ($this->appConfig->getAppValueString('primary_color', '') !== '') {
|
||||
$variables['color-primary'] = $this->getColorPrimary();
|
||||
$variables['color-primary-text'] = $this->getTextColorPrimary();
|
||||
$variables['color-primary-element'] = $this->util->elementColor($this->getColorPrimary());
|
||||
}
|
||||
|
||||
if ($this->appConfig->getValueString('theming', 'backgroundMime', '') === 'backgroundColor') {
|
||||
if ($this->appConfig->getAppValueString('backgroundMime', '') === 'backgroundColor') {
|
||||
$variables['image-login-plain'] = 'true';
|
||||
}
|
||||
|
||||
|
|
@ -417,8 +417,8 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* Increases the cache buster key
|
||||
*/
|
||||
public function increaseCacheBuster(): void {
|
||||
$cacheBusterKey = $this->appConfig->getValueInt('theming', ConfigLexicon::CACHE_BUSTER);
|
||||
$this->appConfig->setValueInt('theming', ConfigLexicon::CACHE_BUSTER, $cacheBusterKey + 1);
|
||||
$cacheBusterKey = $this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER);
|
||||
$this->appConfig->setAppValueInt(ConfigLexicon::CACHE_BUSTER, $cacheBusterKey + 1);
|
||||
$this->cacheFactory->createDistributed('theming-')->clear();
|
||||
$this->cacheFactory->createDistributed('imagePath')->clear();
|
||||
}
|
||||
|
|
@ -432,14 +432,14 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
public function set($setting, $value): void {
|
||||
switch ($value) {
|
||||
case ConfigLexicon::CACHE_BUSTER:
|
||||
$this->appConfig->setValueInt('theming', ConfigLexicon::CACHE_BUSTER, (int)$value);
|
||||
$this->appConfig->setAppValueInt(ConfigLexicon::CACHE_BUSTER, (int)$value);
|
||||
break;
|
||||
case ConfigLexicon::USER_THEMING_DISABLED:
|
||||
$value = $value === 'true' || $value === 'yes' || $value === '1';
|
||||
$this->appConfig->setValueBool('theming', ConfigLexicon::USER_THEMING_DISABLED, $value);
|
||||
$this->appConfig->setAppValueBool(ConfigLexicon::USER_THEMING_DISABLED, $value);
|
||||
break;
|
||||
default:
|
||||
$this->appConfig->setValueString('theming', $setting, $value);
|
||||
$this->appConfig->setAppValueString($setting, $value);
|
||||
break;
|
||||
}
|
||||
$this->increaseCacheBuster();
|
||||
|
|
@ -451,9 +451,9 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
public function undoAll(): void {
|
||||
// Remember the current cachebuster value, as we do not want to reset this value
|
||||
// Otherwise this can lead to caching issues as the value might be known to a browser already
|
||||
$cacheBusterKey = $this->appConfig->getValueInt('theming', ConfigLexicon::CACHE_BUSTER);
|
||||
$this->appConfig->deleteApp('theming');
|
||||
$this->appConfig->setValueInt('theming', ConfigLexicon::CACHE_BUSTER, $cacheBusterKey);
|
||||
$cacheBusterKey = $this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER);
|
||||
$this->appConfig->deleteAppValues();
|
||||
$this->appConfig->setAppValueInt(ConfigLexicon::CACHE_BUSTER, $cacheBusterKey);
|
||||
$this->increaseCacheBuster();
|
||||
}
|
||||
|
||||
|
|
@ -464,7 +464,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* @return string default value
|
||||
*/
|
||||
public function undo($setting): string {
|
||||
$this->appConfig->deleteKey('theming', $setting);
|
||||
$this->appConfig->deleteAppValue($setting);
|
||||
$this->increaseCacheBuster();
|
||||
|
||||
$returnValue = '';
|
||||
|
|
@ -493,7 +493,7 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
case 'background':
|
||||
case 'favicon':
|
||||
$this->imageManager->delete($setting);
|
||||
$this->appConfig->deleteKey('theming', $setting . 'Mime');
|
||||
$this->appConfig->deleteAppValue($setting . 'Mime');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -531,6 +531,6 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
* Has the admin disabled user customization
|
||||
*/
|
||||
public function isUserThemingDisabled(): bool {
|
||||
return $this->appConfig->getValueBool(Application::APP_ID, ConfigLexicon::USER_THEMING_DISABLED, false);
|
||||
return $this->appConfig->getAppValueBool(ConfigLexicon::USER_THEMING_DISABLED, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ use OCA\Theming\Service\BackgroundService;
|
|||
use OCA\Theming\ThemingDefaults;
|
||||
use OCA\Theming\Util;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\AppFramework\Services\IAppConfig;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\ICache;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IConfig;
|
||||
|
|
@ -88,8 +88,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetNameWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('Nextcloud');
|
||||
|
||||
$this->assertEquals('Nextcloud', $this->template->getName());
|
||||
|
|
@ -98,8 +98,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetNameWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('MyCustomCloud');
|
||||
|
||||
$this->assertEquals('MyCustomCloud', $this->template->getName());
|
||||
|
|
@ -108,8 +108,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetHTMLNameWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('Nextcloud');
|
||||
|
||||
$this->assertEquals('Nextcloud', $this->template->getHTMLName());
|
||||
|
|
@ -118,8 +118,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetHTMLNameWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('MyCustomCloud');
|
||||
|
||||
$this->assertEquals('MyCustomCloud', $this->template->getHTMLName());
|
||||
|
|
@ -128,8 +128,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetTitleWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('Nextcloud');
|
||||
|
||||
$this->assertEquals('Nextcloud', $this->template->getTitle());
|
||||
|
|
@ -138,8 +138,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetTitleWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('MyCustomCloud');
|
||||
|
||||
$this->assertEquals('MyCustomCloud', $this->template->getTitle());
|
||||
|
|
@ -149,8 +149,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetEntityWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('Nextcloud');
|
||||
|
||||
$this->assertEquals('Nextcloud', $this->template->getEntity());
|
||||
|
|
@ -159,8 +159,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetEntityWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('MyCustomCloud');
|
||||
|
||||
$this->assertEquals('MyCustomCloud', $this->template->getEntity());
|
||||
|
|
@ -169,8 +169,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetBaseUrlWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'url', $this->defaults->getBaseUrl())
|
||||
->method('getAppValueString')
|
||||
->with('url', $this->defaults->getBaseUrl())
|
||||
->willReturn($this->defaults->getBaseUrl());
|
||||
|
||||
$this->assertEquals($this->defaults->getBaseUrl(), $this->template->getBaseUrl());
|
||||
|
|
@ -179,8 +179,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetBaseUrlWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'url', $this->defaults->getBaseUrl())
|
||||
->method('getAppValueString')
|
||||
->with('url', $this->defaults->getBaseUrl())
|
||||
->willReturn('https://example.com/');
|
||||
|
||||
$this->assertEquals('https://example.com/', $this->template->getBaseUrl());
|
||||
|
|
@ -200,8 +200,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetImprintURL($imprintUrl): void {
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'imprintUrl', '')
|
||||
->method('getAppValueString')
|
||||
->with('imprintUrl', '')
|
||||
->willReturn($imprintUrl);
|
||||
|
||||
$this->assertEquals($imprintUrl, $this->template->getImprintUrl());
|
||||
|
|
@ -214,8 +214,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetPrivacyURL($privacyUrl): void {
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'privacyUrl', '')
|
||||
->method('getAppValueString')
|
||||
->with('privacyUrl', '')
|
||||
->willReturn($privacyUrl);
|
||||
|
||||
$this->assertEquals($privacyUrl, $this->template->getPrivacyUrl());
|
||||
|
|
@ -224,8 +224,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetSloganWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'slogan', $this->defaults->getSlogan())
|
||||
->method('getAppValueString')
|
||||
->with('slogan', $this->defaults->getSlogan())
|
||||
->willReturn($this->defaults->getSlogan());
|
||||
|
||||
$this->assertEquals($this->defaults->getSlogan(), $this->template->getSlogan());
|
||||
|
|
@ -234,8 +234,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetSloganWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'slogan', $this->defaults->getSlogan())
|
||||
->method('getAppValueString')
|
||||
->with('slogan', $this->defaults->getSlogan())
|
||||
->willReturn('My custom Slogan');
|
||||
|
||||
$this->assertEquals('My custom Slogan', $this->template->getSlogan());
|
||||
|
|
@ -244,13 +244,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetShortFooter(): void {
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', ''],
|
||||
['theming', 'privacyUrl', '', ''],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', ''],
|
||||
['privacyUrl', '', ''],
|
||||
]);
|
||||
|
||||
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan', $this->template->getShortFooter());
|
||||
|
|
@ -260,13 +260,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), ''],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', ''],
|
||||
['theming', 'privacyUrl', '', ''],
|
||||
['url', $this->defaults->getBaseUrl(), ''],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', ''],
|
||||
['privacyUrl', '', ''],
|
||||
]);
|
||||
|
||||
$this->assertEquals('<span class="entity-name">Name</span> – Slogan', $this->template->getShortFooter());
|
||||
|
|
@ -276,13 +276,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), ''],
|
||||
['theming', 'imprintUrl', '', ''],
|
||||
['theming', 'privacyUrl', '', ''],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), ''],
|
||||
['imprintUrl', '', ''],
|
||||
['privacyUrl', '', ''],
|
||||
]);
|
||||
|
||||
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a>', $this->template->getShortFooter());
|
||||
|
|
@ -292,13 +292,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', 'https://example.com/imprint'],
|
||||
['theming', 'privacyUrl', '', ''],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', 'https://example.com/imprint'],
|
||||
['privacyUrl', '', ''],
|
||||
]);
|
||||
|
||||
$this->l10n
|
||||
|
|
@ -313,13 +313,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', ''],
|
||||
['theming', 'privacyUrl', '', 'https://example.com/privacy'],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', ''],
|
||||
['privacyUrl', '', 'https://example.com/privacy'],
|
||||
]);
|
||||
|
||||
$this->l10n
|
||||
|
|
@ -334,13 +334,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', 'https://example.com/imprint'],
|
||||
['theming', 'privacyUrl', '', 'https://example.com/privacy'],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', 'https://example.com/imprint'],
|
||||
['privacyUrl', '', 'https://example.com/privacy'],
|
||||
]);
|
||||
|
||||
$this->l10n
|
||||
|
|
@ -366,13 +366,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', $invalidImprintUrl],
|
||||
['theming', 'privacyUrl', '', ''],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', $invalidImprintUrl],
|
||||
['privacyUrl', '', ''],
|
||||
]);
|
||||
|
||||
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan', $this->template->getShortFooter());
|
||||
|
|
@ -386,13 +386,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
$this->navigationManager->expects($this->once())->method('getAll')->with(INavigationManager::TYPE_GUEST)->willReturn([]);
|
||||
$this->appConfig
|
||||
->expects($this->exactly(5))
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['theming', 'name', 'Nextcloud', 'Name'],
|
||||
['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['theming', 'imprintUrl', '', ''],
|
||||
['theming', 'privacyUrl', '', $invalidPrivacyUrl],
|
||||
['url', $this->defaults->getBaseUrl(), 'url'],
|
||||
['name', 'Nextcloud', 'Name'],
|
||||
['slogan', $this->defaults->getSlogan(), 'Slogan'],
|
||||
['imprintUrl', '', ''],
|
||||
['privacyUrl', '', $invalidPrivacyUrl],
|
||||
]);
|
||||
|
||||
$this->assertEquals('<a href="url" target="_blank" rel="noreferrer noopener" class="entity-name">Name</a> – Slogan', $this->template->getShortFooter());
|
||||
|
|
@ -401,13 +401,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetColorPrimaryWithDefault(): void {
|
||||
$this->appConfig
|
||||
->expects(self::once())
|
||||
->method('getValueBool')
|
||||
->with('theming', 'disable-user-theming')
|
||||
->method('getAppValueBool')
|
||||
->with('disable-user-theming')
|
||||
->willReturn(false);
|
||||
$this->appConfig
|
||||
->expects(self::once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'primary_color', '')
|
||||
->method('getAppValueString')
|
||||
->with('primary_color', '')
|
||||
->willReturn($this->defaults->getColorPrimary());
|
||||
|
||||
$this->assertEquals($this->defaults->getColorPrimary(), $this->template->getColorPrimary());
|
||||
|
|
@ -416,13 +416,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetColorPrimaryWithCustom(): void {
|
||||
$this->appConfig
|
||||
->expects(self::once())
|
||||
->method('getValueBool')
|
||||
->with('theming', 'disable-user-theming')
|
||||
->method('getAppValueBool')
|
||||
->with('disable-user-theming')
|
||||
->willReturn(false);
|
||||
$this->appConfig
|
||||
->expects(self::once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'primary_color', '')
|
||||
->method('getAppValueString')
|
||||
->with('primary_color', '')
|
||||
->willReturn('#fff');
|
||||
|
||||
$this->assertEquals('#fff', $this->template->getColorPrimary());
|
||||
|
|
@ -482,13 +482,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
->willReturn('user');
|
||||
$this->appConfig
|
||||
->expects(self::any())
|
||||
->method('getValueBool')
|
||||
->with('theming', 'disable-user-theming')
|
||||
->method('getAppValueBool')
|
||||
->with('disable-user-theming')
|
||||
->willReturn($disableTheming);
|
||||
$this->appConfig
|
||||
->expects(self::any())
|
||||
->method('getValueString')
|
||||
->with('theming', 'primary_color', '')
|
||||
->method('getAppValueString')
|
||||
->with('primary_color', '')
|
||||
->willReturn($primaryColor);
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
|
|
@ -502,16 +502,16 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testSet(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueInt')
|
||||
->with('theming', 'cachebuster', 16);
|
||||
->method('setAppValueInt')
|
||||
->with('cachebuster', 16);
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueString')
|
||||
->with('theming', 'MySetting', 'MyValue');
|
||||
->method('setAppValueString')
|
||||
->with('MySetting', 'MyValue');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(15);
|
||||
$this->cacheFactory
|
||||
->expects($this->exactly(2))
|
||||
|
|
@ -530,22 +530,22 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testUndoName(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('deleteKey')
|
||||
->with('theming', 'name');
|
||||
->method('deleteAppValue')
|
||||
->with('name');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(15);
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'name', 'Nextcloud')
|
||||
->method('getAppValueString')
|
||||
->with('name', 'Nextcloud')
|
||||
->willReturn('Nextcloud');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueInt')
|
||||
->with('theming', 'cachebuster', 16);
|
||||
->method('setAppValueInt')
|
||||
->with('cachebuster', 16);
|
||||
|
||||
$this->assertSame('Nextcloud', $this->template->undo('name'));
|
||||
}
|
||||
|
|
@ -553,22 +553,22 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testUndoBaseUrl(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('deleteKey')
|
||||
->with('theming', 'url');
|
||||
->method('deleteAppValue')
|
||||
->with('url');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(15);
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'url', $this->defaults->getBaseUrl())
|
||||
->method('getAppValueString')
|
||||
->with('url', $this->defaults->getBaseUrl())
|
||||
->willReturn($this->defaults->getBaseUrl());
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueInt')
|
||||
->with('theming', 'cachebuster', 16);
|
||||
->method('setAppValueInt')
|
||||
->with('cachebuster', 16);
|
||||
|
||||
$this->assertSame($this->defaults->getBaseUrl(), $this->template->undo('url'));
|
||||
}
|
||||
|
|
@ -576,22 +576,22 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testUndoSlogan(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('deleteKey')
|
||||
->with('theming', 'slogan');
|
||||
->method('deleteAppValue')
|
||||
->with('slogan');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(15);
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'slogan', $this->defaults->getSlogan())
|
||||
->method('getAppValueString')
|
||||
->with('slogan', $this->defaults->getSlogan())
|
||||
->willReturn($this->defaults->getSlogan());
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueInt')
|
||||
->with('theming', 'cachebuster', 16);
|
||||
->method('setAppValueInt')
|
||||
->with('cachebuster', 16);
|
||||
|
||||
$this->assertSame($this->defaults->getSlogan(), $this->template->undo('slogan'));
|
||||
}
|
||||
|
|
@ -599,17 +599,17 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testUndoPrimaryColor(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('deleteKey')
|
||||
->with('theming', 'primary_color');
|
||||
->method('deleteAppValue')
|
||||
->with('primary_color');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(15);
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueInt')
|
||||
->with('theming', 'cachebuster', 16);
|
||||
->method('setAppValueInt')
|
||||
->with('cachebuster', 16);
|
||||
|
||||
$this->assertSame($this->defaults->getColorPrimary(), $this->template->undo('primary_color'));
|
||||
}
|
||||
|
|
@ -617,17 +617,17 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testUndoDefaultAction(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('deleteKey')
|
||||
->with('theming', 'defaultitem');
|
||||
->method('deleteAppValue')
|
||||
->with('defaultitem');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster', '0')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster', '0')
|
||||
->willReturn(15);
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('setValueInt')
|
||||
->with('theming', 'cachebuster', 16);
|
||||
->method('setAppValueInt')
|
||||
->with('cachebuster', 16);
|
||||
|
||||
$this->assertSame('', $this->template->undo('defaultitem'));
|
||||
}
|
||||
|
|
@ -648,13 +648,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
->willThrowException(new NotFoundException());
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'logoMime', '')
|
||||
->method('getAppValueString')
|
||||
->with('logoMime', '')
|
||||
->willReturn('');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(0);
|
||||
$this->urlGenerator->expects($this->once())
|
||||
->method('imagePath')
|
||||
|
|
@ -674,13 +674,13 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetLogoCustom(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'logoMime', '')
|
||||
->method('getAppValueString')
|
||||
->with('logoMime', '')
|
||||
->willReturn('image/svg+xml');
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(0);
|
||||
$this->urlGenerator->expects($this->once())
|
||||
->method('linkToRoute')
|
||||
|
|
@ -691,8 +691,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
|
||||
public function testGetScssVariablesCached(): void {
|
||||
$this->appConfig->expects($this->any())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(1);
|
||||
$this->cacheFactory->expects($this->once())
|
||||
->method('createDistributed')
|
||||
|
|
@ -704,21 +704,21 @@ class ThemingDefaultsTest extends TestCase {
|
|||
|
||||
public function testGetScssVariables(): void {
|
||||
$this->appConfig->expects($this->any())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(0);
|
||||
$this->appConfig
|
||||
->expects($this->any())
|
||||
->method('getValueString')
|
||||
->method('getAppValueString')
|
||||
->willReturnMap([
|
||||
['theming', 'imprintUrl', '', ''],
|
||||
['theming', 'privacyUrl', '', ''],
|
||||
['theming', 'logoMime', '', 'jpeg'],
|
||||
['theming', 'backgroundMime', '', 'jpeg'],
|
||||
['theming', 'logoheaderMime', '', 'jpeg'],
|
||||
['theming', 'faviconMime', '', 'jpeg'],
|
||||
['theming', 'primary_color', '', false, $this->defaults->getColorPrimary()],
|
||||
['theming', 'primary_color', $this->defaults->getColorPrimary(), false, $this->defaults->getColorPrimary()],
|
||||
['imprintUrl', '', ''],
|
||||
['privacyUrl', '', ''],
|
||||
['logoMime', '', 'jpeg'],
|
||||
['backgroundMime', '', 'jpeg'],
|
||||
['logoheaderMime', '', 'jpeg'],
|
||||
['faviconMime', '', 'jpeg'],
|
||||
['primary_color', '', false, $this->defaults->getColorPrimary()],
|
||||
['primary_color', $this->defaults->getColorPrimary(), false, $this->defaults->getColorPrimary()],
|
||||
]);
|
||||
|
||||
$this->util->expects($this->any())->method('invertTextColor')->with($this->defaults->getColorPrimary())->willReturn(false);
|
||||
|
|
@ -759,8 +759,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetDefaultAndroidURL(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'AndroidClientUrl', 'https://play.google.com/store/apps/details?id=com.nextcloud.client')
|
||||
->method('getAppValueString')
|
||||
->with('AndroidClientUrl', 'https://play.google.com/store/apps/details?id=com.nextcloud.client')
|
||||
->willReturn('https://play.google.com/store/apps/details?id=com.nextcloud.client');
|
||||
|
||||
$this->assertEquals('https://play.google.com/store/apps/details?id=com.nextcloud.client', $this->template->getAndroidClientUrl());
|
||||
|
|
@ -769,8 +769,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetCustomAndroidURL(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'AndroidClientUrl', 'https://play.google.com/store/apps/details?id=com.nextcloud.client')
|
||||
->method('getAppValueString')
|
||||
->with('AndroidClientUrl', 'https://play.google.com/store/apps/details?id=com.nextcloud.client')
|
||||
->willReturn('https://play.google.com/store/apps/details?id=com.mycloud.client');
|
||||
|
||||
$this->assertEquals('https://play.google.com/store/apps/details?id=com.mycloud.client', $this->template->getAndroidClientUrl());
|
||||
|
|
@ -779,8 +779,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetDefaultiOSURL(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'iOSClientUrl', 'https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8')
|
||||
->method('getAppValueString')
|
||||
->with('iOSClientUrl', 'https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8')
|
||||
->willReturn('https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8');
|
||||
|
||||
$this->assertEquals('https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8', $this->template->getiOSClientUrl());
|
||||
|
|
@ -789,8 +789,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetCustomiOSURL(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'iOSClientUrl', 'https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8')
|
||||
->method('getAppValueString')
|
||||
->with('iOSClientUrl', 'https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8')
|
||||
->willReturn('https://geo.itunes.apple.com/us/app/nextcloud/id1234567890?mt=8');
|
||||
|
||||
$this->assertEquals('https://geo.itunes.apple.com/us/app/nextcloud/id1234567890?mt=8', $this->template->getiOSClientUrl());
|
||||
|
|
@ -799,8 +799,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetDefaultiTunesAppId(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'iTunesAppId', '1125420102')
|
||||
->method('getAppValueString')
|
||||
->with('iTunesAppId', '1125420102')
|
||||
->willReturn('1125420102');
|
||||
|
||||
$this->assertEquals('1125420102', $this->template->getiTunesAppId());
|
||||
|
|
@ -809,8 +809,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
public function testGetCustomiTunesAppId(): void {
|
||||
$this->appConfig
|
||||
->expects($this->once())
|
||||
->method('getValueString')
|
||||
->with('theming', 'iTunesAppId', '1125420102')
|
||||
->method('getAppValueString')
|
||||
->with('iTunesAppId', '1125420102')
|
||||
->willReturn('1234567890');
|
||||
|
||||
$this->assertEquals('1234567890', $this->template->getiTunesAppId());
|
||||
|
|
@ -833,8 +833,8 @@ class ThemingDefaultsTest extends TestCase {
|
|||
->willReturn(true);
|
||||
$this->appConfig
|
||||
->expects($this->any())
|
||||
->method('getValueInt')
|
||||
->with('theming', 'cachebuster')
|
||||
->method('getAppValueInt')
|
||||
->with('cachebuster')
|
||||
->willReturn(0);
|
||||
$this->urlGenerator
|
||||
->expects($this->any())
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use OC\App\AppStore\Fetcher\AppFetcher;
|
|||
use OC\AppFramework\Bootstrap\Coordinator;
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OC\AppFramework\Http\RequestId;
|
||||
use OC\AppFramework\Services\AppConfig;
|
||||
use OC\AppFramework\Utility\TimeFactory;
|
||||
use OC\Authentication\Events\LoginFailed;
|
||||
use OC\Authentication\Listeners\LoginFailedListener;
|
||||
|
|
@ -155,6 +156,7 @@ use OCP\EventDispatcher\IEventDispatcher;
|
|||
use OCP\Federation\ICloudFederationFactory;
|
||||
use OCP\Federation\ICloudFederationProviderManager;
|
||||
use OCP\Federation\ICloudIdManager;
|
||||
use OCP\Files\AppData\IAppDataFactory;
|
||||
use OCP\Files\Cache\IFileAccess;
|
||||
use OCP\Files\Config\IMountProviderCollection;
|
||||
use OCP\Files\Config\IUserMountCache;
|
||||
|
|
@ -1052,14 +1054,14 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValueBool('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->get(TrustedDomainHelper::class)->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
|
||||
$backgroundService = new BackgroundService(
|
||||
$c->get(IRootFolder::class),
|
||||
$c->getAppDataDir('theming'),
|
||||
$c->get(IAppDataFactory::class)->get('theming'),
|
||||
$c->get(IAppConfig::class),
|
||||
$c->get(\OCP\IConfig::class),
|
||||
$c->get(ISession::class)->get('user_id'),
|
||||
);
|
||||
$imageManager = new ImageManager(
|
||||
$c->get(\OCP\IConfig::class),
|
||||
$c->getAppDataDir('theming'),
|
||||
$c->get(IAppDataFactory::class)->get('theming'),
|
||||
$c->get(IURLGenerator::class),
|
||||
$c->get(ICacheFactory::class),
|
||||
$c->get(LoggerInterface::class),
|
||||
|
|
@ -1068,12 +1070,22 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
);
|
||||
return new ThemingDefaults(
|
||||
$c->get(\OCP\IConfig::class),
|
||||
$c->get(\OCP\IAppConfig::class),
|
||||
$c->getL10N('theming'),
|
||||
new AppConfig(
|
||||
$c->get(\OCP\IConfig::class),
|
||||
$c->get(\OCP\IAppConfig::class),
|
||||
'theming',
|
||||
),
|
||||
$c->get(IFactory::class)->get('theming'),
|
||||
$c->get(IUserSession::class),
|
||||
$c->get(IURLGenerator::class),
|
||||
$c->get(ICacheFactory::class),
|
||||
new Util($c->get(ServerVersion::class), $c->get(\OCP\IConfig::class), $this->get(IAppManager::class), $c->getAppDataDir('theming'), $imageManager),
|
||||
new Util(
|
||||
$c->get(ServerVersion::class),
|
||||
$c->get(\OCP\IConfig::class),
|
||||
$this->get(IAppManager::class),
|
||||
$c->get(IAppDataFactory::class)->get('theming'),
|
||||
$imageManager,
|
||||
),
|
||||
$imageManager,
|
||||
$c->get(IAppManager::class),
|
||||
$c->get(INavigationManager::class),
|
||||
|
|
|
|||
Loading…
Reference in a new issue