Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class ThemingDefaults extends \OC_Defaults {
/** @var string */
private $url;
/** @var string */
private $slogan;
/** @var string */
private $color;

/** @var string */
Expand Down Expand Up @@ -115,7 +113,6 @@ public function __construct(IConfig $config,
$this->title = parent::getTitle();
$this->entity = parent::getEntity();
$this->url = parent::getBaseUrl();
$this->slogan = parent::getSlogan();
$this->color = parent::getColorPrimary();
$this->iTunesAppId = parent::getiTunesAppId();
$this->iOSClientUrl = parent::getiOSClientUrl();
Expand Down Expand Up @@ -143,7 +140,7 @@ public function getBaseUrl() {
}

public function getSlogan() {
return \OCP\Util::sanitizeHTML($this->config->getAppValue('theming', 'slogan', $this->slogan));
return \OCP\Util::sanitizeHTML($this->config->getAppValue('theming', 'slogan', parent::getSlogan()));
}

public function getImprintUrl() {
Expand Down
3 changes: 1 addition & 2 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ public function __construct( $renderAs, $appId = '' ) {
// Send the language and the locale to our layouts
$lang = \OC::$server->getL10NFactory()->findLanguage();
$locale = \OC::$server->getL10NFactory()->findLocale($lang);
$localeLang = \OC::$server->getL10NFactory()->findLanguageFromLocale('lib', $locale);

$lang = str_replace('_', '-', $lang);
$this->assign('language', $lang);
Expand All @@ -164,7 +163,7 @@ public function __construct( $renderAs, $appId = '' ) {
if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
$jsConfigHelper = new JSConfigHelper(
\OC::$server->getL10N('lib', $localeLang ?: $lang),
\OC::$server->getL10N('lib'),
\OC::$server->query(Defaults::class),
\OC::$server->getAppManager(),
\OC::$server->getSession(),
Expand Down
6 changes: 4 additions & 2 deletions lib/private/legacy/defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class OC_Defaults {
private $defaultTextColorPrimary;

public function __construct() {
$l10n = \OC::$server->getL10N('lib');
$config = \OC::$server->getConfig();

$this->defaultEntity = 'Nextcloud'; /* e.g. company name, used for footers and copyright notices */
Expand All @@ -65,7 +64,6 @@ public function __construct() {
$this->defaultAndroidClientUrl = $config->getSystemValue('customclient_android', 'https://play.google.com/store/apps/details?id=com.nextcloud.client');
$this->defaultDocBaseUrl = 'https://docs.nextcloud.com';
$this->defaultDocVersion = \OC_Util::getVersion()[0]; // used to generate doc links
$this->defaultSlogan = $l10n->t('a safe home for all your data');
$this->defaultColorPrimary = '#0082c9';
$this->defaultTextColorPrimary = '#ffffff';

Expand Down Expand Up @@ -219,6 +217,10 @@ public function getSlogan() {
if ($this->themeExist('getSlogan')) {
return $this->theme->getSlogan();
} else {
if ($this->defaultSlogan === null) {
$l10n = \OC::$server->getL10N('lib');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can inject the IFactory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid to inject anything here in this legacy code. I vote to keep this as is for now so it backports clean and then spend time in cleaning up thise theming madness ;)

$this->defaultSlogan = $l10n->t('a safe home for all your data');
}
return $this->defaultSlogan;
}
}
Expand Down