[Pkg-owncloud-commits] [owncloud] 10/121: Add ability to theme iOS and Android client URLs just like desktop URLs.
David Prévot
taffit at moszumanska.debian.org
Thu Aug 21 16:44:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit ec79e5470aaef404195c8f0b30f0f9ea4882ed45
Author: scolebrook <scolebrook at mac.com>
Date: Tue Jul 8 09:51:05 2014 -0400
Add ability to theme iOS and Android client URLs just like desktop URLs.
* added to personal settings page.
* fix uppercase issue
* remove escaping because it's unneeded
---
lib/private/defaults.php | 54 ++++++++++++++++++++++++++++++++++++------------
lib/public/defaults.php | 16 ++++++++++++++
settings/personal.php | 4 ++--
3 files changed, 59 insertions(+), 15 deletions(-)
diff --git a/lib/private/defaults.php b/lib/private/defaults.php
index a439bf0..dfd114c 100644
--- a/lib/private/defaults.php
+++ b/lib/private/defaults.php
@@ -18,6 +18,8 @@ class OC_Defaults {
private $defaultTitle;
private $defaultBaseUrl;
private $defaultSyncClientUrl;
+ private $defaultiOSClientUrl;
+ private $defaultAndroidClientUrl;
private $defaultDocBaseUrl;
private $defaultDocVersion;
private $defaultSlogan;
@@ -28,18 +30,20 @@ class OC_Defaults {
$this->l = OC_L10N::get('lib');
$version = OC_Util::getVersion();
- $this->defaultEntity = "ownCloud"; /* e.g. company name, used for footers and copyright notices */
- $this->defaultName = "ownCloud"; /* short name, used when referring to the software */
- $this->defaultTitle = "ownCloud"; /* can be a longer name, for titles */
- $this->defaultBaseUrl = "https://owncloud.org";
- $this->defaultSyncClientUrl = "https://owncloud.org/sync-clients/";
- $this->defaultDocBaseUrl = "http://doc.owncloud.org";
- $this->defaultDocVersion = $version[0] . ".0"; // used to generate doc links
- $this->defaultSlogan = $this->l->t("web services under your control");
- $this->defaultLogoClaim = "";
- $this->defaultMailHeaderColor = "#1d2d44"; /* header color of mail notifications */
-
- if (class_exists("OC_Theme")) {
+ $this->defaultEntity = 'ownCloud'; /* e.g. company name, used for footers and copyright notices */
+ $this->defaultName = 'ownCloud'; /* short name, used when referring to the software */
+ $this->defaultTitle = 'ownCloud'; /* can be a longer name, for titles */
+ $this->defaultBaseUrl = 'https://owncloud.org';
+ $this->defaultSyncClientUrl = 'https://owncloud.org/sync-clients/';
+ $this->defaultiOSClientUrl = 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8';
+ $this->defaultAndroidClientUrl = 'https://play.google.com/store/apps/details?id=com.owncloud.android';
+ $this->defaultDocBaseUrl = 'http://doc.owncloud.org';
+ $this->defaultDocVersion = $version[0] . '.0'; // used to generate doc links
+ $this->defaultSlogan = $this->l->t('web services under your control');
+ $this->defaultLogoClaim = '';
+ $this->defaultMailHeaderColor = '#1d2d44'; /* header color of mail notifications */
+
+ if (class_exists('OC_Theme')) {
$this->theme = new OC_Theme();
}
}
@@ -79,6 +83,30 @@ class OC_Defaults {
}
/**
+ * Returns the URL to the App Store for the iOS Client
+ * @return string URL
+ */
+ public function getiOSClientUrl() {
+ if ($this->themeExist('getiOSClientUrl')) {
+ return $this->theme->getiOSClientUrl();
+ } else {
+ return $this->defaultiOSClientUrl;
+ }
+ }
+
+ /**
+ * Returns the URL to Google Play for the Android Client
+ * @return string URL
+ */
+ public function getAndroidClientUrl() {
+ if ($this->themeExist('getAndroidClientUrl')) {
+ return $this->theme->getAndroidClientUrl();
+ } else {
+ return $this->defaultAndroidClientUrl;
+ }
+ }
+
+ /**
* Returns the documentation URL
* @return string URL
*/
@@ -158,7 +186,7 @@ class OC_Defaults {
if ($this->themeExist('getShortFooter')) {
$footer = $this->theme->getShortFooter();
} else {
- $footer = "<a href=\"". $this->getBaseUrl() . "\" target=\"_blank\">" .$this->getEntity() . "</a>".
+ $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank">' .$this->getEntity() . '</a>'.
' – ' . $this->getSlogan();
}
diff --git a/lib/public/defaults.php b/lib/public/defaults.php
index 34b6890..9af3124 100644
--- a/lib/public/defaults.php
+++ b/lib/public/defaults.php
@@ -66,6 +66,22 @@ class Defaults {
}
/**
+ * link to the iOS client
+ * @return string
+ */
+ public function getiOSClientUrl() {
+ return $this->defaults->getiOSClientUrl();
+ }
+
+ /**
+ * link to the Android client
+ * @return string
+ */
+ public function getAndroidClientUrl() {
+ return $this->defaults->getAndroidClientUrl();
+ }
+
+ /**
* base URL to the documentation of your ownCloud instance
* @return string
*/
diff --git a/settings/personal.php b/settings/personal.php
index 36e8ea0..ddebcc0 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -76,8 +76,8 @@ usort( $languages, function ($a, $b) {
//links to clients
$clients = array(
'desktop' => OC_Config::getValue('customclient_desktop', $defaults->getSyncClientUrl()),
- 'android' => OC_Config::getValue('customclient_android', 'https://play.google.com/store/apps/details?id=com.owncloud.android'),
- 'ios' => OC_Config::getValue('customclient_ios', 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8')
+ 'android' => OC_Config::getValue('customclient_android', $defaults->getAndroidClientUrl()),
+ 'ios' => OC_Config::getValue('customclient_ios', $defaults->getiOSClientUrl())
);
// Return template
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list