]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/CalDAV/Property/SupportedCalendarData.php
Merge branch 'master' of git://github.com/friendica/friendica-addons
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / CalDAV / Property / SupportedCalendarData.php
1 <?php
2
3 /**
4  * Supported-calendar-data property
5  *
6  * This property is a representation of the supported-calendar-data property
7  * in the CalDAV namespace. SabreDAV only has support for text/calendar;2.0
8  * so the value is currently hardcoded.
9  *
10  * @package Sabre
11  * @subpackage CalDAV
12  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
13  * @author Evert Pot (http://www.rooftopsolutions.nl/) 
14  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
15  */
16 class Sabre_CalDAV_Property_SupportedCalendarData extends Sabre_DAV_Property {
17
18     /**
19      * Serializes the property in a DOMDocument
20      *
21      * @param Sabre_DAV_Server $server
22      * @param DOMElement $node
23      * @return void
24      */
25     public function serialize(Sabre_DAV_Server $server,DOMElement $node) {
26
27         $doc = $node->ownerDocument;
28
29         $prefix = isset($server->xmlNamespaces[Sabre_CalDAV_Plugin::NS_CALDAV])?$server->xmlNamespaces[Sabre_CalDAV_Plugin::NS_CALDAV]:'cal';
30
31         $caldata = $doc->createElement($prefix . ':calendar-data');
32         $caldata->setAttribute('content-type','text/calendar');
33         $caldata->setAttribute('version','2.0');
34
35         $node->appendChild($caldata);
36     }
37
38 }