mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
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:
parent
011120e5e0
commit
1ba722b8d1
1 changed files with 14 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue