X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Faddressbook.php;h=a991c35d2ce8fe74cff4dc4d2ed69825b69c56e5;hb=2e5429900aa5db11d33d092792b195912cb4d295;hp=18c2dd6812ecd155dcee163667c0e4f81de58393;hpb=2017ebeb8cb745dcfe2a2b76690f6a8a0733ad3d;p=squirrelmail.git diff --git a/functions/addressbook.php b/functions/addressbook.php index 18c2dd68..a991c35d 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -201,6 +201,24 @@ class AddressBook { } + /* + * This function takes a $row array as returned by the addressbook + * search and returns an e-mail address with the full name or + * nickname optionally prepended. + */ + + function full_address($row) { + global $addrsrch_fullname; + + if ((isset($addrsrch_fullname)) && ($addrsrch_fullname)) { + $name = ($addrsrch_fullname === 'nickname') ? $row['nickname'] + : $row['name']; + return $name . ' <' . trim($row['email']) . '>'; + } else { + return trim($row['email']); + } + } + /* Return a list of addresses matching expression in all backends of a given type. @@ -525,4 +543,4 @@ function alistcmp($a,$b) { return (strtolower($a['name']) > strtolower($b['name'])) ? 1 : -1; } -?> \ No newline at end of file +?>