]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add ability to theme iOS and Android client URLs just like desktop URLs.
authorscolebrook <scolebrook@mac.com>
Tue, 8 Jul 2014 13:51:05 +0000 (09:51 -0400)
committerMorris Jobke <hey@morrisjobke.de>
Tue, 5 Aug 2014 11:16:51 +0000 (13:16 +0200)
lib/private/defaults.php
lib/public/defaults.php

index a439bf0d6db67d97aa38948917684deafb0cdaf2..7b53a003c8160db28fe300683709a4673eff33cf 100644 (file)
@@ -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();
                }
        }
@@ -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 = "<a href=\"". $this->getBaseUrl() . "\" target=\"_blank\">" .$this->getEntity() . "</a>".
+                       $footer = '<a href=\"'. $this->getBaseUrl() . '\" target=\"_blank\">' .$this->getEntity() . '</a>'.
                                ' – ' . $this->getSlogan();
                }
 
index 34b68903ee815d5d1238a149d5f72b4c90b81971..9af31245ff40b926c178638dfd21c9948e6f5bbd 100644 (file)
@@ -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