Allow forcing of export to file, it makes no sense to display PDF in textarea ;-).

This commit is contained in:
Michal Čihař
2006-04-26 19:16:52 +00:00
parent 6e72b1c708
commit 0afc370aa7
8 changed files with 24 additions and 5 deletions

View File

@@ -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 <cybot_tm@users.sourceforge.net>
* themes/*:

View File

@@ -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
*/

View File

@@ -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'),

View File

@@ -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'),

View File

@@ -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'),

View File

@@ -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'),

View File

@@ -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'),

View File

@@ -158,8 +158,11 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
$ret .= '<!-- ' . $plugin_name . ' -->' . "\n";
$ret .= '<input type="radio" name="' . $name . '" value="' . $plugin_name . '"'
. ' id="radio_plugin_' . $plugin_name . '"'
. ' onclick="if(this.checked) { hide_them_all();'
.' document.getElementById(\'' . $plugin_name . '_options\').style.display = \'block\'; };'
. ' onclick="if(this.checked) { hide_them_all();';
if (isset($val['force_file'])) {
$ret .= 'document.getElementById(\'checkbox_dump_asfile\').checked = true;';
}
$ret .= ' document.getElementById(\'' . $plugin_name . '_options\').style.display = \'block\'; };'
.' return true"'
. PMA_pluginIsActive($section, $cfgname, $plugin_name) . '/>' . "\n";
$ret .= '<label for="radio_plugin_' . $plugin_name . '">'
@@ -322,6 +325,9 @@ function PMA_pluginGetJavascript(&$list) {
';
foreach ($list as $plugin_name => $val) {
$ret .= 'if (document.getElementById("radio_plugin_' . $plugin_name . '").checked) {' . "\n";
if (isset($val['force_file'])) {
$ret .= 'document.getElementById(\'checkbox_dump_asfile\').checked = true;' . "\n";
}
$ret .= 'document.getElementById("' . $plugin_name . '_options").style.display = "block";' . "\n";
$ret .= ' } else ' . "\n";
}