Merge pull request #2031 from eMerzh/fix_empty_display_name

Avoid to display empty DisplayNames for menu and title
This commit is contained in:
eMerzh 2013-03-02 07:42:11 -08:00
commit 37295deeb7
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<html class="ng-csp">
<head>
<title><?php p(!empty($_['application'])?$_['application'].' | ':'') ?>ownCloud
<?php p(!empty($_['user_displayname'])?' ('.$_['user_displayname'].') ':'') ?></title>
<?php p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?></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')); ?>" />
@ -34,7 +34,7 @@
<ul id="settings" class="svg">
<span id="expand">
<span id="expandDisplayName"><?php p($_['user_displayname']) ?></span>
<span id="expandDisplayName"><?php p(trim($_['user_displayname']) != '' ? $_['user_displayname'] : $_['user_uid']) ?></span>
<img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" />
</span>
<div id="expanddiv">

View File

@ -31,6 +31,7 @@ class OC_TemplateLayout extends OC_Template {
}
$user_displayname = OC_User::getDisplayName();
$this->assign( 'user_displayname', $user_displayname );
$this->assign( 'user_uid', OC_User::getUser() );
} else if ($renderas == 'guest' || $renderas == 'error') {
parent::__construct('core', 'layout.guest');
} else {