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

@@ -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";
}