Created a little bit cleaner version of display_fullname()

This commit is contained in:
jengo 2001-03-22 13:25:06 +00:00
parent 66bea73872
commit 3f3c2e7d01

View File

@ -301,29 +301,29 @@
@param $firstname firstname
@param $lastname lastname
*/
function display_fullname($lid = '', $firstname = '', $lastname = '')
{
if (! $lid && ! $firstname && ! $lastname) {
global $phpgw_info;
$lid = $phpgw_info['user']['account_lid'];
$firstname = $phpgw_info['user']['firstname'];
$lastname = $phpgw_info['user']['lastname'];
}
function display_fullname($lid = '', $firstname = '', $lastname = '')
{
if (! $lid && ! $firstname && ! $lastname)
{
global $phpgw_info;
$lid = $phpgw_info['user']['account_lid'];
$firstname = $phpgw_info['user']['firstname'];
$lastname = $phpgw_info['user']['lastname'];
}
if ($firstname)
{
$a[] = $firstname;
}
if ($lastname)
{
$a[] = $lastname;
}
return '<' . $lid . '> ' . implode(', ',$a);
}
if (! $firstname && ! $lastname) {
$s = $lid;
}
if (! $firstname && $lastname) {
$s = $lastname;
}
if ($firstname && ! $lastname) {
$s = $firstname;
}
if ($firstname && $lastname) {
$s = "$lastname, $firstname";
}
return $s;
}
/*!
@function grab_owner_name
@abstract grab the owner name