2011-12-11 19:26:00 +04: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 21:31:29 +04:00
|
|
|
|
2012-05-03 14:23:29 +04:00
|
|
|
OCP\JSON::checkLoggedIn();
|
|
|
|
OCP\JSON::checkAppEnabled('contacts');
|
2011-12-11 19:26:00 +04:00
|
|
|
|
2012-05-01 20:50:31 +04:00
|
|
|
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
|
2011-12-31 00:07:16 +04:00
|
|
|
$contacts = OC_Contacts_VCard::all($ids);
|
2012-05-07 01:00:36 +04:00
|
|
|
$tmpl = new OCP\Template("contacts", "part.contacts");
|
2012-06-16 20:06:10 +04:00
|
|
|
$tmpl->assign('contacts', $contacts, false);
|
2011-12-11 19:26:00 +04:00
|
|
|
$page = $tmpl->fetchPage();
|
|
|
|
|
2012-05-03 14:23:29 +04:00
|
|
|
OCP\JSON::success(array('data' => array( 'page' => $page )));
|
2011-12-11 19:26:00 +04:00
|
|
|
?>
|