diff options
Diffstat (limited to 'lib/private/legacy/OC_Defaults.php')
-rw-r--r-- | lib/private/legacy/OC_Defaults.php | 102 |
1 files changed, 52 insertions, 50 deletions
diff --git a/lib/private/legacy/OC_Defaults.php b/lib/private/legacy/OC_Defaults.php index a9f588eb6e9..0d460ff966d 100644 --- a/lib/private/legacy/OC_Defaults.php +++ b/lib/private/legacy/OC_Defaults.php @@ -1,41 +1,15 @@ <?php + /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Björn Schießle <bjoern@schiessle.org> - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Daniel Kesselberg <mail@danielkesselberg.de> - * @author Jan-Christoph Borchardt <hey@jancborchardt.net> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Julius Haertl <jus@bitgrid.net> - * @author Julius Härtl <jus@bitgrid.net> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Markus Staab <markus.staab@redaxo.de> - * @author Michael Weimann <mail@michael-weimann.eu> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Pascal de Bruijn <pmjdebruijn@pcode.nl> - * @author Robin Appelman <robin@icewind.nl> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author scolebrook <scolebrook@mac.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Volkan Gezer <volkangezer@gmail.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/> - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ + +use OCP\IConfig; +use OCP\Server; +use OCP\ServerVersion; + class OC_Defaults { private $theme; @@ -47,14 +21,18 @@ class OC_Defaults { private $defaultiOSClientUrl; private $defaultiTunesAppId; private $defaultAndroidClientUrl; + private $defaultFDroidClientUrl; private $defaultDocBaseUrl; private $defaultDocVersion; private $defaultSlogan; + private $defaultColorBackground; private $defaultColorPrimary; private $defaultTextColorPrimary; + private $defaultProductName; public function __construct() { - $config = \OC::$server->getConfig(); + $config = Server::get(IConfig::class); + $serverVersion = Server::get(ServerVersion::class); $this->defaultEntity = 'Nextcloud'; /* e.g. company name, used for footers and copyright notices */ $this->defaultName = 'Nextcloud'; /* short name, used when referring to the software */ @@ -64,10 +42,13 @@ class OC_Defaults { $this->defaultiOSClientUrl = $config->getSystemValue('customclient_ios', 'https://geo.itunes.apple.com/us/app/nextcloud/id1125420102?mt=8'); $this->defaultiTunesAppId = $config->getSystemValue('customclient_ios_appid', '1125420102'); $this->defaultAndroidClientUrl = $config->getSystemValue('customclient_android', 'https://play.google.com/store/apps/details?id=com.nextcloud.client'); + $this->defaultFDroidClientUrl = $config->getSystemValue('customclient_fdroid', 'https://f-droid.org/packages/com.nextcloud.client/'); $this->defaultDocBaseUrl = 'https://docs.nextcloud.com'; - $this->defaultDocVersion = \OC_Util::getVersion()[0]; // used to generate doc links - $this->defaultColorPrimary = '#0082c9'; + $this->defaultDocVersion = $serverVersion->getMajorVersion(); // used to generate doc links + $this->defaultColorBackground = '#00679e'; + $this->defaultColorPrimary = '#00679e'; $this->defaultTextColorPrimary = '#ffffff'; + $this->defaultProductName = 'Nextcloud'; $themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php'; if (file_exists($themePath)) { @@ -152,6 +133,18 @@ class OC_Defaults { } /** + * Returns the URL to Google Play for the Android Client + * @return string URL + */ + public function getFDroidClientUrl() { + if ($this->themeExist('getFDroidClientUrl')) { + return $this->theme->getFDroidClientUrl(); + } else { + return $this->defaultFDroidClientUrl; + } + } + + /** * Returns the documentation URL * @return string URL */ @@ -228,15 +221,6 @@ class OC_Defaults { } /** - * Returns logo claim - * @return string logo claim - * @deprecated 13.0.0 - */ - public function getLogoClaim() { - return ''; - } - - /** * Returns short version of the footer * @return string short footer */ @@ -244,9 +228,9 @@ class OC_Defaults { if ($this->themeExist('getShortFooter')) { $footer = $this->theme->getShortFooter(); } else { - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . - ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. - ' – ' . $this->getSlogan(); + $footer = '<a href="' . $this->getBaseUrl() . '" target="_blank"' + . ' rel="noreferrer noopener">' . $this->getEntity() . '</a>' + . ' – ' . $this->getSlogan(); } return $footer; @@ -292,6 +276,17 @@ class OC_Defaults { } /** + * Returns primary color + * @return string + */ + public function getColorBackground() { + if ($this->themeExist('getColorBackground')) { + return $this->theme->getColorBackground(); + } + return $this->defaultColorBackground; + } + + /** * @return array scss variables to overwrite */ public function getScssVariables() { @@ -330,4 +325,11 @@ class OC_Defaults { } return $this->defaultTextColorPrimary; } + + public function getProductName() { + if ($this->themeExist('getProductName')) { + return $this->theme->getProductName(); + } + return $this->defaultProductName; + } } |