diff --git a/ChangeLog b/ChangeLog index 03f3c4290..19e36cd75 100755 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,9 @@ $Source$ libraries/config.default.php, lang/*: Export to OASIS OpenDocument Spreadsheet (RFE #1068007). * lang/czech: Update. + * export.php, libraries/plugin_interface.lib.php, libraries/export/*: + Allow forcing of export to file, it makes no sense to display PDF in + textarea ;-). 2006-04-26 Sebastian Mendel * themes/*: diff --git a/export.php b/export.php index c29e3cc5f..96a5adb8e 100644 --- a/export.php +++ b/export.php @@ -22,10 +22,12 @@ if (!isset($export_list[$type])) { die('Bad type!'); } -// Get the functions specific to the export type -require('./libraries/export/' . PMA_securePath($type) . '.php'); +// Does export require to be into file? +if (isset($export_list[$type]['force_file']) && ! isset($asfile)) { + die('Must be as file!'); +} -// Generate error url +// Generate error url and check for needed variables if ($export_type == 'server') { $err_url = 'server_export.php?' . PMA_generate_common_url(); } elseif ($export_type == 'database' && isset($db) && strlen($db)) { @@ -36,6 +38,9 @@ if ($export_type == 'server') { die('Bad parameters!'); } +// Get the functions specific to the export type +require('./libraries/export/' . PMA_securePath($type) . '.php'); + /** * Increase time limit for script execution and initializes some variables */ diff --git a/libraries/export/htmlexcel.php b/libraries/export/htmlexcel.php index 317db3e80..750265b24 100644 --- a/libraries/export/htmlexcel.php +++ b/libraries/export/htmlexcel.php @@ -11,6 +11,7 @@ if (isset($plugin_list)) { 'text' => 'strHTMLExcel', 'extension' => 'xsl', 'mime_type' => 'application/vnd.ms-excel', + 'force_file' => true, 'options' => array( array('type' => 'text', 'name' => 'null', 'text' => 'strReplaceNULLBy'), array('type' => 'bool', 'name' => 'columns', 'text' => 'strPutColNames'), diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 84b1ac301..01422ecae 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -11,6 +11,7 @@ if (isset($plugin_list)) { 'text' => 'strHTMLWord', 'extension' => 'doc', 'mime_type' => 'application/vnd.ms-word', + 'force_file' => true, 'options' => array( array('type' => 'bool', 'name' => 'structure', 'text' => 'strStructure', 'force' => 'data'), array('type' => 'bgroup', 'name' => 'data', 'text' => 'strData', 'force' => 'structure'), diff --git a/libraries/export/ods.php b/libraries/export/ods.php index c522e3cb5..d36ac3f61 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -11,6 +11,7 @@ if (isset($plugin_list)) { 'text' => 'strOpenDocumentSpreadsheet', 'extension' => 'ods', 'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet', + 'force_file' => true, 'options' => array( array('type' => 'text', 'name' => 'null', 'text' => 'strReplaceNULLBy'), array('type' => 'bool', 'name' => 'columns', 'text' => 'strPutColNames'), diff --git a/libraries/export/pdf.php b/libraries/export/pdf.php index 90f386cb3..afd30853d 100644 --- a/libraries/export/pdf.php +++ b/libraries/export/pdf.php @@ -11,6 +11,7 @@ if (isset($plugin_list)) { 'text' => 'strPDF', 'extension' => 'pdf', 'mime_type' => 'application/pdf', + 'force_file' => true, 'options' => array( array('type' => 'text', 'name' => 'report_title', 'text' => 'strPDFReportTitle'), array('type' => 'hidden', 'name' => 'data'), diff --git a/libraries/export/xls.php b/libraries/export/xls.php index 345239e42..7e91c20ea 100644 --- a/libraries/export/xls.php +++ b/libraries/export/xls.php @@ -21,6 +21,7 @@ if ($xls) { 'text' => 'strStrucNativeExcel', 'extension' => 'xls', 'mime_type' => 'application/vnd.ms-excel', + 'force_file' => true, 'options' => array( array('type' => 'text', 'name' => 'null', 'text' => 'strReplaceNULLBy'), array('type' => 'text', 'name' => 'columns', 'text' => 'strPutColNames'), diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index 80fea0216..1cdee3afb 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -158,8 +158,11 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) $ret .= '' . "\n"; $ret .= '' . "\n"; $ret .= '