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