Avoid to display empty DisplayNames for menu and title

This commit is contained in:
Brice Maron 2013-03-02 16:09:36 +01:00
parent d3e88e6a8c
commit 050de008b1
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 {