From 2e5429900aa5db11d33d092792b195912cb4d295 Mon Sep 17 00:00:00 2001 From: itsbruce Date: Fri, 26 Jul 2002 21:14:02 +0000 Subject: [PATCH] full_address method added - itsbruce git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3141 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/addressbook.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 +?> -- 2.25.1