From 6c382925f2d311cc33cba43395d2d77bba1a0552 Mon Sep 17 00:00:00 2001 From: thomasb Date: Wed, 8 Dec 2010 20:39:31 +0000 Subject: Save photos in Kolab contacts git-svn-id: https://svn.roundcube.net/trunk@4325 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/kolab_addressbook/rcube_kolab_contacts.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/kolab_addressbook/rcube_kolab_contacts.php b/plugins/kolab_addressbook/rcube_kolab_contacts.php index 941632cba..c56542d1e 100644 --- a/plugins/kolab_addressbook/rcube_kolab_contacts.php +++ b/plugins/kolab_addressbook/rcube_kolab_contacts.php @@ -758,7 +758,7 @@ class rcube_kolab_contacts extends rcube_addressbook // photo is stored as separate attachment if ($record['picture'] && ($att = $record['_attachments'][$record['picture']])) { - $out['photo'] = $this->contactstorage->getAttachment($att['key']); + $out['photo'] = $att['content'] ? $att['content'] : $this->contactstorage->getAttachment($att['key']); } // remove empty fields @@ -832,6 +832,16 @@ class rcube_kolab_contacts extends rcube_addressbook } } } + + // save new photo as attachment + if ($contact['photo']) { + $attkey = 'photo.attachment'; + $object['_attachments'][$attkey] = array( + 'type' => rc_image_content_type($contact['photo']), + 'content' => $contact['photo'], + ); + $object['picture'] = $attkey; + } return $object; } -- cgit v1.2.3