nextcloud/lib/defaults.php

126 lines
2.8 KiB
PHP
Raw Normal View History

<?php
2013-06-12 18:33:09 +04:00
/**
* 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 $defaultEntity;
private $defaultName;
private $defaultBaseUrl;
private $defaultSyncClientUrl;
private $defaultDocBaseUrl;
private $defaultSlogan;
private $defaultLogoClaim;
function __construct() {
$l = OC_L10N::get('core');
$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")) {
$this->theme = new OC_Theme();
}
}
private function themeExist($method) {
2013-06-27 18:28:45 +04:00
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();
2013-06-12 18:19:28 +04:00
} else {
return $this->defaultDocBaseUrl;
2013-06-12 18:19:28 +04:00
}
}
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();
2013-06-28 12:06:57 +04:00
} else {
return $this->defaultLogoClaim;
2013-06-28 12:06:57 +04:00
}
}
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;
}
}