js/ajax.js: post with ajax

This commit is contained in:
Michael Foster 2013-09-15 14:03:27 +10:00
parent fd5300a49e
commit 00833eeafd
5 changed files with 119 additions and 2 deletions

View file

@ -743,7 +743,15 @@ if (isset($_POST['delete'])) {
else
rebuildThemes('post', $board['uri']);
header('Location: ' . $redirect, true, $config['redirect_http']);
if (!isset($_POST['json_response'])) {
header('Location: ' . $redirect, true, $config['redirect_http']);
} else {
header('Content-Type: text/json; charset=utf-8');
echo json_encode(array(
'redirect' => $redirect,
'id' => $id
));
}
} else {
if (!file_exists($config['has_installed'])) {
header('Location: install.php', true, $config['redirect_http']);