aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Defaults.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/OC_Defaults.php')
-rw-r--r--lib/private/legacy/OC_Defaults.php69
1 files changed, 28 insertions, 41 deletions
diff --git a/lib/private/legacy/OC_Defaults.php b/lib/private/legacy/OC_Defaults.php
index ce89a642741..0d460ff966d 100644
--- a/lib/private/legacy/OC_Defaults.php
+++ b/lib/private/legacy/OC_Defaults.php
@@ -1,42 +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;
@@ -52,12 +25,14 @@ class OC_Defaults {
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 */
@@ -69,8 +44,9 @@ class OC_Defaults {
$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';
@@ -252,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;
@@ -300,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() {