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

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