From 665965a3a3facd26d507dc0f66cbcaa4c944cc15 Mon Sep 17 00:00:00 2001 From: HouraisanNEET Date: Sat, 10 Apr 2021 13:43:22 +0800 Subject: [PATCH] Add F-Droid Signed-off-by: HouraisanNEET --- apps/theming/lib/ThemingDefaults.php | 9 + core/img/f-droid.svg | 5242 ++++++++++++++++++++++++++ lib/private/legacy/OC_Defaults.php | 14 + lib/public/Defaults.php | 9 + 4 files changed, 5274 insertions(+) create mode 100644 core/img/f-droid.svg diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 35ed32c69a..d165ed929f 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -86,6 +86,8 @@ class ThemingDefaults extends \OC_Defaults { private $iOSClientUrl; /** @var string */ private $AndroidClientUrl; + /** @var string */ + private $FDroidClientUrl; /** * ThemingDefaults constructor. @@ -125,6 +127,7 @@ class ThemingDefaults extends \OC_Defaults { $this->iTunesAppId = parent::getiTunesAppId(); $this->iOSClientUrl = parent::getiOSClientUrl(); $this->AndroidClientUrl = parent::getAndroidClientUrl(); + $this->FDroidClientUrl = parent::getFDroidClientUrl(); } public function getName() { @@ -286,6 +289,12 @@ class ThemingDefaults extends \OC_Defaults { return $this->config->getAppValue('theming', 'AndroidClientUrl', $this->AndroidClientUrl); } + /** + * @return string + */ + public function getFDroidClientUrl() { + return $this->config->getAppValue('theming', 'FDroidClientUrl', $this->FDroidClientUrl); + } /** * @return array scss variables to overwrite diff --git a/core/img/f-droid.svg b/core/img/f-droid.svg new file mode 100644 index 0000000000..e52c4e3195 --- /dev/null +++ b/core/img/f-droid.svg @@ -0,0 +1,5242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Robert Martinez + + + + + https://f-droid.org + + + + + + + + + + + + + + + + + + AVAILABLE ON + F-Droid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/private/legacy/OC_Defaults.php b/lib/private/legacy/OC_Defaults.php index a9f588eb6e..e4ca3a2407 100644 --- a/lib/private/legacy/OC_Defaults.php +++ b/lib/private/legacy/OC_Defaults.php @@ -47,6 +47,7 @@ class OC_Defaults { private $defaultiOSClientUrl; private $defaultiTunesAppId; private $defaultAndroidClientUrl; + private $defaultFDroidClientUrl; private $defaultDocBaseUrl; private $defaultDocVersion; private $defaultSlogan; @@ -64,6 +65,7 @@ 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'; @@ -151,6 +153,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 diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php index 8f5ed68d18..69467f0d26 100644 --- a/lib/public/Defaults.php +++ b/lib/public/Defaults.php @@ -96,6 +96,15 @@ class Defaults { return $this->defaults->getAndroidClientUrl(); } + /** + * link to the Android client on F-Droid + * @return string + * @since ? + */ + public function getFDroidClientUrl() { + return $this->defaults->getFDroidClientUrl(); + } + /** * base URL to the documentation of your ownCloud instance * @return string