]> git.joonet.de Git - adminer.git/commitdiff
Customizable export filename
authorJakub Vrana <jakub@vrana.cz>
Fri, 29 Jun 2012 19:25:05 +0000 (12:25 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 29 Jun 2012 19:25:05 +0000 (12:25 -0700)
adminer/include/adminer.inc.php
adminer/include/functions.inc.php
changes.txt
editor/include/adminer.inc.php

index 868deb787fc61ee9af59b3157d4cf9d0a32c2df7..db65137016864c6bf51880cf6c877acb60a8118d 100644 (file)
@@ -730,6 +730,9 @@ DROP PROCEDURE adminer_alter;
                        ($ext == "tar" ? "application/x-tar" :
                        ($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
                ))));
+               if ($output != "text") {
+                       header("Content-Disposition: attachment; filename=" . friendly_url($identifier != "" ? $identifier : (SERVER != "" ? SERVER : "localhost")) . ".$ext" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
+               }
                if ($output == "bz2") {
                        ob_start('bzcompress', 1e6);
                }
index e86be6275d6acac0edd8a30271c0de18e817de3a..47651339308bd7e45731e0b7adf167e7ae7e3125 100644 (file)
@@ -803,10 +803,6 @@ function search_tables() {
 function dump_headers($identifier, $multi_table = false) {
        global $adminer;
        $return = $adminer->dumpHeaders($identifier, $multi_table);
-       $output = $_POST["output"];
-       if ($output != "text") {
-               header("Content-Disposition: attachment; filename=" . friendly_url($identifier != "" ? $identifier : (SERVER != "" ? SERVER : "localhost")) . ".$return" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
-       }
        session_write_close();
        return $return;
 }
index 9a1fcb5e8a78a412e1a3a21df00498de8d649376..a4d16e1656f28907da5d4d37741ae2f9cef9ca65 100644 (file)
@@ -14,6 +14,7 @@ PostgreSQL: improve PDO support in SQL command
 Oracle: schema, processlist, table overview numbers
 Simplify work with NULL values (customization)
 Use namespace in login form (customization)
+Customizable export filename (customization)
 Replace JSMin by better JavaScript minifier
 Don't use AJAX links and forms
 Indonesian translation
index 1fc4157436c7d6bd5d7cfe1622aae30eb6f77422..f99e45f2efc261f1914c23b9b4607053f6435445 100644 (file)
@@ -508,6 +508,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
        function dumpHeaders($identifier, $multi_table = false) {
                $ext = "csv";
                header("Content-Type: text/csv; charset=utf-8");
+               header("Content-Disposition: attachment; filename=" . friendly_url($identifier) . ".$ext");
                return $ext;
        }