1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/14262] Move convertor to controller

PHPBB3-14262
This commit is contained in:
Mate Bartus
2015-10-28 15:00:11 +01:00
parent 10756f3f87
commit a649768e17
17 changed files with 3082 additions and 3 deletions

View File

@@ -236,6 +236,22 @@
}
}
// Redirects user
function redirect(url, use_ajax) {
if (use_ajax) {
resetPolling();
var xhReq = createXhrObject();
xhReq.open('GET', url, true);
xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhReq.send();
startPolling(xhReq);
} else {
window.location.href = url;
}
}
/**
* Parse messages from the response object
*
@@ -302,6 +318,10 @@
if (responseObject.hasOwnProperty('refresh')) {
refreshRequested = true;
}
if (responseObject.hasOwnProperty('redirect')) {
redirect(responseObject.redirect.url, responseObject.redirect.use_ajax);
}
}
/**