DAViCal
 All Classes Namespaces Functions Variables Pages
caldav-REPORT-pps-set.php
1 <?php
16 function property_response( &$xmldoc, $property ) {
17  $prop = new XMLElement( 'prop' );
18  $xmldoc->NSElement($prop, $property );
19  return new XMLElement( 'principal-search-property', $prop );
20 }
21 
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'
26 );
27 
28 if ( $request->depth > 0 ) {
29  $request->DoResponse( 400, 'The principal-search-property-set REPORT is only defined for Depth "0".' );
30 }
31 
32 $responses = array();
33 foreach( $principal_search_property_set AS $k => $tag ) {
34  $responses[] = property_response( $reply, $tag );
35 }
36 
37 
38 $report = new XMLElement( 'principal-search-property-set', $responses, $reply->GetXmlNsArray() );
39 
40 $request->XMLResponse( 207, $report );