document merge helper function to allow download by HTTP POST request

This commit is contained in:
Christian Binder 2012-09-29 10:16:39 +00:00
parent bf66b8348f
commit 2fbf1d36e8
3 changed files with 27 additions and 1 deletions

View File

@ -23,7 +23,8 @@ class calendar_merge extends bo_merge
* @var array
*/
var $public_functions = array(
'show_replacements' => true,
'download_by_request' => true,
'show_replacements' => true,
);
// Object for getting calendar info

View File

@ -1452,6 +1452,30 @@ abstract class bo_merge
}
common::egw_exit();
}
/**
* Download document merged with contact(s)
* frontend for HTTP POST requests
* accepts POST vars and calls internal function download()
* string data_document_name: the document name
* string data_document_dir: the document vfs directory
* string data_checked: contact id(s) to merge with (can be comma separated)
*
* @return string with error-message on error, otherwise it does NOT return
*/
public function download_by_request()
{
if(empty($_POST['data_document_name'])) return false;
if(empty($_POST['data_document_dir'])) return false;
if(empty($_POST['data_checked'])) return false;
return $this->download(
$_POST['data_document_name'],
explode(',',$_POST['data_checked']),
'',
$_POST['data_document_dir']
);
}
/**
* Get a list of document actions / files from the given directory

View File

@ -23,6 +23,7 @@ class infolog_merge extends bo_merge
* @var array
*/
var $public_functions = array(
'download_by_request' => true,
'show_replacements' => true,
);