diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-08 20:39:31 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-08 20:39:31 +0000 |
| commit | 6c382925f2d311cc33cba43395d2d77bba1a0552 (patch) | |
| tree | e990c85df8bdb901bc6a1314cdfeb8729e064dfc | |
| parent | ad9fe938f3feffd936323a8a44bcfe43b6da403c (diff) | |
Save photos in Kolab contacts
git-svn-id: https://svn.roundcube.net/trunk@4325 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | plugins/kolab_addressbook/rcube_kolab_contacts.php | 12 |
1 files changed, 11 insertions, 1 deletions
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; } |
