2011-12-11 16:26:00 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2011 Thomas Tanghus <thomas@tanghus.net>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2012-04-17 19:31:29 +02:00
|
|
|
|
2012-05-03 12:23:29 +02:00
|
|
|
OCP\JSON::checkLoggedIn();
|
|
|
|
OCP\JSON::checkAppEnabled('contacts');
|
2011-12-11 16:26:00 +01:00
|
|
|
|
2012-05-01 18:50:31 +02:00
|
|
|
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
|
2011-12-30 21:07:16 +01:00
|
|
|
$contacts = OC_Contacts_VCard::all($ids);
|
2011-12-11 16:26:00 +01:00
|
|
|
$tmpl = new OC_TEMPLATE("contacts", "part.contacts");
|
|
|
|
$tmpl->assign('contacts', $contacts);
|
|
|
|
$page = $tmpl->fetchPage();
|
|
|
|
|
2012-05-03 12:23:29 +02:00
|
|
|
OCP\JSON::success(array('data' => array( 'page' => $page )));
|
2011-12-11 16:26:00 +01:00
|
|
|
?>
|