[Pkg-owncloud-commits] [php-sabredav] 41/66: Properties are responsible for their own HTML output.
David Prévot
taffit at moszumanska.debian.org
Wed May 27 13:56:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag 3.0.0-alpha1
in repository php-sabredav.
commit ab0ddd3650c3763951fbdb81ded935300bec2458
Author: Evert Pot <me at evertpot.com>
Date: Wed Apr 29 00:01:47 2015 -0400
Properties are responsible for their own HTML output.
This partially fixes a broken dependency problem on Sabre\DAV\Browser,
as Sabre\DAV\Browser had to be aware of Sabre\DAVACL to some degree.
It cleans up the property-output code quite a bit. And we now also have
html output for the {DAV:}acl property.
---
lib/DAV/Browser/HtmlOutput.php | 34 ++++++
lib/DAV/Browser/HtmlOutputHelper.php | 115 ++++++++++++++++++
lib/DAV/Browser/Plugin.php | 129 +++++----------------
lib/DAV/Xml/Property/Href.php | 35 +++++-
lib/DAV/Xml/Property/ResourceType.php | 27 ++++-
lib/DAV/Xml/Property/SupportedMethodSet.php | 34 +++++-
lib/DAV/Xml/Property/SupportedReportSet.php | 27 ++++-
lib/DAVACL/Xml/Property/Acl.php | 53 ++++++++-
.../Xml/Property/CurrentUserPrivilegeSet.php | 28 ++++-
lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php | 49 +++++++-
10 files changed, 412 insertions(+), 119 deletions(-)
diff --git a/lib/DAV/Browser/HtmlOutput.php b/lib/DAV/Browser/HtmlOutput.php
new file mode 100644
index 0000000..49ba3ff
--- /dev/null
+++ b/lib/DAV/Browser/HtmlOutput.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Sabre\DAV\Browser;
+
+/**
+ * WebDAV properties that implement this interface are able to generate their
+ * own html output for the browser plugin.
+ *
+ * This is only useful for display purposes, and might make it a bit easier for
+ * people to read and understand the value of some properties.
+ *
+ * @copyright Copyright (C) 2007-2015 fruux GmbH. (https://fruux.com/)
+ * @author Evert Pot (http://evertpot.com/)
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+interface HtmlOutput {
+
+ /**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html);
+
+}
diff --git a/lib/DAV/Browser/HtmlOutputHelper.php b/lib/DAV/Browser/HtmlOutputHelper.php
new file mode 100644
index 0000000..ffb1277
--- /dev/null
+++ b/lib/DAV/Browser/HtmlOutputHelper.php
@@ -0,0 +1,115 @@
+<?php
+
+namespace Sabre\DAV\Browser;
+
+use Sabre\Uri;
+use Sabre\Xml\Service as XmlService;
+
+/**
+ * This class provides a few utility functions for easily generating HTML for
+ * the browser plugin.
+ *
+ * @copyright Copyright (C) 2007-2015 fruux GmbH. (https://fruux.com/)
+ * @author Evert Pot (http://evertpot.com/)
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+class HtmlOutputHelper {
+
+ /**
+ * Link to the root of the application.
+ *
+ * @var string
+ */
+ protected $baseUri;
+
+ /**
+ * List of xml namespaces.
+ *
+ * @var array
+ */
+ protected $namespaceMap;
+
+ /**
+ * Creates the object.
+ *
+ * baseUri must point to the root of the application. This will be used to
+ * easily generate links.
+ *
+ * The namespaceMap contains an array with the list of xml namespaces and
+ * their prefixes. WebDAV uses a lot of XML with complex namespaces, so
+ * that can be used to make output a lot shorter.
+ *
+ * @param string $baseUri
+ * @param array $namespaceMap
+ */
+ function __construct($baseUri, array $namespaceMap) {
+
+ $this->baseUri = $baseUri;
+ $this->namespaceMap = $namespaceMap;
+
+ }
+
+ /**
+ * Generates a 'full' url based on a relative one.
+ *
+ * For relative urls, the base of the application is taken as the reference
+ * url, not the 'current url of the current request'.
+ *
+ * Absolute urls are left alone.
+ *
+ * @param string $path
+ * @return string
+ */
+ function fullUrl($path) {
+
+ return Uri\resolve($this->baseUri, $path);
+
+ }
+
+ /**
+ * Escape string for HTML output.
+ *
+ * @param string $input
+ * @return string
+ */
+ function h($input) {
+
+ return htmlspecialchars($input, ENT_COMPAT, 'UTF-8');
+
+ }
+
+ /**
+ * Generates a full <a>-tag.
+ *
+ * Url is automatically expanded. If label is not specified, we re-use the
+ * url.
+ *
+ * @param string $url
+ * @param string $label
+ * @return string
+ */
+ function link($url, $label = null) {
+
+ $url = $this->h($this->fullUrl($url));
+ return '<a href="' . $url . '">' . ($label ? $this->h($label) : $url) . '</a>';
+
+ }
+
+ /**
+ * This method takes an xml element in clark-notation, and turns it into a
+ * shortened version with a prefix, if it was a known namespace.
+ *
+ * @param string $element
+ * @return string
+ */
+ function xmlName($element) {
+
+ list($ns, $localName) = XmlService::parseClarkNotation($element);
+ if (isset($this->namespaceMap[$ns])) {
+ $propName = $this->namespaceMap[$ns] . ':' . $localName;
+ }
+ return "<span title=\"" . $this->h($element) . "\">" . $this->h($propName) . "</span>";
+
+ }
+
+}
diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php
index 4e5efbd..e777761 100644
--- a/lib/DAV/Browser/Plugin.php
+++ b/lib/DAV/Browser/Plugin.php
@@ -679,7 +679,7 @@ HTML;
}
- /**
+ /*
* Draws a table row for a property
*
* @param string $name
@@ -688,112 +688,43 @@ HTML;
*/
private function drawPropertyRow($name, $value) {
- $view = 'unknown';
- if (is_scalar($value)) {
- $view = 'string';
- } elseif($value instanceof \Sabre\Xml\XmlSerializable) {
-
- $mapping = [
- 'Sabre\\DAV\\Xml\\Property\\Href' => 'href',
- 'Sabre\\DAV\\Xml\\Property\\SupportedMethodSet' => 'valuelist',
- 'Sabre\\DAV\\Xml\\Property\\ResourceType' => 'xmlvaluelist',
- 'Sabre\\DAV\\Xml\\Property\\SupportedReportSet' => 'xmlvaluelist',
- 'Sabre\\DAVACL\\Xml\\Property\\CurrentUserPrivilegeSet' => 'xmlvaluelist',
- 'Sabre\\DAVACL\\Xml\\Property\\SupportedPrivilegeSet' => 'supported-privilege-set',
- 'Sabre\\Xml\\XmlSerializable' => 'xml',
- ];
-
- $view = 'complex';
- foreach($mapping as $class=>$val) {
- if ($value instanceof $class) {
- $view = $val;
- break;
- }
- }
- }
-
- list($ns, $localName) = \Sabre\Xml\Service::parseClarkNotation($name);
+ $html = new HtmlOutputHelper(
+ $this->server->getBaseUri(),
+ $this->server->xml->namespaceMap
+ );
- $realName = $name;
- if (isset($this->server->xml->namespaceMap[$ns])) {
- $name = $this->server->xml->namespaceMap[$ns] . ':' . $localName;
- }
+ return "<tr><th>". $html->xmlName($name). "</th><td>". $this->drawPropertyValue($html, $value). "</td></tr>";
- ob_start();
-
- $xmlValueDisplay = function($propName) {
- $realPropName = $propName;
- list($ns, $localName) = \Sabre\Xml\Service::parseClarkNotation($propName);
- if (isset($this->server->xml->namespaceMap[$ns])) {
- $propName = $this->server->xml->namespaceMap[$ns] . ':' . $localName;
- }
- return "<span title=\"" . $this->escapeHTML($realPropName) . "\">" . $this->escapeHTML($propName) . "</span>";
- };
+ }
- echo "<tr><th><span title=\"", $this->escapeHTML($realName), "\">", $this->escapeHTML($name), "</span></th><td>";
+ /**
+ * Draws a table row for a property
+ *
+ * @param HtmlOutputHelper $html
+ * @param mixed $value
+ * @return string
+ */
+ private function drawPropertyValue($html, $value) {
- switch($view) {
+ if (is_scalar($value)) {
+ return $html->h($value);
+ } elseif ($value instanceof HtmlOutput) {
+ return $value->toHtml($html);
+ } elseif($value instanceof \Sabre\Xml\XmlSerializable) {
- case 'href' :
- echo implode('<br />', array_map(function($href) {
- if (stripos($href,'mailto:')===0 || stripos($href,'/')===0 || stripos($href,'http:')===0 || stripos($href,'https:') === 0) {
- return "<a href=\"" . $this->escapeHTML($href) . '">' . $this->escapeHTML($href) . '</a>';
- } else {
- return "<a href=\"" . $this->escapeHTML($this->server->getBaseUri() . $href) . '">' . $this->escapeHTML($this->server->getBaseUri() . $href) . '</a>';
- }
- }, $value->getHrefs()));
- break;
- case 'xmlvaluelist' :
- echo implode(', ', array_map($xmlValueDisplay, $value->getValue()));
- break;
- case 'valuelist' :
- echo $this->escapeHTML(implode(', ', $value->getValue()));
- break;
- case 'supported-privilege-set' :
- $traverse = function($priv) use (&$traverse, $xmlValueDisplay) {
- echo "<li>";
- echo $xmlValueDisplay($priv['privilege']);
- if (isset($priv['abstract']) && $priv['abstract']) {
- echo " <i>(abstract)</i>";
- }
- if (isset($priv['description'])) {
- echo " " . $this->escapeHTML($priv['description']);
- }
- if (isset($priv['aggregates'])) {
- echo "\n<ul>\n";
- foreach($priv['aggregates'] as $subPriv) {
- $traverse($subPriv);
- }
- echo "</ul>";
- }
- echo "</li>\n";
- };
- echo "<ul class=\"tree\">";
- $traverse($value->getValue(), '');
- echo "</ul>\n";
- break;
- case 'string' :
- echo $this->escapeHTML($value);
- break;
- case 'xml' :
- $xml = $this->server->xml->write('{DAV:}root', $value, $this->server->getBaseUri());
- // removing first and last line, as they contain our root
- // element.
- $xml = explode("\n", $xml);
- $xml = array_slice($xml, 2, -2);
- echo "<pre>", $this->escapeHtml(implode("\n", $xml)), "</pre>";
- break;
- case 'complex' :
- echo '<em title="' . $this->escapeHTML(get_class($value)) . '">complex</em>';
- break;
- default :
- echo '<em>unknown</em>';
- break;
+ // There's no default html output for this property, we're going
+ // to output the actual xml serialization instead.
+ $xml = $this->server->xml->write('{DAV:}root', $value, $this->server->getBaseUri());
+ // removing first and last line, as they contain our root
+ // element.
+ $xml = explode("\n", $xml);
+ $xml = array_slice($xml, 2, -2);
+ return "<pre>" . $html->h(implode("\n", $xml)) . "</pre>";
+ } else {
+ return "<em>unknown</em>";
}
- return ob_get_clean();
-
}
/**
diff --git a/lib/DAV/Xml/Property/Href.php b/lib/DAV/Xml/Property/Href.php
index 6d9ecee..f98c0f1 100644
--- a/lib/DAV/Xml/Property/Href.php
+++ b/lib/DAV/Xml/Property/Href.php
@@ -2,10 +2,11 @@
namespace Sabre\DAV\Xml\Property;
-use
- Sabre\Xml\Element,
- Sabre\Xml\Reader,
- Sabre\Xml\Writer;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
+use Sabre\Xml\Element;
+use Sabre\Xml\Reader;
+use Sabre\Xml\Writer;
/**
* Href property
@@ -21,7 +22,7 @@ use
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Href implements Element {
+class Href implements Element, HtmlOutput {
/**
* List of uris
@@ -112,6 +113,30 @@ class Href implements Element {
}
/**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ $links = [];
+ foreach($this->getHrefs() as $href) {
+ $links[] = $html->link($href);
+ }
+ return implode('<br />', $links);
+
+ }
+
+ /**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
diff --git a/lib/DAV/Xml/Property/ResourceType.php b/lib/DAV/Xml/Property/ResourceType.php
index 13d5cab..8bd5bf0 100644
--- a/lib/DAV/Xml/Property/ResourceType.php
+++ b/lib/DAV/Xml/Property/ResourceType.php
@@ -2,6 +2,8 @@
namespace Sabre\DAV\Xml\Property;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
use Sabre\Xml\Element;
use Sabre\Xml\Reader;
@@ -16,7 +18,7 @@ use Sabre\Xml\Reader;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class ResourceType extends Element\Elements {
+class ResourceType extends Element\Elements implements HtmlOutput {
/**
* Constructor
@@ -100,4 +102,27 @@ class ResourceType extends Element\Elements {
}
+ /**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ return implode(
+ ', ',
+ array_map([$html, 'xmlName'], $this->getValue())
+ );
+
+ }
+
}
diff --git a/lib/DAV/Xml/Property/SupportedMethodSet.php b/lib/DAV/Xml/Property/SupportedMethodSet.php
index 9be231a..8be970c 100644
--- a/lib/DAV/Xml/Property/SupportedMethodSet.php
+++ b/lib/DAV/Xml/Property/SupportedMethodSet.php
@@ -2,9 +2,10 @@
namespace Sabre\DAV\Xml\Property;
-use
- Sabre\Xml\Writer,
- Sabre\Xml\XmlSerializable;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
+use Sabre\Xml\Writer;
+use Sabre\Xml\XmlSerializable;
/**
* supported-method-set property.
@@ -16,10 +17,10 @@ use
* http://tools.ietf.org/html/rfc3253#section-3.1.3
*
* @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
- * @author Evert Pot (http://evertpot.com/)
+ * @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class SupportedMethodSet implements XmlSerializable {
+class SupportedMethodSet implements XmlSerializable, HtmlOutput {
/**
* List of methods
@@ -99,4 +100,27 @@ class SupportedMethodSet implements XmlSerializable {
}
+ /**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ return implode(
+ ', ',
+ array_map([$html, 'h'], $this->getValue())
+ );
+
+ }
+
}
diff --git a/lib/DAV/Xml/Property/SupportedReportSet.php b/lib/DAV/Xml/Property/SupportedReportSet.php
index cbe9267..e856ad5 100644
--- a/lib/DAV/Xml/Property/SupportedReportSet.php
+++ b/lib/DAV/Xml/Property/SupportedReportSet.php
@@ -3,6 +3,8 @@
namespace Sabre\DAV\Xml\Property;
use Sabre\DAV;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
@@ -19,7 +21,7 @@ use Sabre\Xml\XmlSerializable;
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class SupportedReportSet implements XmlSerializable {
+class SupportedReportSet implements XmlSerializable, HtmlOutput {
/**
* List of reports
@@ -126,4 +128,27 @@ class SupportedReportSet implements XmlSerializable {
}
+ /**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ return implode(
+ ', ',
+ array_map([$html, 'xmlName'], $this->getValue())
+ );
+
+ }
+
}
diff --git a/lib/DAVACL/Xml/Property/Acl.php b/lib/DAVACL/Xml/Property/Acl.php
index 68cf552..aaecc4b 100644
--- a/lib/DAVACL/Xml/Property/Acl.php
+++ b/lib/DAVACL/Xml/Property/Acl.php
@@ -2,11 +2,12 @@
namespace Sabre\DAVACL\Xml\Property;
-use
- Sabre\DAV,
- Sabre\Xml\Element,
- Sabre\Xml\Reader,
- Sabre\Xml\Writer;
+use Sabre\DAV;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
+use Sabre\Xml\Element;
+use Sabre\Xml\Reader;
+use Sabre\Xml\Writer;
/**
* This class represents the {DAV:}acl property.
@@ -24,7 +25,7 @@ use
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Acl implements Element {
+class Acl implements Element, HtmlOutput {
/**
* List of privileges
@@ -106,6 +107,46 @@ class Acl implements Element {
}
/**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ ob_start();
+ echo "<table>";
+ echo "<tr><th>Principal</th><th>Privilege</th><th></th>";
+ foreach($this->privileges as $privilege) {
+
+ echo '<tr>';
+ // if it starts with a {, it's a special principal
+ if ($privilege['principal'][0] === '{') {
+ echo '<td>', $html->xmlName($privilege['principal']), '</td>';
+ } else {
+ echo '<td>', $html->link($privilege['principal']), '</td>';
+ }
+ echo '<td>', $html->xmlName($privilege['privilege']), '</td>';
+ echo '<td>';
+ if ($privilege['protected']) { echo '(protected)'; }
+ echo '</td>';
+ echo '</tr>';
+
+ }
+ echo "</table>";
+ return ob_get_clean();
+
+ }
+
+ /**
* The deserialize method is called during xml parsing.
*
* This method is called statictly, this is because in theory this method
diff --git a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
index 53a4b33..9ab091c 100644
--- a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
+++ b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
@@ -2,6 +2,8 @@
namespace Sabre\DAVACL\Xml\Property;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
use Sabre\Xml\Element;
use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
@@ -16,7 +18,7 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class CurrentUserPrivilegeSet implements Element {
+class CurrentUserPrivilegeSet implements Element, HtmlOutput {
/**
* List of privileges
@@ -129,4 +131,28 @@ class CurrentUserPrivilegeSet implements Element {
}
+ /**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ return implode(
+ ', ',
+ array_map([$html, 'xmlName'], $this->getValue())
+ );
+
+ }
+
+
}
diff --git a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
index 8e031cf..9fa4c32 100644
--- a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
+++ b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
@@ -2,6 +2,8 @@
namespace Sabre\DAVACL\Xml\Property;
+use Sabre\DAV\Browser\HtmlOutput;
+use Sabre\DAV\Browser\HtmlOutputHelper;
use Sabre\Xml\XmlSerializable;
use Sabre\Xml\Writer;
@@ -19,7 +21,7 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class SupportedPrivilegeSet implements XmlSerializable {
+class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
/**
* privileges
@@ -75,6 +77,51 @@ class SupportedPrivilegeSet implements XmlSerializable {
}
+ /**
+ * Generate html representation for this value.
+ *
+ * The html output is 100% trusted, and no effort is being made to sanitize
+ * it. It's up to the implementor to sanitize user provided values.
+ *
+ * The output must be in UTF-8.
+ *
+ * The baseUri parameter is a url to the root of the application, and can
+ * be used to construct local links.
+ *
+ * @param HtmlOutputHelper $html
+ * @return string
+ */
+ function toHtml(HtmlOutputHelper $html) {
+
+ $traverse = function($priv) use (&$traverse, $html) {
+ echo "<li>";
+ echo $html->xmlName($priv['privilege']);
+ if (isset($priv['abstract']) && $priv['abstract']) {
+ echo " <i>(abstract)</i>";
+ }
+ if (isset($priv['description'])) {
+ echo " " . $html->h($priv['description']);
+ }
+ if (isset($priv['aggregates'])) {
+ echo "\n<ul>\n";
+ foreach($priv['aggregates'] as $subPriv) {
+ $traverse($subPriv);
+ }
+ echo "</ul>";
+ }
+ echo "</li>\n";
+ };
+
+ ob_start();
+ echo "<ul class=\"tree\">";
+ $traverse($this->getValue(), '');
+ echo "</ul>\n";
+
+ return ob_get_clean();
+
+ }
+
+
/**
* Serializes a property
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list