Commit 085b22e2 authored by Mario's avatar Mario
Browse files

changelog

parent b0b9b9f2
Pipeline #371866 passed with stage
in 2 minutes
This diff is collapsed.
......@@ -23,7 +23,6 @@ class Attach_edit extends Controller {
$channel_id = ((x($_POST, 'channel_id')) ? intval($_POST['channel_id']) : 0);
$dnd = ((x($_POST, 'dnd')) ? intval($_POST['dnd']) : 0);
$permissions = ((x($_POST, 'permissions')) ? intval($_POST['permissions']) : 0);
//$nick = ((x($_POST, 'nick')) ? notags($_POST['nick']) : '');
$return_path = ((x($_POST, 'return_path')) ? notags($_POST['return_path']) : 'cloud');
$delete = ((x($_POST, 'delete')) ? intval($_POST['delete']) : 0);
$newfolder = ((x($_POST, 'newfolder_' . $attach_id)) ? notags($_POST['newfolder_' . $attach_id]) : '');
......@@ -72,9 +71,7 @@ class Attach_edit extends Controller {
}
foreach ($r as $rr) {
$actions_done = '';
$attach_id = $rr['id'];
$resource = $rr['hash'];
$creator = $rr['creator'];
......@@ -148,7 +145,7 @@ class Attach_edit extends Controller {
}
if(! $delete && !$dnd) {
if(! $delete && ! $dnd) {
if ($single || (! $single && $categories)) {
q("DELETE FROM term WHERE uid = %d AND oid = %d AND otype = %d",
intval($channel_id),
......@@ -204,21 +201,12 @@ class Attach_edit extends Controller {
}
if ($single) {
if($dnd || $delete) {
json_return_and_die([ 'success' => true ]);
}
$url = get_cloud_url($channel_id, $nick, $resource);
goaway(dirname($url));
}
else {
if($dnd || $delete) {
json_return_and_die([ 'success' => true ]);
}
goaway($return_path);
if($dnd || $delete) {
json_return_and_die([ 'success' => true ]);
}
goaway($return_path);
}
}
......@@ -11,6 +11,7 @@ require_once('include/photos.php');
class File_upload extends \Zotlabs\Web\Controller {
function post() {
hz_syslog(print_r($_REQUEST,true));
logger('file upload: ' . print_r($_REQUEST,true));
logger('file upload: ' . print_r($_FILES,true));
......@@ -40,13 +41,11 @@ class File_upload extends \Zotlabs\Web\Controller {
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
if($r['success']) {
$hash = $r['data']['hash'];
$sync = attach_export_data($channel,$hash);
if($sync) {
Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
}
goaway(z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']);
goaway(z_root() . '/' . $_REQUEST['return_url']);
}
}
else {
......@@ -54,8 +53,6 @@ class File_upload extends \Zotlabs\Web\Controller {
$matches = [];
$partial = false;
if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) {
$pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches);
if($pm) {
......@@ -103,6 +100,7 @@ class File_upload extends \Zotlabs\Web\Controller {
}
}
goaway(z_root() . '/' . $_REQUEST['return_url']);
}
......
......@@ -308,7 +308,7 @@ class Browser extends DAV\Browser\Plugin {
$tiles = ((array_key_exists('cloud_tiles',$_SESSION)) ? intval($_SESSION['cloud_tiles']) : $deftiles);
$_SESSION['cloud_tiles'] = $tiles;
$header = (($cat) ? t('File category') . ": " . $this->escapeHTML($cat) : t('Files') . ": " . $this->escapeHTML($path) . "/");
$header = (($cat) ? t('File category') . ": " . $this->escapeHTML($cat) : t('Files'));
$channel = channelx_by_n($channel_id);
if($channel) {
......@@ -450,8 +450,35 @@ class Browser extends DAV\Browser\Plugin {
$special = 'cloud/' . $this->auth->owner_nick;
$count = strlen($special);
if(strpos($path,$special) === 0)
$path = trim(substr($path,$count),'/');
$display_path = trim(substr($path,$count),'/');
if(! $_REQUEST['cat']){
$folders = explode('/', $display_path);
$folder_hashes = explode('/', $node->os_path);
$breadcrumb_path = z_root() . '/cloud/' . $this->auth->owner_nick;
$breadcrumbs[] = [
'name' => $this->auth->owner_nick,
'hash' => '',
'path' => 'cloud/' . $this->auth->owner_nick
];
foreach($folders as $i => $name) {
$breadcrumb_path .= '/' . $name;
$breadcrumbs[] = [
'name' => $name,
'hash' => $folder_hashes[$i],
'path' => $breadcrumb_path
];
}
$breadcrumbs_html = replace_macros(get_markup_template('breadcrumb.tpl'), array(
'$breadcrumbs' => $breadcrumbs
));
}
$output .= replace_macros(get_markup_template('cloud_actionspanel.tpl'), array(
'$folder_header' => t('Create new folder'),
......@@ -466,11 +493,11 @@ class Browser extends DAV\Browser\Plugin {
'$deny_cid' => acl2json($channel_acl['deny_cid']),
'$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$return_url' => \App::$cmd,
'$path' => $path,
'$return_url' => $path,
'$folder' => $node->folder_hash,
'$dragdroptext' => t('Drop files here to immediately upload'),
'$notify' => ['notify', t('Show in your contacts shared folder'), 0, '', [t('No'), t('Yes')]]
'$notify' => ['notify', t('Show in your contacts shared folder'), 0, '', [t('No'), t('Yes')]],
'$breadcrumbs_html' => $breadcrumbs_html
));
}
......
......@@ -647,18 +647,19 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$pathname = filepath_macro($newalbum);
}
elseif(array_key_exists('folder',$arr)) {
$x = q("select filename from attach where hash = '%s' and uid = %d limit 1",
$x = q("select display_path from attach where hash = '%s' and uid = %d limit 1",
dbesc($arr['folder']),
intval($channel['channel_id'])
);
if($x)
$pathname = $x[0]['filename'];
$pathname = $x[0]['display_path'];
}
else {
$pathname = filepath_macro($album);
}
}
if(! $pathname) {
hz_syslog('no pathname');
$pathname = filepath_macro($upload_path);
}
......@@ -675,6 +676,8 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$direct = null;
if($pathname) {
hz_syslog('pathname: ' . $pathname);
$x = attach_mkdirp($channel, $observer_hash, $darr);
$folder_hash = (($x['success']) ? $x['data']['hash'] : '');
$direct = (($x['success']) ? $x['data'] : null);
......@@ -686,6 +689,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
}
else {
hz_syslog('gothere');
$folder_hash = ((($arr) && array_key_exists('folder',$arr)) ? $arr['folder'] : '');
}
......
......@@ -22,7 +22,6 @@
<div id="files-upload-tools" class="section-content-tools-wrapper ">
{{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{if $quota.warning}}<strong>{{$quota.warning}} </strong>{{/if}}{{if $quota.desc}}{{$quota.desc}}<br><br>{{/if}}</div>{{/if}}
<form id="ajax-upload-files" method="post" action="#" enctype="multipart/form-data" class="acl-form" data-form_id="ajax-upload-files" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
<!--input id="file-directory" type="hidden" name="directory" value="{{$path}}" /-->
<input id="file-folder"type="hidden" name="folder" value="{{$folder}}" />
<input type="hidden" name="channick" value="{{$channick}}" />
<input type="hidden" name="return_url" value="{{$return_url}}" />
......
<div id="cloud-drag-area" class="section-content-wrapper-np">
<div class="section-content-wrapper-np">
{{if $tiles}}
<table id="cloud-index">
<tr id="new-upload-progress-bar-1"></tr> {{* this is needed to append the upload files in the right order *}}
......@@ -42,7 +42,6 @@
{{/foreach}}
<div class="clear"></div>
{{else}}
<table id="cloud-index">
<tr>
<th width="1%">{{* multi tool checkbox *}}</th>
......@@ -202,6 +201,7 @@
<form id="attach_edit_form_{{$item.attach_id}}" action="attach_edit" method="post" class="acl-form" data-form_id="attach_edit_form_{{$item.attach_id}}" data-allow_cid='{{$item.allow_cid}}' data-allow_gid='{{$item.allow_gid}}' data-deny_cid='{{$item.deny_cid}}' data-deny_gid='{{$item.deny_gid}}'>
<input type="hidden" name="attach_id" value="{{$item.attach_id}}" />
<input type="hidden" name="channel_id" value="{{$channel_id}}" />
<input type="hidden" name="return_path" value="{{$return_path}}">
<div id="cloud-tool-rename-{{$item.attach_id}}" class="cloud-tool">
{{include file="field_input.tpl" field=$item.newfilename}}
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment