From 21a073a2c930c6cc66274575a61e98a017d0ac1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 25 Jun 2003 18:15:24 +0000 Subject: [PATCH] Support for exporting any query into CSV/LaTeX/XML. --- ChangeLog | 2 ++ libraries/display_export.lib.php3 | 42 +++++++++++++++++++++++++------ sql.php3 | 16 ++++++++---- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 379c8b370..8f88cbd26 100755 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ $Source$ * lang/czech: Updated. * lang/*: Removed duplicate strReset. * lang/check_lang.sh: Ignore japanese specific messages. + * sql.php3, libraries/display_export.lib.php3: Support for exporting any + query into CSV/LaTeX/XML. 2003-06-24 Marc Delisle * sql.php3, bug 759568, row count, DISTINCT and MySQL 4 diff --git a/libraries/display_export.lib.php3 b/libraries/display_export.lib.php3 index 488024c59..32759992a 100644 --- a/libraries/display_export.lib.php3 +++ b/libraries/display_export.lib.php3 @@ -21,12 +21,18 @@ function PMA_exportIsActive($what, $val) { ?>
'; @@ -41,7 +47,9 @@ if (isset($sql_query)) { getElement("csv_options").style.display = 'none'; getElement("excel_options").style.display = 'none'; getElement("latex_options").style.display = 'none'; + getElement("sql_options").style.display = 'none'; + getElement("none_options").style.display = 'none'; } //--> @@ -61,10 +69,12 @@ if (isset($sql_query)) { } ?> + />

+ /> @@ -88,6 +98,7 @@ if (isset($sql_query)) { +
() @@ -105,6 +116,7 @@ if ($export_type == 'server') { +
@@ -148,11 +160,12 @@ if ($cfgRelation['mimework']) { ?>
+
- onclick="if(!this.checked && !getElement('checkbox_sql_structure').checked) return false; else return true;" /> + onclick="if(!this.checked && (!getElement('checkbox_sql_structure') || !getElement('checkbox_sql_structure').checked)) return false; else return true;" />
/> @@ -161,11 +174,13 @@ if ($cfgRelation['mimework']) {
+
+
@@ -195,11 +210,12 @@ if ($cfgRelation['mimework']) { } // end MIME ?>
+
- onclick="if(!this.checked && !getElement('checkbox_latex_structure').checked) return false; else return true;" /> + onclick="if(!this.checked && (!getElement('checkbox_latex_structure') || !getElement('checkbox_latex_structure').checked)) return false; else return true;" />
/> @@ -291,16 +307,26 @@ if ($cfgRelation['mimework']) { diff --git a/sql.php3 b/sql.php3 index b79f7e394..6ea89e67e 100755 --- a/sql.php3 +++ b/sql.php3 @@ -666,11 +666,17 @@ else { // Export link, if only one table // (the url_query has extra parameters that won't be used to export) - if (!isset($printview) - && isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) - && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) { - echo ' ' . "\n" - . ' ' . $strExport . '' . "\n"; + if (!isset($printview)) { + if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) { + $single_table = '&single_table=true'; + } else { + $single_table = ''; + } + echo ' ' . "\n" + . ' ' . $strExport . '' . "\n"; } // Bookmark Support if required