From 4673b54a2cfcdf7976fcd295b98d72858619ffad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 5 Mar 2021 10:03:26 +0100 Subject: [PATCH] Add dedicated product name to OCP\Defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/lib/ThemingDefaults.php | 7 +++++++ lib/public/Defaults.php | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 6e9298bdbcc..9d0ea78d8ea 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -75,6 +75,8 @@ class ThemingDefaults extends \OC_Defaults { /** @var string */ private $entity; /** @var string */ + private $productName; + /** @var string */ private $url; /** @var string */ private $color; @@ -119,6 +121,7 @@ class ThemingDefaults extends \OC_Defaults { $this->name = parent::getName(); $this->title = parent::getTitle(); $this->entity = parent::getEntity(); + $this->productName = parent::getName(); $this->url = parent::getBaseUrl(); $this->color = parent::getColorPrimary(); $this->iTunesAppId = parent::getiTunesAppId(); @@ -142,6 +145,10 @@ class ThemingDefaults extends \OC_Defaults { return strip_tags($this->config->getAppValue('theming', 'name', $this->entity)); } + public function getProductName() { + return strip_tags($this->config->getAppValue('theming', 'productName', $this->productName)); + } + public function getBaseUrl() { return $this->config->getAppValue('theming', 'url', $this->url); } diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php index 5c15e73b405..7d74134cf48 100644 --- a/lib/public/Defaults.php +++ b/lib/public/Defaults.php @@ -104,7 +104,7 @@ class Defaults { } /** - * name of your ownCloud instance + * name of your Nextcloud instance (e.g. MyPrivateCloud) * @return string * @since 6.0.0 */ @@ -112,6 +112,16 @@ class Defaults { return $this->defaults->getName(); } + /** + * Name of the software product (defaults to Nextcloud) + * + * @return string + * @since 22.0.0 + */ + public function getProductName(): string { + return $this->defaults->getProductName(); + } + /** * name of your ownCloud instance containing HTML styles * @return string