2013-06-12 17:15:08 +04:00
|
|
|
|
<?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.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php')) {
|
|
|
|
|
require_once 'themes/' . OC_Util::getTheme() . '/defaults.php';
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-12 17:15:08 +04:00
|
|
|
|
class OC_Defaults {
|
|
|
|
|
|
2013-06-27 18:24:03 +04:00
|
|
|
|
private static $defaultEntity = "ownCloud";
|
|
|
|
|
private static $defaultName = "ownCloud";
|
|
|
|
|
private static $defaultBaseUrl = "http://owncloud.org";
|
|
|
|
|
private static $defaultSyncClientUrl = " http://owncloud.org/sync-clients/";
|
|
|
|
|
private static $defaultDocBaseUrl = "http://doc.owncloud.org";
|
|
|
|
|
private static $defaultSlogan = "web services under your control";
|
2013-06-12 17:15:08 +04:00
|
|
|
|
|
2013-06-27 18:24:03 +04:00
|
|
|
|
private function themeExist($method) {
|
|
|
|
|
if (OC_Util::getTheme() !== '' &&
|
|
|
|
|
//class_exists('OC_Theme') &&
|
|
|
|
|
method_exists('OC_Theme', $method)) {
|
2013-06-12 17:15:08 +04:00
|
|
|
|
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2013-06-12 17:15:08 +04:00
|
|
|
|
|
|
|
|
|
public static function getBaseUrl() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getBaseUrl')) {
|
|
|
|
|
return OC_Theme::getBaseUrl();
|
2013-06-12 17:15:08 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return self::$defaultBaseUrl;
|
2013-06-12 17:15:08 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-12 17:44:11 +04:00
|
|
|
|
public static function getSyncClientUrl() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getSyncClientUrl')) {
|
|
|
|
|
return OC_Theme::getSyncClientUrl();
|
2013-06-12 17:44:11 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return self::$defaultSyncClientUrl;
|
2013-06-12 17:44:11 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-12 18:19:28 +04:00
|
|
|
|
public static function getDocBaseUrl() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getDocBaseUrl')) {
|
|
|
|
|
return OC_Theme::getDocBaseUrl();
|
2013-06-12 18:19:28 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return self::$defaultDocBaseUrl;
|
2013-06-12 18:19:28 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-12 17:15:08 +04:00
|
|
|
|
public static function getName() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getName')) {
|
|
|
|
|
return OC_Theme::getName();
|
2013-06-12 17:15:08 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return self::$defaultName;
|
2013-06-12 17:15:08 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getEntity() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getEntity')) {
|
|
|
|
|
return OC_Theme::getEntity();
|
2013-06-12 17:15:08 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return self::$defaultEntity;
|
2013-06-12 17:15:08 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getSlogan() {
|
|
|
|
|
$l = OC_L10N::get('core');
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getSlogan')) {
|
|
|
|
|
return OC_Theme::getSlogan();
|
2013-06-12 17:15:08 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
return $l->t(self::$defaultSlogan);
|
2013-06-12 17:15:08 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-26 19:56:19 +04:00
|
|
|
|
public static function getShortFooter() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getShortFooter')) {
|
|
|
|
|
$footer = OC_Theme::getShortFooter();
|
|
|
|
|
} else {
|
2013-06-26 19:56:19 +04:00
|
|
|
|
$footer = "<a href=\"". self::getBaseUrl() . "\" target=\"_blank\">" .self::getEntity() . "</a>".
|
|
|
|
|
' – ' . self::getSlogan();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $footer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getLongFooter() {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
if (self::themeExist('getLongFooter')) {
|
|
|
|
|
$footer = OC_Theme::getLongFooter();
|
2013-06-26 19:56:19 +04:00
|
|
|
|
} else {
|
2013-06-27 18:24:03 +04:00
|
|
|
|
$footer = self::getShortFooter();
|
2013-06-26 19:56:19 +04:00
|
|
|
|
}
|
2013-06-27 18:24:03 +04:00
|
|
|
|
|
2013-06-26 19:56:19 +04:00
|
|
|
|
return $footer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|