Use some of the newer helper functions.

This commit is contained in:
Andrew McMillan 2008-11-18 18:17:17 +13:00
parent 2d6fa8369a
commit eda7bcc049

View File

@ -28,6 +28,9 @@ if ( preg_match( '#^(.*/)([^/]+)(/)?$#', $request->path, $matches ) ) {
$displayname = $matches[2]; $displayname = $matches[2];
} }
require_once("XMLDocument.php");
$reply = new XMLDocument(array( "DAV:" => "", 'urn:ietf:params:xml:ns:caldav' => 'C' ));
$failure = array(); $failure = array();
$propertysql = ""; $propertysql = "";
if ( isset($request->xml_tags) ) { if ( isset($request->xml_tags) ) {
@ -113,11 +116,10 @@ if ( isset($request->xml_tags) ) {
)); ));
} }
array_unshift( $failure, new XMLElement('href', $c->protocol_server_port_script . $request->path ) ); array_unshift( $failure, $reply->href( ConstructURL($request->path) ) );
$failure[] = new XMLElement('responsedescription', translate("Some properties were not able to be set.") ); $failure[] = new XMLElement('responsedescription', translate("Some properties were not able to be set.") );
$multistatus = new XMLElement( "multistatus", new XMLElement( 'response', $failure ), array('xmlns'=>'DAV:') ); $request->DoResponse( 207, $reply->Render("multistatus", new XMLElement( 'response', $failure )), 'text/xml; charset="utf-8"' );
$request->DoResponse( 207, $multistatus->Render(0,'<?xml version="1.0" encoding="utf-8" ?>'), 'text/xml; charset="utf-8"' );
} }
} }