1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Contacts: Check format parameter

This commit is contained in:
Bart Visscher 2012-08-10 14:33:20 +02:00
parent fe8bae5b1e
commit 8679aa2699

View File

@ -68,11 +68,13 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
*/
public function formatItems($items, $format, $parameters = null) {
$addressbooks = array();
foreach ($items as $item) {
$addressbook = OC_Contacts_Addressbook::find($item['item_source']);
if ($addressbook) {
$addressbook['displayname'] = $item['item_target'];
$addressbooks[] = $addressbook;
if ($format == self::FORMAT_ADDRESSBOOKS) {
foreach ($items as $item) {
$addressbook = OC_Contacts_Addressbook::find($item['item_source']);
if ($addressbook) {
$addressbook['displayname'] = $item['item_target'];
$addressbooks[] = $addressbook;
}
}
}
return $addressbooks;
@ -88,4 +90,4 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
return $sources;
}
}
}