Updates to lastest File API changes
This commit is contained in:
parent
ef525b570e
commit
96b5313a13
2 changed files with 6 additions and 9 deletions
|
@ -205,7 +205,6 @@ function kolab_files_selector_dialog()
|
||||||
// send request
|
// send request
|
||||||
rcmail.http_post('plugin.kolab_files', {
|
rcmail.http_post('plugin.kolab_files', {
|
||||||
act: 'attach-file',
|
act: 'attach-file',
|
||||||
folder: file_api.env.folder,
|
|
||||||
files: list,
|
files: list,
|
||||||
id: rcmail.env.compose_id,
|
id: rcmail.env.compose_id,
|
||||||
uploadid: id
|
uploadid: id
|
||||||
|
@ -586,7 +585,7 @@ function kolab_files_ui()
|
||||||
$('tbody', table).empty();
|
$('tbody', table).empty();
|
||||||
|
|
||||||
$.each(response.result, function(key, data) {
|
$.each(response.result, function(key, data) {
|
||||||
var c, row = '', col;
|
var c, col, row = '';
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
@ -594,7 +593,7 @@ function kolab_files_ui()
|
||||||
c = rcmail.env.coltypes[c];
|
c = rcmail.env.coltypes[c];
|
||||||
if (c == 'name')
|
if (c == 'name')
|
||||||
col = '<td class="name filename ' + file_api.file_type_class(data.type) + '">'
|
col = '<td class="name filename ' + file_api.file_type_class(data.type) + '">'
|
||||||
+ '<span>' + key + '</span></td>';
|
+ '<span>' + data.name + '</span></td>';
|
||||||
else if (c == 'mtime')
|
else if (c == 'mtime')
|
||||||
col = '<td class="mtime">' + data.mtime + '</td>';
|
col = '<td class="mtime">' + data.mtime + '</td>';
|
||||||
else if (c == 'size')
|
else if (c == 'size')
|
||||||
|
@ -609,7 +608,7 @@ function kolab_files_ui()
|
||||||
|
|
||||||
row = $('<tr>')
|
row = $('<tr>')
|
||||||
.html(row)
|
.html(row)
|
||||||
.attr({id: 'rcmrow' + i, 'data-file': urlencode(key)});
|
.attr({id: 'rcmrow' + i, 'data-file': key});
|
||||||
|
|
||||||
// table.append(row);
|
// table.append(row);
|
||||||
rcmail.file_list.insert_row(row.get([0]));
|
rcmail.file_list.insert_row(row.get([0]));
|
||||||
|
@ -686,7 +685,6 @@ function kolab_files_ui()
|
||||||
if (!params)
|
if (!params)
|
||||||
params = {};
|
params = {};
|
||||||
|
|
||||||
params.folder = this.env.folder;
|
|
||||||
params.token = this.env.token;
|
params.token = this.env.token;
|
||||||
params.file = file;
|
params.file = file;
|
||||||
|
|
||||||
|
@ -697,7 +695,7 @@ function kolab_files_ui()
|
||||||
this.file_delete = function(files)
|
this.file_delete = function(files)
|
||||||
{
|
{
|
||||||
this.req = this.set_busy(true, 'kolab_files.filedeleting');
|
this.req = this.set_busy(true, 'kolab_files.filedeleting');
|
||||||
this.get('file_delete', {folder: this.env.folder, file: files}, 'file_delete_response');
|
this.get('file_delete', {file: files}, 'file_delete_response');
|
||||||
};
|
};
|
||||||
|
|
||||||
// file(s) delete response handler
|
// file(s) delete response handler
|
||||||
|
|
|
@ -608,7 +608,6 @@ class kolab_files_engine
|
||||||
*/
|
*/
|
||||||
protected function action_attach_file()
|
protected function action_attach_file()
|
||||||
{
|
{
|
||||||
$folder = rcube_utils::get_input_value('folder', rcube_utils::INPUT_POST);
|
|
||||||
$files = rcube_utils::get_input_value('files', rcube_utils::INPUT_POST);
|
$files = rcube_utils::get_input_value('files', rcube_utils::INPUT_POST);
|
||||||
$uploadid = rcube_utils::get_input_value('uploadid', rcube_utils::INPUT_POST);
|
$uploadid = rcube_utils::get_input_value('uploadid', rcube_utils::INPUT_POST);
|
||||||
$COMPOSE_ID = rcube_utils::get_input_value('id', rcube_utils::INPUT_POST);
|
$COMPOSE_ID = rcube_utils::get_input_value('id', rcube_utils::INPUT_POST);
|
||||||
|
@ -648,7 +647,7 @@ class kolab_files_engine
|
||||||
|
|
||||||
// get file information
|
// get file information
|
||||||
try {
|
try {
|
||||||
$url->setQueryVariables(array('method' => 'file_info', 'folder' => $folder, 'file' => $file));
|
$url->setQueryVariables(array('method' => 'file_info', 'file' => $file));
|
||||||
$request->setUrl($url);
|
$request->setUrl($url);
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
$status = $response->getStatus();
|
$status = $response->getStatus();
|
||||||
|
@ -676,7 +675,7 @@ class kolab_files_engine
|
||||||
|
|
||||||
// download file
|
// download file
|
||||||
try {
|
try {
|
||||||
$url->setQueryVariables(array('method' => 'file_get', 'folder' => $folder, 'file' => $file));
|
$url->setQueryVariables(array('method' => 'file_get', 'file' => $file));
|
||||||
$request->setUrl($url);
|
$request->setUrl($url);
|
||||||
$request->attach($observer);
|
$request->attach($observer);
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
|
|
Loading…
Add table
Reference in a new issue