summaryrefslogtreecommitdiffstats
path: root/lib/private/defaults.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-10-02 10:11:18 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-10-02 10:11:18 +0200
commit8b08b1b455b474de3fa376dfafa3de63727364ea (patch)
tree536b2d4ba4f979d69f4f6e73755e06635345f78a /lib/private/defaults.php
parent084f76fd14125023d5b7277c558eb86a20ea07d3 (diff)
parent535ed8369f701a184340a428e82cc8d7cc7588bb (diff)
downloadnextcloud-server-8b08b1b455b474de3fa376dfafa3de63727364ea.tar.gz
nextcloud-server-8b08b1b455b474de3fa376dfafa3de63727364ea.zip
Merge branch 'master' into sharing_mail_notification_master
Conflicts: lib/private/util.php
Diffstat (limited to 'lib/private/defaults.php')
-rw-r--r--lib/private/defaults.php136
1 files changed, 136 insertions, 0 deletions
diff --git a/lib/private/defaults.php b/lib/private/defaults.php
new file mode 100644
index 00000000000..4951c6f50ae
--- /dev/null
+++ b/lib/private/defaults.php
@@ -0,0 +1,136 @@
+<?php
+
+/**
+ * Default strings and values which differ between the enterprise and the
+ * community edition. Use the get methods to always get the right strings.
+ */
+
+
+if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php')) {
+ require_once 'themes/' . OC_Util::getTheme() . '/defaults.php';
+}
+
+class OC_Defaults {
+
+ private $theme;
+ private $l;
+
+ private $defaultEntity;
+ private $defaultName;
+ private $defaultTitle;
+ private $defaultBaseUrl;
+ private $defaultSyncClientUrl;
+ private $defaultDocBaseUrl;
+ private $defaultSlogan;
+ private $defaultLogoClaim;
+
+ function __construct() {
+ $this->l = OC_L10N::get('core');
+
+ $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 = "http://owncloud.org";
+ $this->defaultSyncClientUrl = " http://owncloud.org/sync-clients/";
+ $this->defaultDocBaseUrl = "http://doc.owncloud.org";
+ $this->defaultSlogan = $this->l->t("web services under your control");
+ $this->defaultLogoClaim = "";
+
+ if (class_exists("OC_Theme")) {
+ $this->theme = new OC_Theme();
+ }
+ }
+
+ private function themeExist($method) {
+ if (OC_Util::getTheme() !== '' && method_exists('OC_Theme', $method)) {
+ return true;
+ }
+ return false;
+ }
+
+ public function getBaseUrl() {
+ if ($this->themeExist('getBaseUrl')) {
+ return $this->theme->getBaseUrl();
+ } else {
+ return $this->defaultBaseUrl;
+ }
+ }
+
+ public function getSyncClientUrl() {
+ if ($this->themeExist('getSyncClientUrl')) {
+ return $this->theme->getSyncClientUrl();
+ } else {
+ return $this->defaultSyncClientUrl;
+ }
+ }
+
+ public function getDocBaseUrl() {
+ if ($this->themeExist('getDocBaseUrl')) {
+ return $this->theme->getDocBaseUrl();
+ } else {
+ return $this->defaultDocBaseUrl;
+ }
+ }
+
+ public function getTitle() {
+ if ($this->themeExist('getTitle')) {
+ return $this->theme->getTitle();
+ } else {
+ return $this->defaultTitle;
+ }
+ }
+
+ public function getName() {
+ if ($this->themeExist('getName')) {
+ return $this->theme->getName();
+ } else {
+ return $this->defaultName;
+ }
+ }
+
+ public function getEntity() {
+ if ($this->themeExist('getEntity')) {
+ return $this->theme->getEntity();
+ } else {
+ return $this->defaultEntity;
+ }
+ }
+
+ public function getSlogan() {
+ if ($this->themeExist('getSlogan')) {
+ return $this->theme->getSlogan();
+ } else {
+ return $this->defaultSlogan;
+ }
+ }
+
+ public function getLogoClaim() {
+ if ($this->themeExist('getLogoClaim')) {
+ return $this->theme->getLogoClaim();
+ } else {
+ return $this->defaultLogoClaim;
+ }
+ }
+
+ public function getShortFooter() {
+ if ($this->themeExist('getShortFooter')) {
+ $footer = $this->theme->getShortFooter();
+ } else {
+ $footer = "<a href=\"". $this->getBaseUrl() . "\" target=\"_blank\">" .$this->getEntity() . "</a>".
+ ' – ' . $this->getSlogan();
+ }
+
+ return $footer;
+ }
+
+ public function getLongFooter() {
+ if ($this->themeExist('getLongFooter')) {
+ $footer = $this->theme->getLongFooter();
+ } else {
+ $footer = $this->getShortFooter();
+ }
+
+ return $footer;
+ }
+
+}