From 50569114acdc64e7c7cae1498635d3f821517c30 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 7 Mar 2016 15:53:16 +0100 Subject: Initial commit of the Faster IT roundcube_calendar plugin distribution This includes: * Kolab plugins 3.2.9 (calendar and libcalendaring) * CalDAV driver 3.2.8 * .htaccess files for at least some security * SabreDAV updated to 1.8.12 (Jan 2015 release) * Support for CURLOPT_SSL_* settings to allow self-signed certificates * Small fixes & improved documentation --- .../OldSabre/DAV/Property/SupportedReportSet.php | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 calendar/lib/SabreDAV/lib/OldSabre/DAV/Property/SupportedReportSet.php (limited to 'calendar/lib/SabreDAV/lib/OldSabre/DAV/Property/SupportedReportSet.php') diff --git a/calendar/lib/SabreDAV/lib/OldSabre/DAV/Property/SupportedReportSet.php b/calendar/lib/SabreDAV/lib/OldSabre/DAV/Property/SupportedReportSet.php new file mode 100644 index 0000000..ecbde7d --- /dev/null +++ b/calendar/lib/SabreDAV/lib/OldSabre/DAV/Property/SupportedReportSet.php @@ -0,0 +1,111 @@ +addReport($reports); + + } + + /** + * Adds a report to this property + * + * The report must be a string in clark-notation. + * Multiple reports can be specified as an array. + * + * @param mixed $report + * @return void + */ + public function addReport($report) { + + if (!is_array($report)) $report = array($report); + + foreach($report as $r) { + + if (!preg_match('/^{([^}]*)}(.*)$/',$r)) + throw new DAV\Exception('Reportname must be in clark-notation'); + + $this->reports[] = $r; + + } + + } + + /** + * Returns the list of supported reports + * + * @return array + */ + public function getValue() { + + return $this->reports; + + } + + /** + * Serializes the node + * + * @param DAV\Server $server + * @param \DOMElement $prop + * @return void + */ + public function serialize(DAV\Server $server, \DOMElement $prop) { + + foreach($this->reports as $reportName) { + + $supportedReport = $prop->ownerDocument->createElement('d:supported-report'); + $prop->appendChild($supportedReport); + + $report = $prop->ownerDocument->createElement('d:report'); + $supportedReport->appendChild($report); + + preg_match('/^{([^}]*)}(.*)$/',$reportName,$matches); + + list(, $namespace, $element) = $matches; + + $prefix = isset($server->xmlNamespaces[$namespace])?$server->xmlNamespaces[$namespace]:null; + + if ($prefix) { + $report->appendChild($prop->ownerDocument->createElement($prefix . ':' . $element)); + } else { + $report->appendChild($prop->ownerDocument->createElementNS($namespace, 'x:' . $element)); + } + + } + + } + +} -- cgit v1.2.3