mirror of
https://github.com/vrana/adminer.git
synced 2025-08-17 20:01:25 +02:00
Full AJAX only with pushState to work correctly with history
This commit is contained in:
@@ -130,7 +130,7 @@ document.getElementById('username').focus();
|
||||
*/
|
||||
function selectQuery($query) {
|
||||
global $jush;
|
||||
return "<p><a href='" . h(remove_from_uri("page")) . "&page=last' title='" . lang('Page') . ": " . lang('last') . "' onclick='return !ajaxMain(this.href, undefined, event);'>>></a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" . (is_ajax() ? " <a href='" . h($_SERVER["REQUEST_URI"]) . "'>#</a>" : "") . "\n";
|
||||
return "<p><a href='" . h(remove_from_uri("page")) . "&page=last' title='" . lang('Page') . ": " . lang('last') . "' onclick='return !ajaxMain(this.href, undefined, event);'>>></a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
|
||||
}
|
||||
|
||||
/** Description of a row in a table
|
||||
|
@@ -361,10 +361,14 @@ function redirect($location, $message = null) {
|
||||
$_SESSION["messages"][] = $message;
|
||||
}
|
||||
if (isset($location)) {
|
||||
if ($location == "") {
|
||||
$location = ".";
|
||||
}
|
||||
if (!is_ajax()) {
|
||||
header("Location: " . ($location != "" ? $location : "."));
|
||||
header("Location: $location");
|
||||
exit;
|
||||
}
|
||||
header("X-AJAX-Redirect: $location");
|
||||
$_POST = array();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user