Browse Source

Add init funtion to OC_Defaults to be able to wrap translatable strings

remotes/origin/stable6
Björn Schießle 13 years ago
parent
commit
d46e62886a
  1. 2
      apps/files_sharing/templates/public.php
  2. 3
      core/templates/layout.base.php
  3. 3
      core/templates/layout.guest.php
  4. 3
      core/templates/layout.user.php
  5. 33
      lib/defaults.php
  6. 2
      lib/mail.php
  7. 2
      settings/personal.php
  8. 2
      settings/templates/admin.php
  9. 1
      settings/templates/personal.php

2
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">

3
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()); ?>

3
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()); ?>

3
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'].' | ':'');

33
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;
}
}

2
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";

2
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' );

2
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

1
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>

Loading…
Cancel
Save