diff options
Diffstat (limited to 'lib/public/Defaults.php')
-rw-r--r-- | lib/public/Defaults.php | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php index 7c6d73bcaea..6de22caa41e 100644 --- a/lib/public/Defaults.php +++ b/lib/public/Defaults.php @@ -1,36 +1,13 @@ <?php declare(strict_types=1); - /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Björn Schießle <bjoern@schiessle.org> - * @author J0WI <J0WI@users.noreply.github.com> - * @author Joas Schilling <coding@schilljs.com> - * @author Julius Härtl <jus@bitgrid.net> - * @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/> - * + * 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; @@ -39,7 +16,6 @@ namespace OCP; * @since 6.0.0 */ class Defaults { - /** * \OC_Defaults instance to retrieve the defaults * @since 6.0.0 @@ -51,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; } @@ -135,7 +111,7 @@ class Defaults { * name of your ownCloud instance containing HTML styles * @return string * @since 8.0.0 - * @depreacted 22.0.0 + * @deprecated 22.0.0 */ public function getHTMLName(): string { return $this->defaults->getHTMLName(); @@ -207,6 +183,18 @@ class Defaults { } /** + * 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(); + } + + /** * @param string $key * @return string URL to doc with key * @since 12.0.0 @@ -232,4 +220,16 @@ class Defaults { 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(); + } } |