aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage/Browser.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Storage/Browser.php')
-rw-r--r--Zotlabs/Storage/Browser.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 720940953..713d75108 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -101,8 +101,8 @@ class Browser extends DAV\Browser\Plugin {
$parentpath = array();
// only show parent if not leaving /cloud/; TODO how to improve this?
if ($path && $path != "cloud") {
- list($parentUri) = DAV\URLUtil::splitPath($path);
- $fullPath = DAV\URLUtil::encodePath($this->server->getBaseUri() . $parentUri);
+ list($parentUri) = \Sabre\HTTP\URLUtil::splitPath($path);
+ $fullPath = \Sabre\HTTP\URLUtil::encodePath($this->server->getBaseUri() . $parentUri);
$parentpath['icon'] = $this->enableAssets ? '<a href="' . $fullPath . '"><img src="' . $this->getAssetUrl('icons/parent' . $this->iconExtension) . '" width="24" alt="' . t('parent') . '"></a>' : '';
$parentpath['path'] = $fullPath;
@@ -116,7 +116,7 @@ class Browser extends DAV\Browser\Plugin {
// This is the current directory, we can skip it
if (rtrim($file['href'],'/') == $path) continue;
- list(, $name) = DAV\URLUtil::splitPath($file['href']);
+ list(, $name) = \Sabre\HTTP\URLUtil::splitPath($file['href']);
if (isset($file[200]['{DAV:}resourcetype'])) {
$type = $file[200]['{DAV:}resourcetype']->getValue();
@@ -166,7 +166,7 @@ class Browser extends DAV\Browser\Plugin {
$size = isset($file[200]['{DAV:}getcontentlength']) ? (int)$file[200]['{DAV:}getcontentlength'] : '';
$lastmodified = ((isset($file[200]['{DAV:}getlastmodified'])) ? $file[200]['{DAV:}getlastmodified']->getTime()->format('Y-m-d H:i:s') : '');
- $fullPath = DAV\URLUtil::encodePath('/' . trim($this->server->getBaseUri() . ($path ? $path . '/' : '') . $name, '/'));
+ $fullPath = \Sabre\HTTP\URLUtil::encodePath('/' . trim($this->server->getBaseUri() . ($path ? $path . '/' : '') . $name, '/'));
$displayName = isset($file[200]['{DAV:}displayname']) ? $file[200]['{DAV:}displayname'] : $name;
@@ -197,7 +197,7 @@ class Browser extends DAV\Browser\Plugin {
}
}
- $attachIcon = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"icon-download\"></i></a>";
+ $attachIcon = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"fa fa-arrow-circle-o-down\"></i></a>";
// put the array for this file together
$ft['attachId'] = $this->findAttachIdByHash($attachHash);
@@ -219,7 +219,7 @@ class Browser extends DAV\Browser\Plugin {
$output = '';
if ($this->enablePost) {
- $this->server->broadcastEvent('onHTMLActionsPanel', array($parent, &$output));
+ $this->server->emit('onHTMLActionsPanel', array($parent, &$output, $path));
}
$html .= replace_macros(get_markup_template('cloud.tpl'), array(
@@ -246,14 +246,17 @@ class Browser extends DAV\Browser\Plugin {
\App::$page['content'] = $html;
load_pdl($a);
- $theme_info_file = "view/theme/" . current_theme() . "/php/theme.php";
+ $current_theme = \Zotlabs\Render\Theme::current();
+
+ $theme_info_file = "view/theme/" . $current_theme[0] . "/php/theme.php";
if (file_exists($theme_info_file)){
require_once($theme_info_file);
- if (function_exists(str_replace('-', '_', current_theme()) . '_init')) {
- $func = str_replace('-', '_', current_theme()) . '_init';
+ if (function_exists(str_replace('-', '_', $current_theme[0]) . '_init')) {
+ $func = str_replace('-', '_', $current_theme[0]) . '_init';
$func($a);
}
}
+ $this->server->httpResponse->setHeader('Content-Security-Policy', "script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'");
construct_page($a);
}
@@ -263,7 +266,7 @@ class Browser extends DAV\Browser\Plugin {
* @param \Sabre\DAV\INode $node
* @param string &$output
*/
- public function htmlActionsPanel(DAV\INode $node, &$output) {
+ public function htmlActionsPanel(DAV\INode $node, &$output, $path) {
if (! $node instanceof DAV\ICollection)
return;
@@ -273,7 +276,7 @@ class Browser extends DAV\Browser\Plugin {
return;
// Storage and quota for the account (all channels of the owner of this directory)!
- $limit = service_class_fetch($owner, 'attach_upload_limit');
+ $limit = engr_units_to_bytes(service_class_fetch($owner, 'attach_upload_limit'));
$r = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d",
intval($this->auth->channel_account_id)
);