From c6f540be72f961fee6424f7ead020037072b0a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 24 Jun 2005 12:17:07 +0000 Subject: [PATCH] Configurable file name templates (RFE #1226941). --- ChangeLog | 3 +++ config.inc.php | 3 +++ libraries/common.lib.php | 2 +- libraries/config_import.lib.php | 9 +++++++++ libraries/display_export.lib.php | 6 +++--- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c0b28614..c35543a88 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ $Source$ 2005-06-24 Michal Čihař * tbl_change.php, tbl_properties_links.php, libraries/export/sql.php: Remove error reporting. + * config.inc.php, libraries/common.lib.php, + libraries/config_import.lib.php, libraries/display_export.lib.php: + Configurable file name templates (RFE #1226941). 2005-06-24 Marc Delisle * db_operations.php: problem renaming a db diff --git a/config.inc.php b/config.inc.php index 625af30c6..0df061550 100644 --- a/config.inc.php +++ b/config.inc.php @@ -323,6 +323,9 @@ $cfg['Export']['asfile'] = FALSE; $cfg['Export']['onserver'] = FALSE; $cfg['Export']['onserver_overwrite'] = FALSE; $cfg['Export']['remember_file_template'] = TRUE; +$cfg['Export']['file_template_table'] = '__TABLE__'; +$cfg['Export']['file_template_database'] = '__DB__'; +$cfg['Export']['file_template_server'] = '__SERVER__'; $cfg['Export']['htmlexcel_columns'] = FALSE; $cfg['Export']['htmlexcel_null'] = 'NULL'; diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 847fe8a43..65f54c775 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -142,7 +142,7 @@ if (isset($cfg['FileRevision'])) { } else { $cfg['FileRevision'] = array(1, 1); } -if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 52)) { +if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 56)) { require_once('./libraries/config_import.lib.php'); } diff --git a/libraries/config_import.lib.php b/libraries/config_import.lib.php index ad808324b..6679f5653 100644 --- a/libraries/config_import.lib.php +++ b/libraries/config_import.lib.php @@ -1135,6 +1135,15 @@ if (!isset($cfg['Export']['onserver_overwrite'])) { if (!isset($cfg['Export']['remember_file_template'])) { $cfg['Export']['remember_file_template'] = TRUE; } +if (!isset($cfg['Export']['file_template_table'])) { + $cfg['Export']['file_template_table'] = '__TABLE__'; +} +if (!isset($cfg['Export']['file_template_database'])) { + $cfg['Export']['file_template_database'] = '__DB__'; +} +if (!isset($cfg['Export']['file_template_server'])) { + $cfg['Export']['file_template_server'] = '__SERVER__'; +} if (!isset($cfg['Export']['csv_null'])) { $cfg['Export']['csv_null'] = 'NULL'; } diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 90b1d8a1b..12ce9b87f 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -659,19 +659,19 @@ if (isset($table) && !empty($table) && !isset($num_tables)) { if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) { echo $_COOKIE['pma_db_filename_template']; } else { - echo '__DB__'; + echo $GLOBALS['cfg']['Export']['file_template_database']; } } elseif ($export_type == 'table') { if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) { echo $_COOKIE['pma_table_filename_template']; } else { - echo '__TABLE__'; + echo $GLOBALS['cfg']['Export']['file_template_table']; } } else { if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) { echo $_COOKIE['pma_server_filename_template']; } else { - echo '__SERVER__'; + echo $GLOBALS['cfg']['Export']['file_template_server']; } } echo '" ';