]> source.dussan.org Git - nextcloud-server.git/commitdiff
keep all strings in one place to make it easier to change them
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 12 Jun 2013 13:15:08 +0000 (15:15 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Wed, 12 Jun 2013 13:15:08 +0000 (15:15 +0200)
core/templates/layout.base.php
core/templates/layout.guest.php
core/templates/layout.user.php
lib/defaults.php [new file with mode: 0644]

index cebb9e561f164e58f941543b0ce9fc6b6f58253e..163e8e3ae7e6aedcd268aba5a0aebad15394aba0 100644 (file)
@@ -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')); ?>" />
index 3ccc9e3218290e8f2e94daff848472692a2d5b6f..03da7559b8c669651e2124b07ab728169a5abc04 100644 (file)
@@ -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> &ndash;
-                       <?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> &ndash;
+                       <?php p(OC_Defaults::getSlogan()); ?></p></footer>
        </body>
 </html>
index dcd7562fd1c00dc9e87bbc97d628104eefb144fa..e2be2f951eb51c7d958925c84ea38ae31343dd43 100644 (file)
@@ -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 (file)
index 0000000..59f8d97
--- /dev/null
@@ -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