diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php index 3d87ec54b..0119ec3ce 100644 --- a/classes/module/ModuleObject.class.php +++ b/classes/module/ModuleObject.class.php @@ -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; + } + } } /**