aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-07-27 16:49:55 +0200
committerMario Vavti <mario@mariovavti.com>2016-07-27 16:49:55 +0200
commitf808f1601b548ee4830f7a16b479eadce3b66094 (patch)
tree6368ffe7fab0ee78e6c3e3ebab26bd62f5c395ca /Zotlabs
parent672c3d7c6df2bf4667546c4376318d8684568014 (diff)
downloadvolse-hubzilla-f808f1601b548ee4830f7a16b479eadce3b66094.tar.gz
volse-hubzilla-f808f1601b548ee4830f7a16b479eadce3b66094.tar.bz2
volse-hubzilla-f808f1601b548ee4830f7a16b479eadce3b66094.zip
rework drag and drop to drag directly into files area, implement the default upload button to work with the same mechanism as drag and drop, revert 560af7a5b8e30001ea6bf9a6d2ea36e94ae904d0 since it did not work so well with the new cloud upload mechanism
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Storage/Browser.php75
1 files changed, 0 insertions, 75 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 0d1d4e791..93c55bd4c 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -70,81 +70,6 @@ class Browser extends DAV\Browser\Plugin {
}
/**
- * Extend from parent to add our own listeners
- */
- function initialize(DAV\Server $server) {
- parent::initialize($server);
- if ($this->enablePost) {
- $this->server->on('onBrowserPostAction', [$this, 'cloudPostAction']);
- }
- }
-
- /**
- * Handles POST requests for tree operations.
- *
- * @param string $uri
- * @param string $action
- * @param array $postVars
- * @return boolean false will stop other events in the beforeMethod chain to execute
- */
- function cloudPostAction($uri, $action, $postVars) {
- switch ($postVars['sabreAction']) {
- case 'mkcol' :
- if (isset($postVars['name']) && trim($postVars['name'])) {
- // Using basename() because we won't allow slashes
- list(, $folderName) = \Sabre\HTTP\URLUtil::splitPath(trim($postVars['name']));
-
- if (isset($postVars['resourceType'])) {
- $resourceType = explode(',', $postVars['resourceType']);
- } else {
- $resourceType = ['{DAV:}collection'];
- }
-
- $properties = [];
- foreach ($postVars as $varName => $varValue) {
- // Any _POST variable in clark notation is treated
- // like a property.
- if ($varName[0] === '{') {
- // PHP will convert any dots to underscores.
- // This leaves us with no way to differentiate
- // the two.
- // Therefore we replace the string *DOT* with a
- // real dot. * is not allowed in uris so we
- // should be good.
- $varName = str_replace('*DOT*', '.', $varName);
- $properties[$varName] = $varValue;
- }
- }
-
- $mkCol = new DAV\MkCol(
- $resourceType,
- $properties
- );
- $this->server->createCollection($uri . '/' . $folderName, $mkCol);
- }
- break;
-
- case 'put' :
-
- if ($_FILES)
- $file = current($_FILES);
- else
- break;
-
- for ($i = 0; $i < count($file['name']); $i++) {
- list(, $newName) = \Sabre\HTTP\URLUtil::splitPath(trim($file['name'][$i]));
-
- if (is_uploaded_file($file['tmp_name'][$i])) {
- $this->server->createFile($uri . '/' . $newName, fopen($file['tmp_name'][$i], 'r'));
- }
- }
- break;
-
- }
- return false;
- }
-
- /**
* @brief Creates the directory listing for the given path.
*
* @param string $path which should be displayed