diff options
Diffstat (limited to 'lib/public/Defaults.php')
-rw-r--r-- | lib/public/Defaults.php | 120 |
1 files changed, 69 insertions, 51 deletions
diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php index 990644a6cb2..6de22caa41e 100644 --- a/lib/public/Defaults.php +++ b/lib/public/Defaults.php @@ -1,38 +1,13 @@ <?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Björn Schießle <bjoern@schiessle.org> - * @author Joas Schilling <coding@schilljs.com> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author scolebrook <scolebrook@mac.com> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ +declare(strict_types=1); /** - * Public interface of ownCloud for apps to use. - * Defaults Class - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ - // use OCP namespace for all classes that are considered public. -// This means that they should be used by apps instead of the internal ownCloud classes +// This means that they should be used by apps instead of the internal Nextcloud classes namespace OCP; @@ -41,7 +16,6 @@ namespace OCP; * @since 6.0.0 */ class Defaults { - /** * \OC_Defaults instance to retrieve the defaults * @since 6.0.0 @@ -53,9 +27,9 @@ class Defaults { * actual defaults * @since 6.0.0 */ - public function __construct(\OC_Defaults $defaults = null) { + public function __construct(?\OC_Defaults $defaults = null) { if ($defaults === null) { - $defaults = \OC::$server->getThemingDefaults(); + $defaults = \OCP\Server::get('ThemingDefaults'); } $this->defaults = $defaults; } @@ -65,7 +39,7 @@ class Defaults { * @return string * @since 6.0.0 */ - public function getBaseUrl() { + public function getBaseUrl(): string { return $this->defaults->getBaseUrl(); } @@ -74,7 +48,7 @@ class Defaults { * @return string * @since 6.0.0 */ - public function getSyncClientUrl() { + public function getSyncClientUrl(): string { return $this->defaults->getSyncClientUrl(); } @@ -83,7 +57,7 @@ class Defaults { * @return string * @since 8.0.0 */ - public function getiOSClientUrl() { + public function getiOSClientUrl(): string { return $this->defaults->getiOSClientUrl(); } @@ -92,34 +66,54 @@ class Defaults { * @return string * @since 8.0.0 */ - public function getAndroidClientUrl() { + public function getAndroidClientUrl(): string { return $this->defaults->getAndroidClientUrl(); } /** + * link to the Android client on F-Droid + * @return string + * @since 23.0.0 + */ + public function getFDroidClientUrl() { + return $this->defaults->getFDroidClientUrl(); + } + + /** * base URL to the documentation of your ownCloud instance * @return string * @since 6.0.0 */ - public function getDocBaseUrl() { + public function getDocBaseUrl(): string { return $this->defaults->getDocBaseUrl(); } /** - * name of your ownCloud instance + * name of your Nextcloud instance (e.g. MyPrivateCloud) * @return string * @since 6.0.0 */ - public function getName() { + public function getName(): string { 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 * @since 8.0.0 + * @deprecated 22.0.0 */ - public function getHTMLName() { + public function getHTMLName(): string { return $this->defaults->getHTMLName(); } @@ -128,7 +122,7 @@ class Defaults { * @return string * @since 6.0.0 */ - public function getEntity() { + public function getEntity(): string { return $this->defaults->getEntity(); } @@ -137,7 +131,7 @@ class Defaults { * @return string * @since 6.0.0 */ - public function getSlogan(?string $lang = null) { + public function getSlogan(?string $lang = null): string { return $this->defaults->getSlogan($lang); } @@ -146,7 +140,7 @@ class Defaults { * @return string * @since 6.0.0 */ - public function getShortFooter() { + public function getShortFooter(): string { return $this->defaults->getShortFooter(); } @@ -155,7 +149,7 @@ class Defaults { * @return string * @since 6.0.0 */ - public function getLongFooter() { + public function getLongFooter(): string { return $this->defaults->getLongFooter(); } @@ -164,7 +158,7 @@ class Defaults { * @return string AppId * @since 8.0.0 */ - public function getiTunesAppId() { + public function getiTunesAppId(): string { return $this->defaults->getiTunesAppId(); } @@ -175,7 +169,7 @@ class Defaults { * @return string * @since 12.0.0 */ - public function getLogo($useSvg = true) { + public function getLogo(bool $useSvg = true): string { return $this->defaults->getLogo($useSvg); } @@ -184,7 +178,19 @@ class Defaults { * @return string * @since 12.0.0 */ - public function getColorPrimary() { + public function getColorPrimary(): string { + return $this->defaults->getColorPrimary(); + } + + /** + * Return the default color primary + * @return string + * @since 25.0.4 + */ + public function getDefaultColorPrimary(): string { + if (method_exists($this->defaults, 'getDefaultColorPrimary')) { + return $this->defaults->getDefaultColorPrimary(); + } return $this->defaults->getColorPrimary(); } @@ -193,7 +199,7 @@ class Defaults { * @return string URL to doc with key * @since 12.0.0 */ - public function buildDocLinkToKey($key) { + public function buildDocLinkToKey(string $key): string { return $this->defaults->buildDocLinkToKey($key); } @@ -202,7 +208,7 @@ class Defaults { * @return string title * @since 12.0.0 */ - public function getTitle() { + public function getTitle(): string { return $this->defaults->getTitle(); } @@ -211,7 +217,19 @@ class Defaults { * @return string * @since 13.0.0 */ - public function getTextColorPrimary() { + public function getTextColorPrimary(): string { + return $this->defaults->getTextColorPrimary(); + } + + /** + * Returns primary color + * @return string + * @since 25.0.4 + */ + public function getDefaultTextColorPrimary(): string { + if (method_exists($this->defaults, 'getDefaultTextColorPrimary')) { + return $this->defaults->getDefaultTextColorPrimary(); + } return $this->defaults->getTextColorPrimary(); } } |