aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-26 21:56:32 +0000
committerMario <mario@mariovavti.com>2022-10-26 21:56:32 +0000
commit95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d (patch)
tree582116e7571ae7eaa4a51578b2f5ebeae31f75a9 /Zotlabs/Storage
parentef2448e17e742e7dcef458993bce1e0a29756aa7 (diff)
parent9554f535199b5fb3a23dd40f9921a15339da3bd7 (diff)
downloadvolse-hubzilla-95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d.tar.gz
volse-hubzilla-95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d.tar.bz2
volse-hubzilla-95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d.zip
Merge branch 'dev'
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r--Zotlabs/Storage/Browser.php18
-rw-r--r--Zotlabs/Storage/Directory.php7
-rw-r--r--Zotlabs/Storage/File.php4
3 files changed, 19 insertions, 10 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index fdef35210..590c1cd9c 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -262,7 +262,7 @@ class Browser extends DAV\Browser\Plugin {
// put the array for this file together
$ft['attach_id'] = $id;
- $ft['icon'] = $icon;
+ // $ft['icon'] = $icon;
$ft['photo_icon'] = $photo_icon;
$ft['is_creator'] = $is_creator;
$ft['rel_path'] = (($data) ? '/cloud/' . $nick .'/' . $data['display_path'] : $href);
@@ -351,6 +351,9 @@ class Browser extends DAV\Browser\Plugin {
$header = (($cat) ? t('File category') . ": " . $this->escapeHTML($cat) : t('Files'));
$channel = channelx_by_n($channel_id);
+ $lockstate = null;
+ $channel_acl = null;
+
if($channel) {
$acl = new \Zotlabs\Access\AccessList($channel);
$channel_acl = $acl->get();
@@ -391,10 +394,10 @@ class Browser extends DAV\Browser\Plugin {
'$copy' => ['copy', t('Copy to target location'), 0, '', [t('No'), t('Yes')]],
'$return_path' => $path,
'$lockstate' => $lockstate,
- '$allow_cid' => acl2json($channel_acl['allow_cid']),
- '$allow_gid' => acl2json($channel_acl['allow_gid']),
- '$deny_cid' => acl2json($channel_acl['deny_cid']),
- '$deny_gid' => acl2json($channel_acl['deny_gid']),
+ '$allow_cid' => ((isset($channel_acl['allow_cid'])) ? acl2json($channel_acl['allow_cid']) : ''),
+ '$allow_gid' => ((isset($channel_acl['allow_gid'])) ? acl2json($channel_acl['allow_gid']) : ''),
+ '$deny_cid' => ((isset($channel_acl['deny_cid'])) ? acl2json($channel_acl['deny_cid']) : ''),
+ '$deny_gid' => ((isset($channel_acl['deny_gid'])) ? acl2json($channel_acl['deny_gid']) : ''),
'$is_owner' => $is_owner,
'$select_all_label' => t('Select All'),
'$bulk_actions_label' => t('Bulk Actions'),
@@ -454,6 +457,9 @@ class Browser extends DAV\Browser\Plugin {
$lockstate = '';
$limit = 0;
+ $cat = $_REQUEST['cat'] ?? '';
+ $cloud_tiles = $_SESSION['cloud_tiles'] ?? 0;
+
if($this->auth->owner_id) {
$channel = channelx_by_n($this->auth->owner_id);
if($channel) {
@@ -507,7 +513,7 @@ class Browser extends DAV\Browser\Plugin {
$breadcrumbs_html = '';
- if($display_path && ! $_REQUEST['cat'] && ! $_SESSION['cloud_tiles']){
+ if ($display_path && !$cat && !$cloud_tiles) {
$breadcrumbs = [];
$folders = explode('/', $display_path);
$folder_hashes = explode('/', $node->os_path);
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index c56ffcbbb..683887b31 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -270,7 +270,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
dbesc($mimetype),
intval($filesize),
intval(0),
- intval($is_photo),
+ intval(0),
dbesc($f),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
@@ -319,8 +319,9 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
// If we know it's a photo, over-ride the type in case the source system could not determine what it was
if($is_photo) {
- q("update attach set filetype = '%s' where hash = '%s' and uid = %d",
+ q("update attach set filetype = '%s', is_photo = %d where hash = '%s' and uid = %d",
dbesc($gis['mime']),
+ intval($is_photo),
dbesc($hash),
intval($c[0]['channel_id'])
);
@@ -617,7 +618,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
$file = trim($file, '/');
$path_arr = explode('/', $file);
- $cat = $_REQUEST['cat'];
+ $cat = $_REQUEST['cat'] ?? '';
if (! $path_arr)
diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php
index 76295d922..dc60a72ae 100644
--- a/Zotlabs/Storage/File.php
+++ b/Zotlabs/Storage/File.php
@@ -38,6 +38,7 @@ class File extends DAV\Node implements DAV\IFile {
*/
private $name;
+
/**
* Sets up the node, expects a full path name.
*
@@ -49,7 +50,8 @@ class File extends DAV\Node implements DAV\IFile {
$this->name = $name;
$this->data = $data;
$this->auth = $auth;
-
+ $this->os_path = null;
+ $this->folder_hash = null;
// logger(print_r($this->data, true), LOGGER_DATA);
}