diff options
author | Björn Schießle <bjoern@schiessle.org> | 2013-06-13 07:32:41 -0700 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2013-06-13 07:32:41 -0700 |
commit | 7889f2ef5c086d050cb88e2943253af84362365f (patch) | |
tree | a955ba46e3581d865d0fef50cf836c5b43b42498 | |
parent | 4bafa4e81acea88c3925a04c392a982c80a1d7c3 (diff) | |
parent | 15eda5321531b7ae44a6dd2ed1d28ae0e2045c2b (diff) | |
download | nextcloud-server-7889f2ef5c086d050cb88e2943253af84362365f.tar.gz nextcloud-server-7889f2ef5c086d050cb88e2943253af84362365f.zip |
Merge pull request #3687 from owncloud/template_updates
Make templates aware of different owncloud editions
-rw-r--r-- | apps/files_sharing/templates/public.php | 8 | ||||
-rw-r--r-- | core/templates/layout.base.php | 4 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 16 | ||||
-rw-r--r-- | core/templates/layout.user.php | 11 | ||||
-rw-r--r-- | lib/app.php | 3 | ||||
-rw-r--r-- | lib/defaults.php | 74 | ||||
-rw-r--r-- | settings/personal.php | 2 | ||||
-rw-r--r-- | settings/templates/admin.php | 8 | ||||
-rw-r--r-- | settings/templates/personal.php | 11 |
9 files changed, 119 insertions, 18 deletions
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 88a4cc242ba..adf3c3e9cc8 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -46,5 +46,9 @@ <?php endif; ?> <?php endif; ?> </div> -<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – -<?php p($l->t('web services under your control')); ?></p></footer> +<footer> + <p class="info"><a href="<?php p(OC_Defaults::getBaseUrl()); ?>"><?php p(OC_Defaults::getEntity()) ?></a> + <?php OC_Util::getEditionString() === '' ? print_unescaped(' – ') : print_unescaped('<br/>'); ?> + <?php p(OC_Defaults::getSlogan()); ?> + </p> +</footer> diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 336df27ef1c..163e8e3ae7e 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -6,7 +6,9 @@ <!--[if gt IE 9]><html class="ng-csp ie"><![endif]--> <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]--> <head> - <title>ownCloud</title> + <title> + <?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')); ?>" /> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" /> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index a3a8dc5f7ba..ba0147e6733 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -6,7 +6,9 @@ <!--[if gt IE 9]><html class="ng-csp ie"><![endif]--> <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]--> <head data-requesttoken="<?php p($_['requesttoken']); ?>"> - <title>ownCloud</title> + <title> + <?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"> <link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> @@ -33,10 +35,18 @@ <div id="login"> <header><div id="header"> <img src="<?php print_unescaped(image_path('', 'logo.svg')); ?>" class="svg" alt="ownCloud" /> + <?php if (OC_Util::getEditionString() !== ''): ?> + <div id="logo-claim">Enterprise Edition</div> + <?php endif; ?> </div></header> <?php print_unescaped($_['content']); ?> </div> - <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – - <?php p($l->t( 'web services under your control' )); ?></p></footer> + <footer> + <p class="info"> + <?php OC_Util::getEditionString() === '' ? '' : p('© 2013 '); ?> + <a href="<?php p(OC_Defaults::getBaseUrl())?>"> + <?php p(OC_Defaults::getEntity()); ?></a> + <?php OC_Util::getEditionString() === '' ? print_unescaped(' – ') : print_unescaped('<br/>'); ?> + <?php p(OC_Defaults::getSlogan()); ?></p></footer> </body> </html> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index a3ebf3abd03..44ae4c6ca35 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -6,8 +6,11 @@ <!--[if gt IE 9]><html class="ng-csp ie"><![endif]--> <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]--> <head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>"> - <title><?php p(!empty($_['application'])?$_['application'].' | ':'') ?>ownCloud - <?php p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?></title> + <title> + <?php p(!empty($_['application'])?$_['application'].' | ':''); + p(OC_Defaults::getName()); + p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?> + </title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="apple-itunes-app" content="app-id=543672169"> @@ -40,7 +43,9 @@ <header><div id="header"> <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a> - + <?php if (OC_Util::getEditionString() !== ''): ?> + <div id="logo-claim">Enterprise Edition</div> + <?php endif; ?> <ul id="settings" class="svg"> <span id="expand" tabindex="0" role="link"> <span id="expandDisplayName"><?php p(trim($_['user_displayname']) != '' ? $_['user_displayname'] : $_['user_uid']) ?></span> diff --git a/lib/app.php b/lib/app.php index 3e6cadfe2c9..f974dd9f594 100644 --- a/lib/app.php +++ b/lib/app.php @@ -349,7 +349,8 @@ class OC_App{ $settings = array(); // by default, settings only contain the help menu - if(OC_Config::getValue('knowledgebaseenabled', true)==true) { + if(OC_Util::getEditionString() === '' && + OC_Config::getValue('knowledgebaseenabled', true)==true) { $settings = array( array( "id" => "help", diff --git a/lib/defaults.php b/lib/defaults.php new file mode 100644 index 00000000000..7dc6fbd0ada --- /dev/null +++ b/lib/defaults.php @@ -0,0 +1,74 @@ +<?php + +/** + * Default strings and values which differ between the enterprise and the + * community edition. Use the get methods to always get the right strings. + */ + +class OC_Defaults { + + private static $communityEntity = "ownCloud"; + private static $communityName = "ownCloud"; + private static $communityBaseUrl = "http://owncloud.org"; + private static $communitySyncClientUrl = " http://owncloud.org/sync-clients/"; + private static $communityDocBaseUrl = "http://doc.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 $enterpriseDocBaseUrl = "http://doc.owncloud.com"; + private static $enterpiseSyncClientUrl = "https://owncloud.com/products/desktop-clients"; + 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 getSyncClientUrl() { + if (OC_Util::getEditionString() === '') { + return self::$communitySyncClientUrl; + } else { + return self::$enterpiseSyncClientUrl; + } + } + + public static function getDocBaseUrl() { + if (OC_Util::getEditionString() === '') { + return self::$communityDocBaseUrl; + } else { + return self::$enterpriseDocBaseUrl; + } + } + + 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 diff --git a/settings/personal.php b/settings/personal.php index cab6e56dada..cb411cacc5b 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -60,7 +60,7 @@ usort( $languages, function ($a, $b) { //links to clients $clients = array( - 'desktop' => OC_Config::getValue('customclient_desktop', 'http://owncloud.org/sync-clients/'), + 'desktop' => OC_Config::getValue('customclient_desktop', OC_Defaults::getSyncClientUrl()), 'android' => OC_Config::getValue('customclient_android', 'https://play.google.com/store/apps/details?id=com.owncloud.android'), 'ios' => OC_Config::getValue('customclient_ios', 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8') ); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 28254b7aa18..1ed3f6ef47f 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -230,10 +230,12 @@ endfor;?> </fieldset> - -<fieldset class="personalblock"> +<fieldset class="personalblock credits-footer"> +<?php if (OC_Util::getEditionString() === ''): ?> <legend><strong><?php p($l->t('Version'));?></strong></legend> <strong>ownCloud</strong> <?php p(OC_Util::getVersionString()); ?> <?php p(OC_Util::getEditionString()); ?><br/> <?php print_unescaped($l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.')); ?> +<?php else: ?> + <p>© 2013 <a href="<?php p(OC_Defaults::getBaseUrl()); ?>" target="_blank"><?php p(OC_Defaults::getEntity()); ?></a> – <?php p(OC_Defaults::getSlogan()); ?></p> +<?php endif; ?> </fieldset> - diff --git a/settings/templates/personal.php b/settings/templates/personal.php index b11f1912f51..a9457399d5d 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -94,8 +94,10 @@ if($_['passwordChangeSupported']) { <option value="<?php p($language['code']);?>"><?php p($language['name']);?></option> <?php endforeach;?> </select> + <?php if (OC_Util::getEditionString() === ''): ?> <a href="https://www.transifex.net/projects/p/owncloud/team/<?php p($_['activelanguage']['code']);?>/" target="_blank"><em><?php p($l->t('Help translate'));?></em></a> + <?php endif; ?> </fieldset> </form> @@ -109,12 +111,13 @@ if($_['passwordChangeSupported']) { print_unescaped($form); };?> - -<fieldset class="personalblock"> +<fieldset class="personalblock credits-footer"> +<?php if (OC_Util::getEditionString() === ''): ?> <legend><strong><?php p($l->t('Version'));?></strong></legend> <strong>ownCloud</strong> <?php p(OC_Util::getVersionString()); ?> <?php p(OC_Util::getEditionString()); ?> <br /> <?php print_unescaped($l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.')); ?> +<?php else: ?> + <p>© 2013 <a href="<?php p(OC_Defaults::getBaseUrl()); ?>" target="_blank"><?php p(OC_Defaults::getEntity()); ?></a> – <?php p(OC_Defaults::getSlogan()); ?></p> +<?php endif; ?> </fieldset> - - |