Merge branch 'master' of github.com:DAViCal/davical into github
[davical.git] / inc / caldav-REPORT-pps-set.php
blob90caad2842d0e77ff368409355566d1aa1640c76
1 <?php
2 /**
3 * DAViCal CalDAV Server - handle principal-search-property-set report (RFC3744)
5 * @package davical
6 * @subpackage caldav
7 * @author Andrew McMillan <andrew@mcmillan.net.nz>
8 * @copyright Morphoss Ltd - http://www.morphoss.com/
9 * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
13 /**
14 * Wrap an individual property name as needed
16 function property_response( &$xmldoc, $property ) {
17 $prop = new XMLElement( 'prop' );
18 $xmldoc->NSElement($prop, $property );
19 return new XMLElement( 'principal-search-property', $prop );
22 $principal_search_property_set = array(
23 'DAV::displayname',
24 'urn:ietf:params:xml:ns:caldav:calendar-home-set',
25 'urn:ietf:params:xml:ns:caldav:calendar-user-address-set'
28 $responses = array();
29 foreach( $principal_search_property_set AS $k => $tag ) {
30 $responses[] = property_response( $reply, $tag );
34 $report = new XMLElement( 'principal-search-property-set', $responses, $reply->GetXmlNsArray() );
36 $request->XMLResponse( 207, $report );