Skip to content

Commit

Permalink
Merge pull request #27529 from nextcloud/fix/25950/default-product-name
Browse files Browse the repository at this point in the history
Fix default product name for old themes
  • Loading branch information
MorrisJobke authored Jun 16, 2021
2 parents 39f0aa5 + f6108ac commit ff8cfbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function __construct(IConfig $config,
$this->name = parent::getName();
$this->title = parent::getTitle();
$this->entity = parent::getEntity();
$this->productName = parent::getName();
$this->productName = parent::getProductName();
$this->url = parent::getBaseUrl();
$this->color = parent::getColorPrimary();
$this->iTunesAppId = parent::getiTunesAppId();
Expand Down
9 changes: 9 additions & 0 deletions lib/private/legacy/OC_Defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class OC_Defaults {
private $defaultSlogan;
private $defaultColorPrimary;
private $defaultTextColorPrimary;
private $defaultProductName;

public function __construct() {
$config = \OC::$server->getConfig();
Expand All @@ -69,6 +70,7 @@ public function __construct() {
$this->defaultDocVersion = \OC_Util::getVersion()[0]; // used to generate doc links
$this->defaultColorPrimary = '#0082c9';
$this->defaultTextColorPrimary = '#ffffff';
$this->defaultProductName = 'Nextcloud';

$themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
if (file_exists($themePath)) {
Expand Down Expand Up @@ -331,4 +333,11 @@ public function getTextColorPrimary() {
}
return $this->defaultTextColorPrimary;
}

public function getProductName() {
if ($this->themeExist('getProductName')) {
return $this->theme->getProductName();
}
return $this->defaultProductName;
}
}

0 comments on commit ff8cfbb

Please sign in to comment.