forked from extern/egroupware
Created a little bit cleaner version of display_fullname()
This commit is contained in:
parent
66bea73872
commit
3f3c2e7d01
@ -301,29 +301,29 @@
|
|||||||
@param $firstname firstname
|
@param $firstname firstname
|
||||||
@param $lastname lastname
|
@param $lastname lastname
|
||||||
*/
|
*/
|
||||||
function display_fullname($lid = '', $firstname = '', $lastname = '')
|
function display_fullname($lid = '', $firstname = '', $lastname = '')
|
||||||
{
|
{
|
||||||
if (! $lid && ! $firstname && ! $lastname) {
|
if (! $lid && ! $firstname && ! $lastname)
|
||||||
global $phpgw_info;
|
{
|
||||||
$lid = $phpgw_info['user']['account_lid'];
|
global $phpgw_info;
|
||||||
$firstname = $phpgw_info['user']['firstname'];
|
$lid = $phpgw_info['user']['account_lid'];
|
||||||
$lastname = $phpgw_info['user']['lastname'];
|
$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
|
@function grab_owner_name
|
||||||
@abstract grab the owner name
|
@abstract grab the owner name
|
||||||
|
Loading…
Reference in New Issue
Block a user