diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-07-03 14:21:51 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-07-04 10:11:16 +0200 |
commit | 3c691c9ec9b659897f4dda3769da7049c1ed23a9 (patch) | |
tree | 0f82fb63950245a312b0848b6200db81073f74a3 /lib | |
parent | d46e62886a2b22a4c80df8cca09fb6f354d48614 (diff) | |
download | nextcloud-server-3c691c9ec9b659897f4dda3769da7049c1ed23a9.tar.gz nextcloud-server-3c691c9ec9b659897f4dda3769da7049c1ed23a9.zip |
move to non-static OC_Defaults
Conflicts:
lib/mail.php
Diffstat (limited to 'lib')
-rw-r--r-- | lib/defaults.php | 111 | ||||
-rw-r--r-- | lib/mail.php | 6 | ||||
-rwxr-xr-x | lib/util.php | 2 |
3 files changed, 61 insertions, 58 deletions
diff --git a/lib/defaults.php b/lib/defaults.php index 1c3f8ffd056..196bb5cf14d 100644 --- a/lib/defaults.php +++ b/lib/defaults.php @@ -5,115 +5,118 @@ * 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 static $defaultEntity; - private static $defaultName; - private static $defaultBaseUrl; - private static $defaultSyncClientUrl; - private static $defaultDocBaseUrl; - private static $defaultSlogan; - private static $defaultLogoClaim; + private $theme; + + private $defaultEntity; + private $defaultName; + private $defaultBaseUrl; + private $defaultSyncClientUrl; + private $defaultDocBaseUrl; + private $defaultSlogan; + private $defaultLogoClaim; - public static function init() { + function __construct() { $l = OC_L10N::get('core'); - self::$defaultEntity = "ownCloud"; - self::$defaultName = "ownCloud"; - self::$defaultBaseUrl = "http://owncloud.org"; - self::$defaultSyncClientUrl = " http://owncloud.org/sync-clients/"; - self::$defaultDocBaseUrl = "http://doc.owncloud.org"; - self::$defaultSlogan = $l->t("web services under your control"); - self::$defaultLogoClaim = ""; + $this->defaultEntity = "ownCloud"; + $this->defaultName = "ownCloud"; + $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")) { - OC_Theme::init(); + $this->theme = new OC_Theme(); } } - private static function themeExist($method) { + private function themeExist($method) { if (OC_Util::getTheme() !== '' && method_exists('OC_Theme', $method)) { return true; } return false; } - public static function getBaseUrl() { - if (self::themeExist('getBaseUrl')) { - return OC_Theme::getBaseUrl(); + public function getBaseUrl() { + if ($this->themeExist('getBaseUrl')) { + return $this->theme->getBaseUrl(); } else { - return self::$defaultBaseUrl; + return $this->defaultBaseUrl; } } - public static function getSyncClientUrl() { - if (self::themeExist('getSyncClientUrl')) { - return OC_Theme::getSyncClientUrl(); + public function getSyncClientUrl() { + if ($this->themeExist('getSyncClientUrl')) { + return $this->theme->getSyncClientUrl(); } else { - return self::$defaultSyncClientUrl; + return $this->defaultSyncClientUrl; } } - public static function getDocBaseUrl() { - if (self::themeExist('getDocBaseUrl')) { - return OC_Theme::getDocBaseUrl(); + public function getDocBaseUrl() { + if ($this->themeExist('getDocBaseUrl')) { + return $this->theme->getDocBaseUrl(); } else { - return self::$defaultDocBaseUrl; + return $this->defaultDocBaseUrl; } } - public static function getName() { - if (self::themeExist('getName')) { - return OC_Theme::getName(); + public function getName() { + if ($this->themeExist('getName')) { + return $this->theme->getName(); } else { - return self::$defaultName; + return $this->defaultName; } } - public static function getEntity() { - if (self::themeExist('getEntity')) { - return OC_Theme::getEntity(); + public function getEntity() { + if ($this->themeExist('getEntity')) { + return $this->theme->getEntity(); } else { - return self::$defaultEntity; + return $this->defaultEntity; } } - public static function getSlogan() { - if (self::themeExist('getSlogan')) { - return OC_Theme::getSlogan(); + public function getSlogan() { + if ($this->themeExist('getSlogan')) { + return $this->theme->getSlogan(); } else { - return self::$defaultSlogan; + return $this->defaultSlogan; } } - public static function getLogoClaim() { - if (self::themeExist('getLogoClaim')) { - return OC_Theme::getLogoClaim(); + public function getLogoClaim() { + if ($this->themeExist('getLogoClaim')) { + return $this->theme->getLogoClaim(); } else { - return self::$defaultLogoClaim; + return $this->defaultLogoClaim; } } - public static function getShortFooter() { - if (self::themeExist('getShortFooter')) { - $footer = OC_Theme::getShortFooter(); + public function getShortFooter() { + if ($this->themeExist('getShortFooter')) { + $footer = $this->theme->getShortFooter(); } else { - $footer = "<a href=\"". self::getBaseUrl() . "\" target=\"_blank\">" .self::getEntity() . "</a>". - ' – ' . self::getSlogan(); + $footer = "<a href=\"". $this->getBaseUrl() . "\" target=\"_blank\">" .$this->getEntity() . "</a>". + ' – ' . $this->getSlogan(); } return $footer; } - public static function getLongFooter() { - if (self::themeExist('getLongFooter')) { - $footer = OC_Theme::getLongFooter(); + public function getLongFooter() { + if ($this->themeExist('getLongFooter')) { + $footer = $this->theme->getLongFooter(); } else { - $footer = self::getShortFooter(); + $footer = $this->getShortFooter(); } return $footer; diff --git a/lib/mail.php b/lib/mail.php index 7c786ecc290..b339b33e962 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -113,11 +113,11 @@ class OC_Mail { */ public static function getfooter() { - OC_Defaults::init(); + $defaults = new OC_Defaults(); $txt="\n--\n"; - $txt.=OC_Defaults::getName() . "\n"; - $txt.=OC_Defaults::getSlogan() . "\n"; + $txt.=$defaults->getName() . "\n"; + $txt.=$defaults->getSlogan() . "\n"; return($txt); diff --git a/lib/util.php b/lib/util.php index 4bc02daf36e..4ec115c9028 100755 --- a/lib/util.php +++ b/lib/util.php @@ -98,7 +98,7 @@ class OC_Util { * @return string */ public static function getEditionString() { - return ''; + return 'Enteerprise'; } /** |