[Pkg-owncloud-commits] [php-sabredav] 01/66: Allow users to get property information from files with ease.
David Prévot
taffit at moszumanska.debian.org
Wed May 27 13:56:42 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 9f97a57a5da9f1dd228f7068126a8e4f37a38a5c
Author: Evert Pot <me at evertpot.com>
Date: Tue Mar 31 20:14:10 2015 -0400
Allow users to get property information from files with ease.
---
lib/DAV/Browser/Plugin.php | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php
index fd01fcf..1d41743 100644
--- a/lib/DAV/Browser/Plugin.php
+++ b/lib/DAV/Browser/Plugin.php
@@ -62,12 +62,30 @@ class Plugin extends DAV\ServerPlugin {
function initialize(DAV\Server $server) {
$this->server = $server;
+ $this->server->on('method:GET', [$this,'httpGetEarly'], 90);
$this->server->on('method:GET', [$this,'httpGet'], 200);
$this->server->on('onHTMLActionsPanel', [$this, 'htmlActionsPanel'],200);
if ($this->enablePost) $this->server->on('method:POST', [$this,'httpPOST']);
}
/**
+ * This method intercepts GET requests that have ?sabreAction=info
+ * appended to the URL
+ *
+ * @param RequestInterface $request
+ * @param ResponseInterface $response
+ * @return bool
+ */
+ function httpGetEarly(RequestInterface $request, ResponseInterface $response) {
+
+ $params = $request->getQueryParameters();
+ if (isset($params['sabreAction']) && $params['sabreAction']==='info') {
+ return $this->httpGet($request,$response);
+ }
+
+ }
+
+ /**
* This method intercepts GET requests to collections and returns the html
*
* @param RequestInterface $request
@@ -233,7 +251,7 @@ class Plugin extends DAV\ServerPlugin {
*/
function generateDirectoryIndex($path) {
- $html = $this->generateHeader($path . '/', $path);
+ $html = $this->generateHeader($path, $path);
$node = $this->server->tree->getNodeForPath($path);
if ($node instanceof DAV\ICollection) {
@@ -282,7 +300,9 @@ class Plugin extends DAV\ServerPlugin {
$lastMod = $subProps['{DAV:}getlastmodified']->getTime();
$html.=$this->escapeHTML($lastMod->format('F j, Y, g:i a'));
}
- $html.= '</td></tr>';
+ $html.= '</td>';
+ $html.= '<td><a href="' . $this->escapeHTML($subProps['fullPath']) . '?sabreAction=info"><span class="oi" data-glyph="info"></span></a></td>';
+ $html.= '</tr>';
}
$html.= '</table>';
--
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