From b29e01d5cf4b1d149373e4b70e83510d7e7cd50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= <schiessle@owncloud.com> Date: Wed, 12 Jun 2013 15:15:08 +0200 Subject: [PATCH] keep all strings in one place to make it easier to change them --- core/templates/layout.base.php | 2 +- core/templates/layout.guest.php | 9 +++--- core/templates/layout.user.php | 2 +- lib/defaults.php | 49 +++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 lib/defaults.php diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index cebb9e561f..163e8e3ae7 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -7,7 +7,7 @@ <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]--> <head> <title> - <?php OC_Util::getEditionString() === '' ? p("ownCloud") : p("ownCloud Enterprise Edition") ?> + <?php p(OC_Defaults::getName()); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 3ccc9e3218..03da7559b8 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -7,7 +7,7 @@ <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]--> <head data-requesttoken="<?php p($_['requesttoken']); ?>"> <title> - <?php OC_Util::getEditionString() === '' ? p("ownCloud") : p("ownCloud Enterprise Edition") ?> + <?php p(OC_Defaults::getName()); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="apple-itunes-app" content="app-id=543672169"> @@ -41,9 +41,8 @@ <footer> <p class="info"> <?php OC_Util::getEditionString() === '' ? '' : p('© 2013 '); ?> - <a href=" - <?php OC_Util::getEditionString() === '' ? p('http://owncloud.org') : p('https://owncloud.com'); ?>"> - <?php OC_Util::getEditionString() === '' ? p('ownCloud') : p('ownCloud Inc.'); ?></a> – - <?php OC_Util::getEditionString() === '' ? p($l->t( 'web services under your control' )) : p("Your Cloud, Your Data, Your Way!"); ?></p></footer> + <a href="<?php p(OC_Defaults::getBaseUrl())?>"> + <?php p(OC_Defaults::getEntity()); ?></a> – + <?php p(OC_Defaults::getSlogan()); ?></p></footer> </body> </html> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index dcd7562fd1..e2be2f951e 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -8,7 +8,7 @@ <head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>"> <title> <?php p(!empty($_['application'])?$_['application'].' | ':''); - OC_Util::getEditionString() === '' ? p("ownCloud") : p("ownCloud Enterprise Edition"); + p(OC_Defaults::getName()); p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?> </title> <meta charset="utf-8"> diff --git a/lib/defaults.php b/lib/defaults.php new file mode 100644 index 0000000000..59f8d976fe --- /dev/null +++ b/lib/defaults.php @@ -0,0 +1,49 @@ +<?php + +class OC_Defaults { + + private static $communityEntity = "ownCloud"; + private static $communityName = "ownCloud"; + private static $communityBaseUrl = "http://owncloud.org"; + private static $communitySlogan = "web services under your control"; + + private static $enterpriseEntity = "ownCloud Inc."; + private static $enterpriseName = "ownCloud Enterprise Edition"; + private static $enterpriseBaseUrl = "https://owncloud.com"; + private static $enterpriseSlogan = "Your Cloud, Your Data, Your Way!"; + + + public static function getBaseUrl() { + if (OC_Util::getEditionString() === '') { + return self::$communityBaseUrl; + } else { + return self::$enterpriseBaseUrl; + } + } + + public static function getName() { + if (OC_Util::getEditionString() === '') { + return self::$communityName; + } else { + return self::$enterpriseName; + } + } + + public static function getEntity() { + if (OC_Util::getEditionString() === '') { + return self::$communityEntity; + } else { + return self::$enterpriseEntity; + } + } + + public static function getSlogan() { + $l = OC_L10N::get('core'); + if (OC_Util::getEditionString() === '') { + return $l->t(self::$communitySlogan); + } else { + return self::$enterpriseSlogan; + } + } + +} \ No newline at end of file -- GitLab