diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2014-10-27 23:16:15 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2014-10-27 23:16:15 +0100 |
| commit | 0c9b45d210a5d94b3ba219e32b73233a5a795f61 (patch) | |
| tree | b49b11b52c475e04405486775837cdbe24a54a10 /lib | |
| parent | 46a9ff9889466f23c310e2de100d0ae16c5a2a1a (diff) | |
| download | grauphel-0c9b45d210a5d94b3ba219e32b73233a5a795f61.tar.gz grauphel-0c9b45d210a5d94b3ba219e32b73233a5a795f61.zip | |
Download note as XML and JSON
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/response/xmlresponse.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/response/xmlresponse.php b/lib/response/xmlresponse.php new file mode 100644 index 0000000..050bbff --- /dev/null +++ b/lib/response/xmlresponse.php @@ -0,0 +1,43 @@ +<?php +/** + * Part of grauphel + * + * PHP version 5 + * + * @category Tools + * @package Grauphel + * @author Christian Weiske <cweiske@cweiske.de> + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/grauphel.htm + */ +namespace OCA\Grauphel\Response; + +/** + * Returns XML data + * + * @category Tools + * @package Grauphel + * @author Christian Weiske <cweiske@cweiske.de> + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @version Release: @package_version@ + * @link http://cweiske.de/grauphel.htm + */ +class XmlResponse extends \OCP\AppFramework\Http\Response +{ + protected $xml; + + public function __construct($xml) + { + $this->setStatus(\OCP\AppFramework\Http::STATUS_OK); + $this->addHeader('Content-Type', 'text/xml; charset=utf-8'); + $this->xml = $xml; + } + + public function render() + { + return $this->xml; + } +} +?> |
