isseu 2112 improve setRedirectUrl method

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10829 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-07-04 06:07:27 +00:00
parent 011120e5e0
commit 1ba722b8d1

View file

@ -28,6 +28,7 @@
var $stop_proc = false; ///< a flag to indicating whether to stop the execution of code.
var $module_config = NULL;
var $ajaxRequestMethod = array('XMLRPC', 'JSON');
/**
* setter to set the name of module
@ -54,8 +55,19 @@
* @remark redirect_url is used only for ajax requests
* @return void
**/
function setRedirectUrl($url='./') {
$this->add('redirect_url', $url);
function setRedirectUrl($url='./', $output = NULL) {
$ajaxRequestMethod = array_flip($this->ajaxRequestMethod);
if(!isset($ajaxRequestMethod[Context::getRequestMethod()]))
{
$this->add('redirect_url', $url);
}
else
{
if($output !== NULL && is_object($output))
{
return $output;
}
}
}
/**