From 9c9dc276b7a1d2592c4fb0a887888632dc1f1e29 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Wed, 25 Sep 2013 13:36:30 +0200 Subject: move the private namespace OC into lib/private - OCP will stay in lib/public Conflicts: lib/private/vcategories.php --- lib/private/defaults.php | 135 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 lib/private/defaults.php (limited to 'lib/private/defaults.php') diff --git a/lib/private/defaults.php b/lib/private/defaults.php new file mode 100644 index 00000000000..10813a3e8d8 --- /dev/null +++ b/lib/private/defaults.php @@ -0,0 +1,135 @@ +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 = $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 = "getBaseUrl() . "\" target=\"_blank\">" .$this->getEntity() . "". + ' – ' . $this->getSlogan(); + } + + return $footer; + } + + public function getLongFooter() { + if ($this->themeExist('getLongFooter')) { + $footer = $this->theme->getLongFooter(); + } else { + $footer = $this->getShortFooter(); + } + + return $footer; + } + +} -- cgit v1.2.3