Use theme methods "getTitle" and "getEntity" as fallback if name is not themed.

This fixes an issue with custom filesystem themes that can define title, name
and entity differently, but the theming app was only using the name as fallback
(see #5374).

Signed-off-by: Joachim Bauch <bauch@struktur.de>
This commit is contained in:
Joachim Bauch 2017-06-14 09:25:53 +02:00 committed by Morris Jobke
parent 5ce3c7003b
commit 91598cbfb5
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 8 additions and 2 deletions

View File

@ -50,6 +50,10 @@ class ThemingDefaults extends \OC_Defaults {
/** @var string */
private $name;
/** @var string */
private $title;
/** @var string */
private $entity;
/** @var string */
private $url;
/** @var string */
private $slogan;
@ -93,6 +97,8 @@ class ThemingDefaults extends \OC_Defaults {
$this->appManager = $appManager;
$this->name = parent::getName();
$this->title = parent::getTitle();
$this->entity = parent::getEntity();
$this->url = parent::getBaseUrl();
$this->slogan = parent::getSlogan();
$this->color = parent::getColorPrimary();
@ -110,11 +116,11 @@ class ThemingDefaults extends \OC_Defaults {
}
public function getTitle() {
return $this->getName();
return strip_tags($this->config->getAppValue('theming', 'name', $this->title));
}
public function getEntity() {
return $this->getName();
return strip_tags($this->config->getAppValue('theming', 'name', $this->entity));
}
public function getBaseUrl() {