summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorTakika <taki@alkoholista.hu>2013-10-21 15:33:07 +0200
committerTakika <taki@alkoholista.hu>2013-10-21 15:33:07 +0200
commit03713dbf5d45ee978b07586c4af1f924b204b5f1 (patch)
tree5cc6c49a6041624331d0161ef7c3f6bc305fed28 /program/lib/Roundcube
parenta649e0488a8913f73443390703692e96767ab871 (diff)
Add contact_listname hook to handle special name order
I can modify the addressbook_name_listing variable via main config or preferences_list_hook but I have to change the rcube_addressbook class to use the modified value. Some contry use special [name orders](http://en.wikipedia.org/wiki/Personal_name#Name_order) and we can handle them with this hook. I changed the hook name to contact_listname as proposed by thomascube in the original PR#127.
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_addressbook.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php
index f57a30eb9..886f65cb9 100644
--- a/program/lib/Roundcube/rcube_addressbook.php
+++ b/program/lib/Roundcube/rcube_addressbook.php
@@ -532,8 +532,12 @@ abstract class rcube_addressbook
$fn = join(' ', array($contact['surname'], $contact['firstname'], $contact['middlename']));
else if ($compose_mode == 1)
$fn = join(' ', array($contact['firstname'], $contact['middlename'], $contact['surname']));
- else
+ else if ($compose_mode == 0)
$fn = !empty($contact['name']) ? $contact['name'] : join(' ', array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix']));
+ else {
+ $plugin = rcube::get_instance()->plugins->exec_hook('contact_listname', array('contact' => $contact));
+ $fn = $plugin['fn'];
+ }
$fn = trim($fn, ', ');