summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-07-03 12:38:20 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-04 10:09:28 +0200
commitd46e62886a2b22a4c80df8cca09fb6f354d48614 (patch)
tree92324f0798a786259e4c31af3a8553a63e57e626
parent51cfacd78903e9b24df3cb6de178ec19805fd444 (diff)
downloadnextcloud-server-d46e62886a2b22a4c80df8cca09fb6f354d48614.tar.gz
nextcloud-server-d46e62886a2b22a4c80df8cca09fb6f354d48614.zip
Add init funtion to OC_Defaults to be able to wrap translatable strings
-rw-r--r--apps/files_sharing/templates/public.php2
-rw-r--r--core/templates/layout.base.php3
-rw-r--r--core/templates/layout.guest.php3
-rw-r--r--core/templates/layout.user.php3
-rw-r--r--lib/defaults.php33
-rw-r--r--lib/mail.php2
-rw-r--r--settings/personal.php2
-rw-r--r--settings/templates/admin.php2
-rw-r--r--settings/templates/personal.php1
9 files changed, 42 insertions, 9 deletions
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index cbd5ddf7a7d..a3a73f77ab7 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -2,6 +2,8 @@
<div id="notification" style="display: none;"></div>
</div>
+<?php OC_Defaults::init(); // initialize themable default strings and urls ?>
+
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php
index 163e8e3ae7e..51bac790741 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -5,6 +5,9 @@
<!--[if IE 9]><html class="ng-csp ie ie9 lte9"><![endif]-->
<!--[if gt IE 9]><html class="ng-csp ie"><![endif]-->
<!--[if !IE]><!--><html class="ng-csp"><!--<![endif]-->
+
+ <?php OC_Defaults::init(); // initialize themable default strings and urls ?>
+
<head>
<title>
<?php p(OC_Defaults::getName()); ?>
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index fde970554c6..b17e2fc547c 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -5,6 +5,9 @@
<!--[if IE 9]><html class="ng-csp ie ie9 lte9"><![endif]-->
<!--[if gt IE 9]><html class="ng-csp ie"><![endif]-->
<!--[if !IE]><!--><html class="ng-csp"><!--<![endif]-->
+
+ <?php OC_Defaults::init(); // initialize themable default strings and urls ?>
+
<head data-requesttoken="<?php p($_['requesttoken']); ?>">
<title>
<?php p(OC_Defaults::getName()); ?>
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index b424669e35a..2dd339cef96 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -5,6 +5,9 @@
<!--[if IE 9]><html class="ng-csp ie ie9 lte9"><![endif]-->
<!--[if gt IE 9]><html class="ng-csp ie"><![endif]-->
<!--[if !IE]><!--><html class="ng-csp"><!--<![endif]-->
+
+ <?php OC_Defaults::init(); // initialize themable default strings and urls ?>
+
<head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
<title>
<?php p(!empty($_['application'])?$_['application'].' | ':'');
diff --git a/lib/defaults.php b/lib/defaults.php
index 08bf6be43a3..1c3f8ffd056 100644
--- a/lib/defaults.php
+++ b/lib/defaults.php
@@ -11,13 +11,29 @@ if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.
class OC_Defaults {
- 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";
- private static $defaultLogoClaim = "";
+ private static $defaultEntity;
+ private static $defaultName;
+ private static $defaultBaseUrl;
+ private static $defaultSyncClientUrl;
+ private static $defaultDocBaseUrl;
+ private static $defaultSlogan;
+ private static $defaultLogoClaim;
+
+ public static function init() {
+ $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 = "";
+
+ if (class_exists("OC_Theme")) {
+ OC_Theme::init();
+ }
+ }
private static function themeExist($method) {
if (OC_Util::getTheme() !== '' && method_exists('OC_Theme', $method)) {
@@ -67,11 +83,10 @@ class OC_Defaults {
}
public static function getSlogan() {
- $l = OC_L10N::get('core');
if (self::themeExist('getSlogan')) {
return OC_Theme::getSlogan();
} else {
- return $l->t(self::$defaultSlogan);
+ return self::$defaultSlogan;
}
}
diff --git a/lib/mail.php b/lib/mail.php
index d6a383fe003..7c786ecc290 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -113,6 +113,8 @@ class OC_Mail {
*/
public static function getfooter() {
+ OC_Defaults::init();
+
$txt="\n--\n";
$txt.=OC_Defaults::getName() . "\n";
$txt.=OC_Defaults::getSlogan() . "\n";
diff --git a/settings/personal.php b/settings/personal.php
index cb411cacc5b..d68de4d570a 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -8,6 +8,8 @@
OC_Util::checkLoggedIn();
OC_App::loadApps();
+OC_Defaults::init(); // initialize themable default strings and urls
+
// Highlight navigation entry
OC_Util::addScript( 'settings', 'personal' );
OC_Util::addStyle( 'settings', 'settings' );
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 68a4cbe0590..fd79f88af1c 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -4,6 +4,8 @@
* See the COPYING-README file.
*/
$levels = array('Debug', 'Info', 'Warning', 'Error', 'Fatal');
+
+OC_Defaults::init(); // initialize themable default strings and urls
?>
<?php
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 5d0bb77c78e..4cf2b2393b3 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -4,6 +4,7 @@
* See the COPYING-README file.
*/?>
+<?php OC_Defaults::init(); // initialize themable default strings and urls ?>
<div class="clientsbox">
<h2><?php p($l->t('Get the apps to sync your files'));?></h2>