Add external links for tasks with plugin api

This commit is contained in:
Frederic Guillot
2016-01-30 20:38:20 -05:00
parent ec66a779c9
commit 5c92f46786
81 changed files with 2544 additions and 75 deletions

View File

@@ -68,11 +68,12 @@ class Response extends Base
*
* @access public
* @param string $url Redirection URL
* @param boolean $self If Ajax request and true: refresh the current page
*/
public function redirect($url)
public function redirect($url, $self = false)
{
if ($this->request->getServerVariable('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest') {
header('X-Ajax-Redirect: '.$url);
header('X-Ajax-Redirect: '.($self ? 'self' : $url));
} else {
header('Location: '.$url);
}