summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-02-27 13:30:34 +0000
committerthomascube <thomas@roundcube.net>2011-02-27 13:30:34 +0000
commit0fbadebe13b13d6da470731df1f055df595c6a89 (patch)
tree203572c30219b15ca41679cf1087fe161b032cfb /program/steps/addressbook/func.inc
parentec6c39776959f2ed6c8f21cd7539e3f4a5f84d93 (diff)
Improve vcard import: map more fields, support photo urls, better UTF-16 charset detection
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r--program/steps/addressbook/func.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 336dd44ff..ed87cb150 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -365,6 +365,10 @@ function rcmail_contact_form($form, $record, $attrib = null)
// skip cols unknown to the backend
if (!$coltypes[$col])
continue;
+
+ // only string values are expected here
+ if (is_array($record[$col]))
+ $record[$col] = join(' ', $record[$col]);
if ($RCMAIL->action == 'show') {
if (!empty($record[$col]))
@@ -563,7 +567,9 @@ function rcmail_contact_photo($attrib)
if ($CONTACT_COLTYPES['photo']) {
$RCMAIL->output->set_env('photo_placeholder', $photo_img);
- if ($record['photo'])
+ if (strpos($record['photo'], 'http:') === 0)
+ $photo_img = $record['photo'];
+ else if ($record['photo'])
$photo_img = $RCMAIL->url(array('_action' => 'photo', '_cid' => $record['ID'], '_source' => $_REQUEST['_source']));
$img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => ''));
$content = html::div($attrib, $img);