mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 20:44:28 +09:00
Improve backward compatibility with AXUpload5 and other third-party AJAX apps
This commit is contained in:
parent
8ee5e8c4b0
commit
3a419d586d
5 changed files with 33 additions and 15 deletions
|
|
@ -232,6 +232,7 @@ class Context
|
||||||
$this->setRequestMethod('');
|
$this->setRequestMethod('');
|
||||||
|
|
||||||
$this->_setXmlRpcArgument();
|
$this->_setXmlRpcArgument();
|
||||||
|
$this->_setJSONRequestArgument();
|
||||||
$this->_setRequestArgument();
|
$this->_setRequestArgument();
|
||||||
$this->_setUploadedArgument();
|
$this->_setUploadedArgument();
|
||||||
|
|
||||||
|
|
@ -1386,7 +1387,16 @@ class Context
|
||||||
*/
|
*/
|
||||||
private function _setJSONRequestArgument()
|
private function _setJSONRequestArgument()
|
||||||
{
|
{
|
||||||
|
if(count($_POST) || self::getRequestMethod() != 'JSON')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$params = array();
|
||||||
|
parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $params);
|
||||||
|
foreach($params as $key => $val)
|
||||||
|
{
|
||||||
|
self::set($key, $this->_filterRequestVar($key, $val, 1), TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,10 @@ class DisplayHandler extends Handler
|
||||||
{
|
{
|
||||||
if(Context::getResponseMethod() == 'JSON' || Context::getResponseMethod() == 'JS_CALLBACK')
|
if(Context::getResponseMethod() == 'JSON' || Context::getResponseMethod() == 'JS_CALLBACK')
|
||||||
{
|
{
|
||||||
self::_printJSONHeader();
|
if(strpos($_SERVER['HTTP_ACCEPT'], 'json') !== false)
|
||||||
|
{
|
||||||
|
self::_printJSONHeader();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(Context::getResponseMethod() != 'HTML')
|
else if(Context::getResponseMethod() != 'HTML')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,9 @@
|
||||||
|
|
||||||
$.exec_json('file.getFileList', obj, function(res){
|
$.exec_json('file.getFileList', obj, function(res){
|
||||||
data.uploadTargetSrl = res.upload_target_srl;
|
data.uploadTargetSrl = res.upload_target_srl;
|
||||||
editorRelKeys[data.editorSequence].primary.value = res.upload_target_srl;
|
if(editorRelKeys[data.editorSequence]) {
|
||||||
|
editorRelKeys[data.editorSequence].primary.value = res.upload_target_srl;
|
||||||
|
}
|
||||||
data.uploadTargetSrl = res.uploadTargetSrl;
|
data.uploadTargetSrl = res.uploadTargetSrl;
|
||||||
|
|
||||||
// @TODO 정리
|
// @TODO 정리
|
||||||
|
|
|
||||||
|
|
@ -239,21 +239,23 @@ function xml2json(xml, tab, ignoreAttrib) {
|
||||||
// 전송 성공시
|
// 전송 성공시
|
||||||
function onsuccess(data, textStatus, xhr) {
|
function onsuccess(data, textStatus, xhr) {
|
||||||
waiting_obj.css('display', 'none').trigger('cancel_confirm');
|
waiting_obj.css('display', 'none').trigger('cancel_confirm');
|
||||||
var ret = [];
|
var ret = {};
|
||||||
var tags = {};
|
|
||||||
|
|
||||||
$.each(response_tags, function(key, val){ tags[val] = true; });
|
$.each(data, function(key, val) {
|
||||||
tags.redirect_url = true;
|
if(key == "act" || key == "redirect_url" || $.inArray(key, response_tags)) {
|
||||||
tags.act = true;
|
if($.isArray(val)) {
|
||||||
$.each(data, function(key, val){ if(tags[key]) ret[key] = val; });
|
ret[key] = { item: val };
|
||||||
|
} else {
|
||||||
if(ret.error != '0') {
|
ret[key] = val;
|
||||||
if ($.isFunction($.exec_xml.onerror)) {
|
}
|
||||||
return $.exec_xml.onerror(module, act, ret, callback_func, response_tags, callback_func_arg, fo_obj);
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
alert( (ret.message || 'An unknown error occured while loading ['+module+'.'+act+']').replace(/\\n/g, '\n') );
|
if(data.error != 0) {
|
||||||
|
if ($.isFunction($.exec_xml.onerror)) {
|
||||||
|
return $.exec_xml.onerror(module, act, data, callback_func, response_tags, callback_func_arg, fo_obj);
|
||||||
|
}
|
||||||
|
alert( (data.message || 'An unknown error occured while loading ['+module+'.'+act+']').replace(/\\n/g, '\n') );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ class fileModel extends file
|
||||||
{
|
{
|
||||||
$tmp_files = $this->getFiles($upload_target_srl);
|
$tmp_files = $this->getFiles($upload_target_srl);
|
||||||
$file_count = count($tmp_files);
|
$file_count = count($tmp_files);
|
||||||
|
$files = array();
|
||||||
|
|
||||||
for($i=0;$i<$file_count;$i++)
|
for($i=0;$i<$file_count;$i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue