summaryrefslogtreecommitdiff
path: root/program/steps/mail/autocomplete.inc
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-03-06 13:16:01 +0100
committerThomas Bruederli <thomas@roundcube.net>2014-03-06 13:17:14 +0100
commit532c10669be034d314b1906e8247339132f1ec61 (patch)
tree6db7aeebdca9b301cc25a6890237fa9f8e6a9707 /program/steps/mail/autocomplete.inc
parentc70f26776ef2a539834caa04ca86a0f71ee80cee (diff)
Support structured data for autocompletion results; map 'type' attribute to CSS class for autocomplete list items
Diffstat (limited to 'program/steps/mail/autocomplete.inc')
-rw-r--r--program/steps/mail/autocomplete.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index c15de92cf..20cf94084 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -90,7 +90,7 @@ if (!empty($book_types) && strlen($search)) {
// skip duplicates
if (!in_array($contact, $contacts)) {
- $contacts[] = $contact;
+ $contacts[] = array('name' => $contact, 'type' => $sql_arr['_type']);
$sort_keys[] = sprintf('%s %03d', $sql_arr['name'] , $idx++);
if (count($contacts) >= $MAXNUM) {
@@ -118,7 +118,7 @@ if (!empty($book_types) && strlen($search)) {
if ($group_prop['email']) {
$idx = 0;
foreach ((array)$group_prop['email'] as $email) {
- $contacts[] = format_email_recipient($email, $group['name']);
+ $contacts[] = array('name' => format_email_recipient($email, $group['name']), 'type' => 'group');
$sort_keys[] = sprintf('%s %03d', $group['name'] , $idx++);
if (count($contacts) >= $MAXNUM) {
@@ -131,6 +131,7 @@ if (!empty($book_types) && strlen($search)) {
$sort_keys[] = $group['name'];
$contacts[] = array(
'name' => $group['name'] . ' (' . intval($result->count) . ')',
+ 'type' => 'group',
'id' => $group['ID'],
'source' => $id
);