Modify dump link in AJAX

This commit is contained in:
Jakub Vrana 2010-12-29 18:09:04 +01:00
parent 61b1fd57e0
commit 29d7d6ce52
2 changed files with 7 additions and 2 deletions

View file

@ -719,7 +719,7 @@ DROP PROCEDURE adminer_alter;
if (DB == "" || !$missing) {
echo "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "</a>\n";
if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n";
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n";
}
}
?>

View file

@ -258,7 +258,12 @@ function ajaxSend(url, data) {
as[i].className = '';
}
}
//! modify Export link and Change database hidden fields
var dump = document.getElementById('dump');
if (dump) {
var match = /&(select|table)=([^&]+)/.exec(href);
dump.href = dump.href.replace(/[^=]+$/, '') + (match ? match[2] : '');
}
//! modify Change database hidden fields
if (window.jush) {
jush.highlight_tag('code', 0);