1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 12:21:24 +02:00

Report offline and other AJAX errors (bug #419)

This commit is contained in:
Jakub Vrana
2014-09-14 14:46:54 -07:00
parent a987a2a4de
commit 37c8a3a123
6 changed files with 31 additions and 13 deletions

View File

@@ -9,6 +9,10 @@
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $LANG, $VERSION, $adminer, $drivers, $jush;
page_headers();
if (is_ajax() && $error) {
page_messages($error);
exit;
}
$title_all = $title . ($title2 != "" ? ": $title2" : "");
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
?>
@@ -32,6 +36,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " onload=\"verifyVersion('$VERSION');\""); ?>>
<script type="text/javascript">
document.body.className = document.body.className.replace(/ nojs/, ' js');
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
</script>
<div id="help" class="jush-<?php echo $jush; ?> jsonly hidden" onmouseover="helpOpen = 1;" onmouseout="helpMouseout(this, event);"></div>
@@ -65,6 +70,7 @@ document.body.className = document.body.className.replace(/ nojs/, ' js');
}
}
echo "<h2>$title_all</h2>\n";
echo "<div id='ajaxstatus' class='jsonly hidden'></div>\n";
restart_session();
page_messages($error);
$databases = &get_session("dbs");

View File

@@ -1307,7 +1307,6 @@ function edit_form($TABLE, $fields, $row, $update) {
echo "<p class='error'>" . lang('No rows.') . "\n";
}
?>
<div id="message"></div>
<form action="" method="post" enctype="multipart/form-data" id="form">
<?php
if (!$fields) {