From 2e127d2c5ea82089f74a5a33549cd42db9d1bb5e Mon Sep 17 00:00:00 2001 From: scolebrook Date: Tue, 8 Jul 2014 09:51:05 -0400 Subject: [PATCH 1/4] Add ability to theme iOS and Android client URLs just like desktop URLs. --- lib/private/defaults.php | 52 ++++++++++++++++++++++++++++++---------- lib/public/defaults.php | 16 +++++++++++++ 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/lib/private/defaults.php b/lib/private/defaults.php index a439bf0d6db..7b53a003c81 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 */ + $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")) { + if (class_exists('OC_Theme')) { $this->theme = new OC_Theme(); } } @@ -78,6 +82,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 = "getBaseUrl() . "\" target=\"_blank\">" .$this->getEntity() . "". + $footer = 'getBaseUrl() . '\" target=\"_blank\">' .$this->getEntity() . ''. ' – ' . $this->getSlogan(); } diff --git a/lib/public/defaults.php b/lib/public/defaults.php index 34b68903ee8..9af31245ff4 100644 --- a/lib/public/defaults.php +++ b/lib/public/defaults.php @@ -65,6 +65,22 @@ class Defaults { return $this->defaults->getSyncClientUrl(); } + /** + * 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 From 8c4358445063eb61f80455bd62f94a388b3a0723 Mon Sep 17 00:00:00 2001 From: scolebrook Date: Tue, 8 Jul 2014 15:15:22 -0400 Subject: [PATCH 2/4] Added to personal settings page. --- settings/personal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings/personal.php b/settings/personal.php index 36e8ea016de..ddebcc03024 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 From 7b222c4ab581dcd56176fc86c52155a9f0e67545 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 30 Jul 2014 11:38:17 +0200 Subject: [PATCH 3/4] fix uppercase issue --- lib/private/defaults.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/defaults.php b/lib/private/defaults.php index 7b53a003c81..bb4dda01fa2 100644 --- a/lib/private/defaults.php +++ b/lib/private/defaults.php @@ -18,8 +18,8 @@ class OC_Defaults { private $defaultTitle; private $defaultBaseUrl; private $defaultSyncClientUrl; - private $defaultiOSClientURL; - private $defaultAndroidClientURL; + private $defaultiOSClientUrl; + private $defaultAndroidClientUrl; private $defaultDocBaseUrl; private $defaultDocVersion; private $defaultSlogan; @@ -35,8 +35,8 @@ class OC_Defaults { $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->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'); From 8561d0dfca8fdb3826f6a301ee9c617bb11821fc Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 5 Aug 2014 13:18:38 +0200 Subject: [PATCH 4/4] remove escaping because it's unneeded --- lib/private/defaults.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/defaults.php b/lib/private/defaults.php index bb4dda01fa2..dfd114cd2fe 100644 --- a/lib/private/defaults.php +++ b/lib/private/defaults.php @@ -186,7 +186,7 @@ class OC_Defaults { if ($this->themeExist('getShortFooter')) { $footer = $this->theme->getShortFooter(); } else { - $footer = 'getBaseUrl() . '\" target=\"_blank\">' .$this->getEntity() . ''. + $footer = '' .$this->getEntity() . ''. ' – ' . $this->getSlogan(); }