]> git.joonet.de Git - adminer.git/commitdiff
Modify dump link in AJAX
authorJakub Vrana <jakub@vrana.cz>
Wed, 29 Dec 2010 17:09:04 +0000 (18:09 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 30 Dec 2010 09:58:26 +0000 (10:58 +0100)
adminer/include/adminer.inc.php
adminer/static/functions.js

index a6347bc32c30795b6bf972b45bfefb6c6e73fd34..18fe8896df450c4a101a35f6299d94e22649d667 100644 (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";
                                }
                        }
                        ?>
index e8fb4c2111dba7589a7d2b9d4f43a46262c3b49c..9307f0f0040a3174694afd3e5ecaee04ca8b32f8 100644 (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);