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

Fix addressbook sharing, formatItems() changed in past commits

This commit is contained in:
Michael Gapczynski 2012-07-11 11:33:48 -04:00
parent 20bdeb71b4
commit 379eea1779

View File

@ -65,13 +65,11 @@ class OC_Contacts_Share extends OCP\Share_Backend {
* This function allows the backend to control the output of shared items with custom formats. * This function allows the backend to control the output of shared items with custom formats.
* It is only called through calls to the public getItem(s)Shared(With) functions. * It is only called through calls to the public getItem(s)Shared(With) functions.
*/ */
public function formatItems($items, $format) { public function formatItems($items, $format, $parameters = null) {
$addressbooks = array(); $addressbooks = array();
foreach ($items as $source => $shares) { foreach ($items as $item) {
$addressbook = OC_Contacts_Addressbook::find( $source ); $addressbook = OC_Contacts_Addressbook::find($item['item_source']);
foreach ($shares as $info) { $addressbook['displayname'] = $item['item_target'];
$addressbook['displayname'] = $info['item_target'];
}
$addressbooks[] = $addressbook; $addressbooks[] = $addressbook;
} }
return $addressbooks; return $addressbooks;