source: pmb4.1/trunk/fuentes/pmb/admin/connecteurs/out/webdav/lib/Sabre/CalDAV/Property/SupportedCalendarData.php @ 478

Last change on this file since 478 was 478, checked in by mabarracus, 4 years ago

copy trusty code 4.1

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1<?php
2
3namespace Sabre\CalDAV\Property;
4use Sabre\DAV;
5use Sabre\CalDAV\Plugin;
6
7/**
8 * Supported-calendar-data property
9 *
10 * This property is a representation of the supported-calendar-data property
11 * in the CalDAV namespace. SabreDAV only has support for text/calendar;2.0
12 * so the value is currently hardcoded.
13 *
14 * @copyright Copyright (C) 2007-2013 Rooftop Solutions. All rights reserved.
15 * @author Evert Pot (http://www.rooftopsolutions.nl/)
16 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
17 */
18class SupportedCalendarData extends DAV\Property {
19
20    /**
21     * Serializes the property in a DOMDocument
22     *
23     * @param DAV\Server $server
24     * @param \DOMElement $node
25     * @return void
26     */
27    public function serialize(DAV\Server $server,\DOMElement $node) {
28
29        $doc = $node->ownerDocument;
30
31        $prefix = isset($server->xmlNamespaces[Plugin::NS_CALDAV])?$server->xmlNamespaces[Plugin::NS_CALDAV]:'cal';
32
33        $caldata = $doc->createElement($prefix . ':calendar-data');
34        $caldata->setAttribute('content-type','text/calendar');
35        $caldata->setAttribute('version','2.0');
36
37        $node->appendChild($caldata);
38    }
39
40}
Note: See TracBrowser for help on using the repository browser.