diff --git a/db_export.php b/db_export.php index 718a489d8..32971ab5f 100644 --- a/db_export.php +++ b/db_export.php @@ -16,6 +16,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'export.js'; + // $sub_part is also used in db_info.inc.php to see if we are coming from // db_export.php, in which case we don't obey $cfg['MaxTableList'] $sub_part = '_export'; @@ -39,12 +41,12 @@ $checkall_url = 'db_export.php?' . PMA_generate_common_url($db) . '&goto=db_export.php'; -$multi_values = '
'; +$multi_values = '
'; $multi_values .= '' . __('Select All') . ' / ' . __('Unselect All') . '
'; -$multi_values .= ''; $multi_values .= "\n"; if (!empty($selected_tbl) && empty($table_select)) { @@ -65,7 +67,7 @@ foreach ($tables as $each_table) { } // end for $multi_values .= "\n"; -$multi_values .= '

'; +$multi_values .= '
'; $export_type = 'database'; require_once './libraries/display_export.lib.php'; diff --git a/db_import.php b/db_import.php index bdcd5d698..6e8e554ac 100644 --- a/db_import.php +++ b/db_import.php @@ -11,6 +11,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'import.js'; + /** * Gets tables informations and displays top links */ diff --git a/export.php b/export.php index 5d487a107..ae7a5662a 100644 --- a/export.php +++ b/export.php @@ -42,7 +42,7 @@ $compression = false; $onserver = false; $save_on_server = false; $buffer_needed = false; -if (empty($_REQUEST['asfile'])) { +if ($_REQUEST['output_format'] == 'astext') { $asfile = false; } else { $asfile = true; @@ -56,7 +56,6 @@ if (empty($_REQUEST['asfile'])) { $save_on_server = ! empty($cfg['SaveDir']) && $onserver; } } - // Does export require to be into file? if (isset($export_list[$type]['force_file']) && ! $asfile) { $message = PMA_Message::error(__('Selected export type has to be saved in file!')); @@ -390,7 +389,7 @@ if (!PMA_exportHeader()) { // Will we need relation & co. setup? $do_relation = isset($GLOBALS[$what . '_relation']); -$do_comments = isset($GLOBALS[$what . '_comments']); +$do_comments = isset($GLOBALS[$what . '_include_comments']); $do_mime = isset($GLOBALS[$what . '_mime']); if ($do_relation || $do_comments || $do_mime) { require_once './libraries/relation.lib.php'; @@ -431,7 +430,7 @@ if ($export_type == 'server') { if ($is_view) { $views[] = $table; } - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { // for a view, export a stand-in definition of the table // to resolve view dependencies if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) { @@ -439,7 +438,7 @@ if ($export_type == 'server') { } } // if this is a view or a merge table, don't export data - if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($current_db, $table))) { + if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($current_db, $table))) { $local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table); if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) { break 3; @@ -447,7 +446,7 @@ if ($export_type == 'server') { } // now export the triggers (needs to be done after the data because // triggers can modify already imported tables) - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) { break 2; } @@ -455,7 +454,7 @@ if ($export_type == 'server') { } foreach($views as $view) { // no data export for a view - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) { break 3; } @@ -480,7 +479,7 @@ if ($export_type == 'server') { if ($is_view) { $views[] = $table; } - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { // for a view, export a stand-in definition of the table // to resolve view dependencies if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) { @@ -488,7 +487,7 @@ if ($export_type == 'server') { } } // if this is a view or a merge table, don't export data - if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($db, $table))) { + if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($db, $table))) { $local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table); if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) { break 2; @@ -496,7 +495,7 @@ if ($export_type == 'server') { } // now export the triggers (needs to be done after the data because // triggers can modify already imported tables) - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) { break 2; } @@ -504,7 +503,7 @@ if ($export_type == 'server') { } foreach ($views as $view) { // no data export for a view - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) { break 2; } diff --git a/js/export.js b/js/export.js new file mode 100644 index 000000000..38419a058 --- /dev/null +++ b/js/export.js @@ -0,0 +1,150 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions used in the export tab + * + * @version $Id$ + */ + + /** + * Toggles the hiding and showing of each plugin's options + * according to the currently selected plugin from the dropdown list + */ + $(document).ready(function() { + $("#plugins").change(function() { + $(".format_specific_options").each(function() { + $(this).hide(); + }); + var selected_plugin_name = $("#plugins option:selected").attr("value"); + $("#" + selected_plugin_name + "_options").show(); + }); +}); + +/** + * Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure + */ +$(document).ready(function() { + $("input[type='radio'][name$='sql_structure_or_data']").change(function() { + var show = $("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value"); + if(show == 'data') { + // disable the SQL comment options + $("#checkbox_sql_dates").parent().fadeTo('fast', 0.4); + $("#checkbox_sql_dates").attr('disabled', 'disabled'); + $("#checkbox_sql_relation").parent().fadeTo('fast', 0.4); + $("#checkbox_sql_relation").attr('disabled', 'disabled'); + $("#checkbox_sql_mime").parent().fadeTo('fast', 0.4); + $("#checkbox_sql_mime").attr('disabled', 'disabled'); + } else { + // enable the SQL comment options + $("#checkbox_sql_dates").parent().fadeTo('fast', 1); + $("#checkbox_sql_dates").removeAttr('disabled'); + $("#checkbox_sql_relation").parent().fadeTo('fast', 1); + $("#checkbox_sql_relation").removeAttr('disabled'); + $("#checkbox_sql_mime").parent().fadeTo('fast', 1); + $("#checkbox_sql_mime").removeAttr('disabled'); + } + }); +}); + + +/** + * Toggles the hiding and showing of plugin structure-specific and data-specific + * options + */ +$(document).ready(function() { + function toggleStructureAndDataOpts(pluginName) { + var radioFormName = pluginName + "_structure_or_data"; + var dataDiv = "#" + pluginName + "_data"; + var structureDiv = "#" + pluginName + "_structure"; + var show = $("input[type='radio'][name='" + radioFormName + "']:checked").attr("value"); + if(show == 'data') { + $(dataDiv).slideDown('slow'); + $(structureDiv).slideUp('slow'); + } else { + $(structureDiv).slideDown('slow'); + if(show == 'structure') { + $(dataDiv).slideUp('slow'); + } else { + $(dataDiv).slideDown('slow'); + } + } + } + $("input[type='radio'][name='latex_structure_or_data']").change(function() { + toggleStructureAndDataOpts("latex"); + }); + $("input[type='radio'][name='odt_structure_or_data']").change(function() { + toggleStructureAndDataOpts("odt"); + }); + $("input[type='radio'][name='texytext_structure_or_data']").change(function() { + toggleStructureAndDataOpts("texytext"); + }); + $("input[type='radio'][name='htmlword_structure_or_data']").change(function() { + toggleStructureAndDataOpts("htmlword"); + }); + $("input[type='radio'][name='sql_structure_or_data']").change(function() { + toggleStructureAndDataOpts("sql"); + }); +}); + +/** + * Toggles the disabling of the "save to file" options + */ +$(document).ready(function() { + $("input[type='radio'][name='output_format']").change(function() { + if($("#radio_dump_asfile:checked").length == 0) { + $("#ul_save_asfile > li").fadeTo('fast', 0.4); + $("#ul_save_asfile > li > input").attr('disabled', 'disabled'); + $("#ul_save_asfile > li> select").attr('disabled', 'disabled'); + } else { + $("#ul_save_asfile > li").fadeTo('fast', 1); + $("#ul_save_asfile > li > input").removeAttr('disabled'); + $("#ul_save_asfile > li> select").removeAttr('disabled'); + } + }); +}); + +/** + * For SQL plugin, toggles the disabling of the "display comments" options + */ +$(document).ready(function() { + $("#checkbox_sql_include_comments").change(function() { + if($("#checkbox_sql_include_comments:checked").length == 0) { + $("#ul_include_comments > li").fadeTo('fast', 0.4); + $("#ul_include_comments > li > input").attr('disabled', 'disabled'); + } else { + $("#ul_include_comments > li").fadeTo('fast', 1); + $("#ul_include_comments > li > input").removeAttr('disabled'); + } + }); +}); + +/** + * For SQL plugin, if "CREATE TABLE options" is checked/uncheck, check/uncheck each of its sub-options + */ +$(document).ready(function() { + $("#checkbox_sql_create_table_statements").change(function() { + if($("#checkbox_sql_create_table_statements:checked").length == 0) { + $("#checkbox_sql_if_not_exists").removeAttr('checked'); + $("#checkbox_sql_auto_increment").removeAttr('checked'); + } else { + $("#checkbox_sql_if_not_exists").attr('checked', 'checked'); + $("#checkbox_sql_auto_increment").attr('checked', 'checked'); + } + }); +}); + +/** + * Disables the view output as text option if the output must be saved as a file + */ +$(document).ready(function() { + $("#plugins").change(function() { + var active_plugin = $("#plugins option:selected").attr("value"); + var force_file = $("#force_file_" + active_plugin).attr("value"); + if(force_file == "true") { + $("#radio_view_as_text").attr('disabled', 'disabled'); + $("#radio_view_as_text").parent().fadeTo('fast', 0.4); + } else { + $("#radio_view_as_text").removeAttr('disabled'); + $("#radio_view_as_text").parent().fadeTo('fast', 1); + } + }); +}); diff --git a/js/import.js b/js/import.js new file mode 100644 index 000000000..303405f29 --- /dev/null +++ b/js/import.js @@ -0,0 +1,65 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions used in the import tab + * + * @version $Id$ + */ + +$(document).ready(function() { + + /** + * Toggles the hiding and showing of each plugin's options + * according to the currently selected plugin from the dropdown list + */ + function changePluginOpts() { + $(".format_specific_options").each(function() { + $(this).hide(); + }); + var selected_plugin_name = $("#plugins option:selected").attr("value"); + $("#" + selected_plugin_name + "_options").fadeIn('slow'); + if(selected_plugin_name == "csv") { + $("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one"); + } else { + $("#import_notification").text(""); + } + } + + /** + * Toggles the hiding and showing of each plugin's options and sets the selected value + * in the plugin dropdown list according to the format of the selected file + */ + function matchFile(fname) { + fname_array = fname.toLowerCase().split("."); + len = fname_array.length; + if(len != 0) { + extension = fname_array[len - 1]; + if (extension == "gz" || extension == "bz2" || extension == "zip") { + len--; + } + $("option:selected").removeAttr("selected"); + switch (fname_array[len - 1]) { + case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break; + case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break; + case "ldi" : $("select[name='format'] option[value='ldi']").attr('selected', 'selected'); break; + case "ods" : $("select[name='format'] option[value='ods']").attr('selected', 'selected'); break; + case "sql" : $("select[name='format'] option[value='sql']").attr('selected', 'selected'); break; + case "xls" : $("select[name='format'] option[value='xls']").attr('selected', 'selected'); break; + case "xlsx" : $("select[name='format'] option[value='xlsx']").attr('selected', 'selected'); break; + case "xml" : $("select[name='format'] option[value='xml']").attr('selected', 'selected'); break; + } + changePluginOpts(); + } + } + + $("#plugins").change(function() { + changePluginOpts(); + }); + + $("#input_import_file").change(function() { + matchFile($(this).attr("value")); + }); + + $("#select_local_import_file").change(function() { + matchFile($(this).attr("value")); + }) + }); \ No newline at end of file diff --git a/libraries/config.default.php b/libraries/config.default.php index b2a393275..34af11161 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1130,6 +1130,13 @@ $cfg['Export']['file_template_database'] = '__DB__'; */ $cfg['Export']['file_template_server'] = '__SERVER__'; +/** + * + * + * @global string $cfg['Export']['codegen_structure_or_data'] + */ +$cfg['Export']['codegen_structure_or_data'] = 'data'; + /** * * @@ -1147,16 +1154,9 @@ $cfg['Export']['ods_null'] = 'NULL'; /** * * - * @global boolean $cfg['Export']['odt_structure'] + * @global string $cfg['Export']['odt_structure_or_data'] */ -$cfg['Export']['odt_structure'] = true; - -/** - * - * - * @global boolean $cfg['Export']['odt_data'] - */ -$cfg['Export']['odt_data'] = true; +$cfg['Export']['odt_structure_or_data'] = 'structure_and_data'; /** * @@ -1196,16 +1196,9 @@ $cfg['Export']['odt_null'] = 'NULL'; /** * * - * @global boolean $cfg['Export']['htmlword_structure'] + * @global boolean $cfg['Export']['htmlword_structure_or_data'] */ -$cfg['Export']['htmlword_structure'] = true; - -/** - * - * - * @global boolean $cfg['Export']['htmlword_data'] - */ -$cfg['Export']['htmlword_data'] = true; +$cfg['Export']['htmlword_structure_or_data'] = 'structure_and_data'; /** * @@ -1224,16 +1217,9 @@ $cfg['Export']['htmlword_null'] = 'NULL'; /** * * - * @global boolean $cfg['Export']['texytext_structure'] + * @global string $cfg['Export']['texytext_structure_or_data'] */ -$cfg['Export']['texytext_structure'] = TRUE; - -/** - * - * - * @global boolean $cfg['Export']['texytext_data'] - */ -$cfg['Export']['texytext_data'] = TRUE; +$cfg['Export']['texytext_structure_or_data'] = 'structure_and_data'; /** * @@ -1256,6 +1242,13 @@ $cfg['Export']['texytext_null'] = 'NULL'; */ $cfg['Export']['xls_columns'] = false; +/** + * + * + * @global string $cfg['Export']['xls_structure_or_data'] + */ +$cfg['Export']['xls_structure_or_data'] = 'data'; + /** * * @@ -1270,6 +1263,13 @@ $cfg['Export']['xls_null'] = 'NULL'; */ $cfg['Export']['xlsx_columns'] = false; +/** + * + * + * @global string $cfg['Export']['xlsx_structure_or_data'] + */ +$cfg['Export']['xlsx_structure_or_data'] = 'data'; + /** * * @@ -1284,6 +1284,13 @@ $cfg['Export']['xlsx_null'] = 'NULL'; */ $cfg['Export']['csv_columns'] = false; +/** + * + * + * @global string $cfg['Export']['csv_structure_or_data'] + */ +$cfg['Export']['csv_structure_or_data'] = 'data'; + /** * * @@ -1343,16 +1350,16 @@ $cfg['Export']['excel_edition'] = 'win'; /** * * - * @global boolean $cfg['Export']['latex_structure'] + * @global string $cfg['Export']['excel_structure_or_data'] */ -$cfg['Export']['latex_structure'] = true; +$cfg['Export']['excel_structure_or_data'] = 'data'; /** * * - * @global boolean $cfg['Export']['latex_data'] + * @global string $cfg['Export']['latex_structure_or_data'] */ -$cfg['Export']['latex_data'] = true; +$cfg['Export']['latex_structure_or_data'] = 'structure_and_data'; /** * @@ -1441,16 +1448,37 @@ $cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure'; /** * * - * @global boolean $cfg['Export']['sql_structure'] + * @global string $cfg['Export']['mediawiki_structure_or_data'] */ -$cfg['Export']['sql_structure'] = true; +$cfg['Export']['mediawiki_structure_or_data'] = 'data'; /** * * - * @global boolean $cfg['Export']['sql_data'] + * @global string $cfg['Export']['ods_structure_or_data'] */ -$cfg['Export']['sql_data'] = true; +$cfg['Export']['ods_structure_or_data'] = 'data'; + +/** + * + * + * @global string $cfg['Export']['pdf_structure_or_data'] + */ +$cfg['Export']['pdf_structure_or_data'] = 'data'; + +/** + * + * + * @global string $cfg['Export']['php_array_structure_or_data'] + */ +$cfg['Export']['php_array_structure_or_data'] = 'data'; + +/** + * + * + * @global string $cfg['Export']['sql_structure_or_data'] + */ +$cfg['Export']['sql_structure_or_data'] = 'structure_and_data'; /** * @@ -1538,13 +1566,6 @@ $cfg['Export']['sql_dates'] = false; */ $cfg['Export']['sql_relation'] = false; -/** - * - * - * @global boolean $cfg['Export']['sql_columns'] - */ -$cfg['Export']['sql_columns'] = true; - /** * * @@ -1580,13 +1601,6 @@ $cfg['Export']['sql_hex_for_blob'] = true; */ $cfg['Export']['sql_type'] = 'insert'; -/** - * - * - * @global boolean $cfg['Export']['sql_extended'] - */ -$cfg['Export']['sql_extended'] = true; - /** * * @@ -1618,16 +1632,16 @@ $cfg['Export']['sql_header_comment'] = ''; /** * * - * @global boolean $cfg['Export']['pdf_structure'] + * @global boolean $cfg['Export']['sql_create_table_statements'] */ -$cfg['Export']['pdf_structure'] = false; +$cfg['Export']['sql_create_table_statements'] = true; /** + * Whether to use complete inserts, extended inserts, both, or neither * - * - * @global boolean $cfg['Export']['pdf_data'] + * @global string $cfg['Export']['sql_insert_syntax'] */ -$cfg['Export']['pdf_data'] = true; +$cfg['Export']['sql_insert_syntax'] = 'both'; /** * @@ -1636,6 +1650,12 @@ $cfg['Export']['pdf_data'] = true; */ $cfg['Export']['pdf_report_title'] = ''; +/** + * + * + *@global string $cfg['Export']['xml_structure_or_data'] + */ +$cfg['Export']['xml_structure_or_data'] = 'data'; /** * Export schema for each structure * @@ -1685,7 +1705,12 @@ $cfg['Export']['xml_export_views'] = true; */ $cfg['Export']['xml_export_contents'] = true; - +/** + * + * + * @global string $cfg['Export']['yaml_structure_or_data'] + */ +$cfg['Export']['yaml_structure_or_data'] = 'data'; /******************************************************************************* * Import defaults */ diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 54867f503..fef74e062 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -65,204 +65,180 @@ echo '' . if (! empty($sql_query)) { echo '' . "\n"; } -echo PMA_pluginGetJavascript($export_list); ?> -
- - -
- -
-
- - - -
- -
- - -
+
+ ' . __('Database(s):') . ''; + } else if($export_type == 'database') { + echo '

' . __('Table(s):') . '

'; + } + if (! empty($multi_values)) { + echo $multi_values; + } + ?>
-
- -
- -
-
- - -
- '; - - echo sprintf(__('Dump %s row(s) starting at row # %s'), - '', - ' '); - - echo ''; - echo ''; - ?> -
+
+

+ +
-
-
- - /> - - +
+

+ +
- $trans = new PMA_Message; - $trans->addMessage('__SERVER__/'); - $trans->addString(__('server name')); - if ($export_type == 'database' || $export_type == 'table') { - $trans->addMessage('__DB__/'); - $trans->addString(__('database name')); - if ($export_type == 'table') { - $trans->addMessage('__TABLE__/'); - $trans->addString(__('table name')); - } - } +
+

Format:

+ +
- $message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.')); - $message->addParam('', false); - $message->addParam('', false); - $message->addParam($trans); - - echo PMA_showHint($message); - ?> - : - - /> - - ( - /> - - ) - -
- ' - . __('Character set of the file:') . '' . "\n"; - - reset($cfg['AvailableCharsets']); - echo ''; - } // end if - ?> -
- - -
- : - /> - - - /> - - - /> - - - /> - - -
- - - -
+
+

+ +
@@ -270,8 +246,8 @@ if ($is_zip || $is_gzip || $is_bzip) { ?> -
+
-
+ diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index 923d9622d..ebeef87fa 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -120,12 +120,26 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { echo PMA_generate_common_hidden_inputs($db, $table, 1); } echo ' '."\n"; - echo PMA_pluginGetJavascript($import_list); ?> -
- - +
+

File may be compressed (%s) or uncompressed.

A compressed file\'s name must end in .[format].[compression]. Example: .sql.zip

'), implode(", ", $compressions)); + } if ($GLOBALS['is_upload']) { $uid = uniqid(""); @@ -134,13 +148,13 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
- + - + ?>
' . "\n"; - -// zip, gzip and bzip2 encode features - $compressions = __('None'); - - if ($cfg['GZipDump'] && @function_exists('gzopen')) { - $compressions .= ', gzip'; - } - if ($cfg['BZipDump'] && @function_exists('bzopen')) { - $compressions .= ', bzip2'; - } - if ($cfg['ZipDump'] && @function_exists('zip_open')) { - $compressions .= ', zip'; - } - -// We don't have show anything about compression, when no supported - if ($compressions != __('None')) { - echo '
' . "\n"; - printf(__('Imported file compression will be automatically detected from: %s'), $compressions); - echo '
' . "\n"; - } - echo "\n"; ?> -
-
- + +
+

/> -
+
- +
-
+ -
- - '; - echo PMA_pluginGetChoice('Import', 'format', $import_list); - echo ''; +
+

+ +
+
- echo '
'; - echo PMA_pluginGetOptions('Import', $import_list); - echo '
'; - ?> +
+

+ +
-
+ -
+
-
+ diff --git a/libraries/export/codegen.php b/libraries/export/codegen.php index 506240c04..9c829c007 100644 --- a/libraries/export/codegen.php +++ b/libraries/export/codegen.php @@ -32,9 +32,9 @@ if (isset($plugin_list)) { 'text' => 'CodeGen', 'extension' => 'cs', 'mime_type' => 'text/cs', - 'options' => array( - array('type' => 'hidden', 'name' => 'data'), - array('type' => 'select', 'name' => 'format', 'text' => __('Format'), 'values' => $CG_FORMATS), + 'options' => array( + array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/csv.php b/libraries/export/csv.php index e3d78f2b8..dfe9885ad 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -18,14 +18,14 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( - array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated by')), - array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by')), - array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by')), - array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated by')), - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), - array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')), + array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated with:')), + array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:')), + array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:')), + array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated with:')), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), + array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line field characters within columns')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/excel.php b/libraries/export/excel.php index 768fa3d30..68d2b5c8c 100644 --- a/libraries/export/excel.php +++ b/libraries/export/excel.php @@ -19,8 +19,8 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), - array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), + array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), array( 'type' => 'select', @@ -29,8 +29,8 @@ if (isset($plugin_list)) { 'win' => 'Windows', 'mac_excel2003' => 'Excel 2003 / Macintosh', 'mac_excel2008' => 'Excel 2008 / Macintosh'), - 'text' => __('Excel edition')), - array('type' => 'hidden', 'name' => 'data'), + 'text' => __('Excel edition:')), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 5f36dc95a..7b8595bd6 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -20,11 +20,15 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.ms-word', 'force_file' => true, 'options' => array( - array('type' => 'bool', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'), - array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'), - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), + /* what to dump (structure/data/both) */ + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))), + array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))), + array('type' => 'end_subgroup'), + /* data options */ + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), - array('type' => 'egroup'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/latex.php b/libraries/export/latex.php index cba335abc..4f8578858 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -27,44 +27,52 @@ if (isset($plugin_list)) { ), 'options_text' => __('Options'), ); + + /* what to dump (structure/data/both) */ + $plugin_list['latex']['options'][] = + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))); + $plugin_list['latex']['options'][] = + array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); + $plugin_list['latex']['options'][] = array('type' => 'end_subgroup'); + /* Structure options */ if (!$hide_structure) { $plugin_list['latex']['options'][] = - array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'); + array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption')); + array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption:')); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption')); + array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued):')); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key')); + array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key:')); if (!empty($GLOBALS['cfgRelation']['relation'])) { $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations')); + array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); } $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments')); + array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments')); if (!empty($GLOBALS['cfgRelation']['mimework'])) { $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type')); + array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); } $plugin_list['latex']['options'][] = - array('type' => 'egroup'); + array('type' => 'end_group'); } /* Data */ $plugin_list['latex']['options'][] = - array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'); + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); $plugin_list['latex']['options'][] = array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption')); + array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption:')); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption')); + array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued):')); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key')); + array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key:')); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')); + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')); $plugin_list['latex']['options'][] = - array('type' => 'egroup'); + array('type' => 'end_group'); } else { /** diff --git a/libraries/export/mediawiki.php b/libraries/export/mediawiki.php index 7e19b8388..bcbf22968 100644 --- a/libraries/export/mediawiki.php +++ b/libraries/export/mediawiki.php @@ -16,7 +16,7 @@ if (isset($plugin_list)) { 'extension' => 'txt', 'mime_type' => 'text/plain', 'options' => array( - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/ods.php b/libraries/export/ods.php index 78fd6f235..177019412 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -20,9 +20,9 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet', 'force_file' => true, 'options' => array( - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/odt.php b/libraries/export/odt.php index 157fc43d6..2b2e5c43c 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -26,32 +26,40 @@ if (isset($plugin_list)) { 'options' => array(), /* Filled later */ 'options_text' => __('Options'), ); + + /* what to dump (structure/data/both) */ + $plugin_list['odt']['options'][] = + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))); + $plugin_list['odt']['options'][] = + array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); + $plugin_list['odt']['options'][] = array('type' => 'end_subgroup'); + /* Structure options */ if (!$hide_structure) { $plugin_list['odt']['options'][] = - array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'); + array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); if (!empty($GLOBALS['cfgRelation']['relation'])) { $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations')); + array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); } $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments')); + array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments')); if (!empty($GLOBALS['cfgRelation']['mimework'])) { $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type')); + array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); } $plugin_list['odt']['options'][] = - array('type' => 'egroup'); + array('type' => 'end_group'); } /* Data */ $plugin_list['odt']['options'][] = - array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'); + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); $plugin_list['odt']['options'][] = array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); $plugin_list['odt']['options'][] = - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')); + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')); $plugin_list['odt']['options'][] = - array('type' => 'egroup'); + array('type' => 'end_group'); } else { $GLOBALS['odt_buffer'] = ''; diff --git a/libraries/export/pdf.php b/libraries/export/pdf.php index c4111e2fe..ee33c3f3f 100644 --- a/libraries/export/pdf.php +++ b/libraries/export/pdf.php @@ -21,8 +21,8 @@ if (isset($plugin_list)) { 'force_file' => true, 'options' => array( array('type' => 'message_only', 'name' => 'explanation', 'text' => __('(Generates a report containing the data of a single table)')), - array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title')), - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title:')), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/php_array.php b/libraries/export/php_array.php index 7d1fb5e8c..c3698cf12 100644 --- a/libraries/export/php_array.php +++ b/libraries/export/php_array.php @@ -19,7 +19,7 @@ if (isset($plugin_list)) { 'options' => array( array( 'type' => 'hidden', - 'name' => 'data', + 'name' => 'structure_or_data', ), ), 'options_text' => __('Options'), diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 4c42a91c2..354fac70a 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -25,14 +25,35 @@ if (isset($plugin_list)) { 'text' => __('SQL'), 'extension' => 'sql', 'mime_type' => 'text/x-sql', - 'options' => array( - array('type' => 'text', 'name' => 'header_comment', 'text' => __('Add custom comment into header (\\n splits lines)')), - array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Comments')), - array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction')), - array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')), - ), - 'options_text' => __('Options'), - ); + 'options' => array()); + + /* comments */ + $plugin_list['sql']['options'][] = + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Display comments (includes info such as export timestamp, PHP version, and server version)'))); + $plugin_list['sql']['options'][] = + array('type' => 'text', 'name' => 'header_comment', 'text' => __('Additional custom header comment (\n splits lines):')); + $plugin_list['sql']['options'][] = + array('type' => 'bool', 'name' => 'dates', 'text' => __('Include a timestamp of when databases were created, last updated, and last checked')); + if (!empty($GLOBALS['cfgRelation']['relation'])) { + $plugin_list['sql']['options'][] = + array('type' => 'bool', 'name' => 'relation', 'text' => __('Foreign key relationships')); + } + if (!empty($GLOBALS['cfgRelation']['mimework'])) { + $plugin_list['sql']['options'][] = + array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME types')); + } + $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); + /* end comments */ + + /* enclose in a transaction */ + $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction')); + + /* disable foreign key checks */ + $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')); + + $plugin_list['sql']['options_text'] = __('Options'); + + /* compatibility maximization */ $compats = PMA_DBI_getCompatibilities(); if (count($compats) > 0) { $values = array(); @@ -40,88 +61,114 @@ if (isset($plugin_list)) { $values[$val] = $val; } $plugin_list['sql']['options'][] = - array('type' => 'select', 'name' => 'compatibility', 'text' => __('SQL compatibility mode'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode')); + array('type' => 'select', 'name' => 'compatibility', 'text' => __('Database system or older MySQL server to maximize output compatibility with:'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode')); unset($values); } - /* Server export options */ + /* server export options */ if ($plugin_param['export_type'] == 'server') { - $plugin_list['sql']['options'][] = - array('type' => 'bgroup', 'text' => __('Database export options')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s'), 'DROP DATABASE')); - $plugin_list['sql']['options'][] = - array('type' => 'egroup'); - } + $plugin_list['sql']['options'][] = + array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s statement'), 'DROP DATABASE')); + } - /* Structure options */ - if (!$hide_structure) { + /* what to dump (structure/data/both) */ + $plugin_list['sql']['options'][] = + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))); + $plugin_list['sql']['options'][] = + array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); + $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); + + /* begin Structure options */ + if (!$hide_structure) { $plugin_list['sql']['options'][] = - array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'); - if ($plugin_param['export_type'] == 'table') { + array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); + + /* begin SQL Statements */ + $plugin_list['sql']['options'][] = + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'add_statements', 'text' => __('Add statements:'))); + if ($plugin_param['export_type'] == 'table') { if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { - $drop_clause = 'DROP VIEW'; + $drop_clause = 'DROP VIEW'; } else { - $drop_clause = 'DROP TABLE'; + $drop_clause = 'DROP TABLE'; } } else { - $drop_clause = 'DROP TABLE / VIEW / PROCEDURE / FUNCTION'; - if (PMA_MYSQL_INT_VERSION > 50100) { - $drop_clause .= ' / EVENT'; + $drop_clause = 'DROP TABLE / VIEW / PROCEDURE / FUNCTION'; + if (PMA_MYSQL_INT_VERSION > 50100) { + $drop_clause .= ' / EVENT'; } } $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf(__('Add %s'), $drop_clause)); + array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf(__('%s'), $drop_clause)); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'if_not_exists', 'text' => sprintf(__('Add %s'), 'IF NOT EXISTS')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'auto_increment', 'text' => __('Add AUTO_INCREMENT value')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'backquotes', 'text' => __('Enclose table and column names with backquotes')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'procedure_function', 'text' => sprintf(__('Add %s'), 'CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT' : ''))); + array('type' => 'bool', 'name' => 'procedure_function', 'text' => sprintf(__('%s'), 'CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT' : ''))); - /* MIME stuff etc. */ + /* begin CREATE TABLE statements*/ $plugin_list['sql']['options'][] = - array('type' => 'bgroup', 'text' => __('Add into comments')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'dates', 'text' => __('Creation/Update/Check dates')); - if (!empty($GLOBALS['cfgRelation']['relation'])) { + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'create_table_statements', 'text' => __('CREATE TABLE options:'))); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations')); - } - if (!empty($GLOBALS['cfgRelation']['mimework'])) { - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type')); - } + array('type' => 'bool', 'name' => 'if_not_exists', 'text' => __('IF NOT EXISTS')); $plugin_list['sql']['options'][] = - array('type' => 'egroup'); + array('type' => 'bool', 'name' => 'auto_increment', 'text' => __('AUTO_INCREMENT')); + $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); + /* end CREATE TABLE statements */ + + $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); + /* end SQL statements */ $plugin_list['sql']['options'][] = - array('type' => 'egroup'); + array('type' => 'bool', 'name' => 'backquotes', 'text' => __('Enclose table and field names with backquotes (Protects field and table names formed with special characters)')); + + $plugin_list['sql']['options'][] = + array('type' => 'end_group'); } + /* end Structure options */ - /* Data */ + /* begin Data options */ + $plugin_list['sql']['options'][] = + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); + + /* begin SQL statements */ $plugin_list['sql']['options'][] = - array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'); + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Add statements:'))); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'columns', 'text' => __('Complete inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_complete-insert-option')); + array('type' => 'bool', 'name' => 'delayed', 'text' => __('INSERT DELAYED')); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'extended', 'text' => __('Extended inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_extended-insert-option')); + array('type' => 'bool', 'name' => 'ignore', 'text' => __('INSERT IGNORE')); + $plugin_list['sql']['options'][] = + array('type' => 'end_subgroup'); + /* end SQL statements */ + + /* Function to use when dumping data */ + $plugin_list['sql']['options'][] = + array('type' => 'select', 'name' => 'type', 'text' => __('Function to use when dumping data:'), 'values' => array('INSERT' => 'INSERT', 'UPDATE' => 'UPDATE', 'REPLACE' => 'REPLACE')); + + /* Syntax to use when inserting data */ + $plugin_list['sql']['options'][] = + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Syntax to use when inserting data:'))); + $plugin_list['sql']['options'][] = + array('type' => 'radio', 'name' => 'insert_syntax', 'values' => array( + 'complete' => __('include column names in every INSERT statement
      Example: INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)'), + 'extended' => __('insert multiple rows in every INSERT statement
      Example: INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)'), + 'both' => __('both of the above
      Example: INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)'), + 'none' => __('neither of the above
      Example: INSERT INTO tbl_name VALUES (1,2,3)'))); + $plugin_list['sql']['options'][] = + array('type' => 'end_subgroup'); + + /* Max length of query */ $plugin_list['sql']['options'][] = array('type' => 'text', 'name' => 'max_query_size', 'text' => __('Maximal length of created query')); + + /* Dump binary columns in hexadecimal */ $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'delayed', 'text' => __('Use delayed inserts')); + array('type' => 'bool', 'name' => 'hex_for_blob', 'text' => __('Dump binary columns in hexadecimal notation (for example, "abc" becomes 0x616263)')); + + /* Dump time in UTC */ $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'ignore', 'text' => __('Use ignore inserts')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'hex_for_blob', 'text' => __('Use hexadecimal for BLOB')); - $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'utc_time', 'text' => __('Export time in UTC')); - $plugin_list['sql']['options'][] = - array('type' => 'select', 'name' => 'type', 'text' => __('Export type'), 'values' => array('INSERT' => 'INSERT', 'UPDATE' => 'UPDATE', 'REPLACE' => 'REPLACE')); - $plugin_list['sql']['options'][] = - array('type' => 'egroup'); + array('type' => 'bool', 'name' => 'utc_time', 'text' => __('Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)')); + + $plugin_list['sql']['options'][] = array('type' => 'end_group'); + /* end Data options */ } } else { @@ -389,7 +436,7 @@ function PMA_exportDBFooter($db) foreach($procedure_names as $procedure_name) { if (! empty($GLOBALS['sql_drop_table'])) { - $text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf; + $text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf; } $text .= PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf; } @@ -403,7 +450,7 @@ function PMA_exportDBFooter($db) foreach($function_names as $function_name) { if (! empty($GLOBALS['sql_drop_table'])) { - $text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf; + $text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf; } $text .= PMA_DBI_get_definition($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf; } @@ -417,7 +464,7 @@ function PMA_exportDBFooter($db) foreach($event_names as $event_name) { if (! empty($GLOBALS['sql_drop_table'])) { - $text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf; + $text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf; } $text .= PMA_DBI_get_definition($db, 'EVENT', $event_name) . $delimiter . $crlf . $crlf; } @@ -953,7 +1000,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) } // scheme for inserting fields - if (isset($GLOBALS['sql_columns'])) { + if ($GLOBALS['sql_insert_syntax'] == 'complete' || $GLOBALS['sql_insert_syntax'] == 'both') { $fields = implode(', ', $field_set); $schema_insert = $sql_command . $insert_delayed .' INTO ' . PMA_backquote($table, $sql_backquotes) // avoid EOL blank @@ -968,7 +1015,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) $replace = array('\0', '\n', '\r', '\Z'); $current_row = 0; $query_size = 0; - if (isset($GLOBALS['sql_extended']) && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) { + if (($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) { $separator = ','; $schema_insert .= $crlf; } else { @@ -1032,7 +1079,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) } else { // Extended inserts case - if (isset($GLOBALS['sql_extended'])) { + if ($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') { if ($current_row == 1) { $insert_line = $schema_insert . '(' . implode(', ', $values) . ')'; } else { diff --git a/libraries/export/texytext.php b/libraries/export/texytext.php index eeb1615bf..d07bb5afc 100644 --- a/libraries/export/texytext.php +++ b/libraries/export/texytext.php @@ -18,22 +18,15 @@ if (isset($plugin_list)) { 'extension' => 'txt', 'mime_type' => 'text/plain', 'options' => array( - array('type' => 'bool', - 'name' => 'structure', - 'text' => __('Structure'), - 'force' => 'data'), - array('type' => 'bgroup', - 'name' => 'data', - 'text' => __('Data'), - 'force' => 'structure'), - array('type' => 'text', - 'name' => 'null', - 'text' => __('Replace NULL by')), - array('type' => 'bool', - 'name' => 'columns', - 'text' => __('Put columns names in the first row')), - array('type' => 'egroup'), - ), + /* what to dump (structure/data/both) */ + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))), + array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))), + array('type' => 'end_subgroup'), + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), + array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), + array('type' => 'end_group'), + ), 'options_text' => __('Options'), ); } else { diff --git a/libraries/export/xls.php b/libraries/export/xls.php index d23890322..68075b152 100644 --- a/libraries/export/xls.php +++ b/libraries/export/xls.php @@ -20,9 +20,9 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.ms-excel', 'force_file' => true, 'options' => array( - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/xlsx.php b/libraries/export/xlsx.php index b59c78cc8..833e7e09b 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -20,9 +20,9 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'force_file' => true, 'options' => array( - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), + array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/xml.php b/libraries/export/xml.php index be005bfa7..b6da9c4d8 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -19,26 +19,26 @@ if (isset($plugin_list)) { 'extension' => 'xml', 'mime_type' => 'text/xml', 'options' => array( - array('type' => 'hidden', 'name' => 'data'), + array('type' => 'hidden', 'name' => 'structure_or_data'), ), 'options_text' => __('Options') ); /* Export structure */ $plugin_list['xml']['options'][] = - array('type' => 'bgroup', 'name' => 'export_struc', 'text' => __('Export Structure Schemas (recommended)')); + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):'))); $plugin_list['xml']['options'][] = - array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Export functions')); + array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions')); $plugin_list['xml']['options'][] = - array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Export procedures')); + array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Procedures')); $plugin_list['xml']['options'][] = - array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Export tables')); + array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Tables')); $plugin_list['xml']['options'][] = - array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Export triggers')); + array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers')); $plugin_list['xml']['options'][] = - array('type' => 'bool', 'name' => 'export_views', 'text' => __('Export views')); + array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views')); $plugin_list['xml']['options'][] = - array('type' => 'egroup'); + array('type' => 'end_subgroup'); /* Data */ $plugin_list['xml']['options'][] = diff --git a/libraries/export/yaml.php b/libraries/export/yaml.php index 70912725b..29055f331 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -22,7 +22,7 @@ if (isset($plugin_list)) { 'options' => array( array( 'type' => 'hidden', - 'name' => 'data', + 'name' => 'structure_or_data', ), ), 'options_text' => __('Options'), diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 170fb96bb..80a3d79f0 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -24,17 +24,17 @@ if (isset($plugin_list)) { 'options' => array( array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')), array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')), - array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2), - array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by'), 'size' => 2, 'len' => 2), - array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by'), 'size' => 2, 'len' => 2), - array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2), + array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated with:'), 'size' => 2, 'len' => 2), + array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:'), 'size' => 2, 'len' => 2), + array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:'), 'size' => 2, 'len' => 2), + array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated with:'), 'size' => 2), ), 'options_text' => __('Options'), ); if ($plugin_param !== 'table') { $plugin_list['csv']['options'][] = - array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')); + array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')); } else { $plugin_list['csv']['options'][] = array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')); diff --git a/libraries/import/ods.php b/libraries/import/ods.php index 395a8fc6d..0a1393bb9 100644 --- a/libraries/import/ods.php +++ b/libraries/import/ods.php @@ -22,10 +22,10 @@ if (isset($plugin_list)) { 'text' => __('Open Document Spreadsheet'), 'extension' => 'ods', 'options' => array( - array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')), + array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')), array('type' => 'bool', 'name' => 'empty_rows', 'text' => __('Do not import empty rows')), - array('type' => 'bool', 'name' => 'recognize_percentages', 'text' => __('Import percentages as proper decimals (12.00% to .12)')), - array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies ($5.00 to 5.00)')), + array('type' => 'bool', 'name' => 'recognize_percentages', 'text' => __('Import percentages as proper decimals (ex. 12.00% to .12)')), + array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies (ex. $5.00 to 5.00)')), ), 'options_text' => __('Options'), ); diff --git a/libraries/import/sql.php b/libraries/import/sql.php index 0241d71a2..eafe2c0c6 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -29,7 +29,7 @@ if (isset($plugin_list)) { array( 'type' => 'select', 'name' => 'compatibility', - 'text' => __('SQL compatibility mode'), + 'text' => __('SQL compatibility mode:'), 'values' => $values, 'doc' => array( 'manual_MySQL_Database_Administration', @@ -39,7 +39,7 @@ if (isset($plugin_list)) { array( 'type' => 'bool', 'name' => 'no_auto_value_on_zero', - 'text' => __('Do not use AUTO_INCREMENT for zero values'), + 'text' => __('Do not use AUTO_INCREMENT for zero values'), 'doc' => array( 'manual_MySQL_Database_Administration', 'Server_SQL_mode', diff --git a/libraries/import/xls.php b/libraries/import/xls.php index ca4778f31..6b50cf7b0 100644 --- a/libraries/import/xls.php +++ b/libraries/import/xls.php @@ -21,7 +21,7 @@ if (isset($plugin_list)) { 'text' => __('Excel 97-2003 XLS Workbook'), 'extension' => 'xls', 'options' => array( - array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')), + array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')), ), 'options_text' => __('Options'), ); diff --git a/libraries/import/xlsx.php b/libraries/import/xlsx.php index 80d79e58f..309f8f9ad 100644 --- a/libraries/import/xlsx.php +++ b/libraries/import/xlsx.php @@ -21,7 +21,7 @@ if (isset($plugin_list)) { 'text' => __('Excel 2007 XLSX Workbook'), 'extension' => 'xlsx', 'options' => array( - array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')), + array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')), ), 'options_text' => __('Options'), ); diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index b78d32f80..ffaddec67 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -142,37 +142,44 @@ function PMA_pluginIsActive($section, $opt, $val) /** * string PMA_pluginGetChoice(string $section, string $name, array &$list, string $cfgname) * - * returns html radio form element for plugin choice + * returns html select form element for plugin choice + * and hidden fields denoting whether each plugin must be exported as a file * - * @uses PMA_pluginIsActive() + * @uses PMA_pluginGetDefault() * @uses PMA_getString() * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin - * @param string $name name of radio element + * @param string $name name of select element * @param array &$list array with plugin configuration defined in plugin file * @param string $cfgname name of config value, if none same as $name - * @return string html input radio tag + * @return string html select tag */ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) { if (!isset($cfgname)) { $cfgname = $name; } - $ret = ''; + $ret = '' . "\n"; - $ret .= '' . "\n"; - $ret .= '
' . "\n"; + $ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . ' \n'; + } + $ret .= '' . "\n"; + + // Whether each plugin has to be saved as a file + foreach ($list as $plugin_name => $val) { + $ret .= ''. "\n"; } return $ret; } @@ -180,7 +187,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) /** * string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt) * - * returns single option in a table row + * returns single option in a list element * * @uses PMA_getString() * @uses PMA_pluginCheckboxCheck() @@ -196,7 +203,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) { $ret = "\n"; if ($opt['type'] == 'bool') { - $ret .= '
' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= '' . PMA_getString($opt['text']) . ''; - $ret .= '
  • ' . "\n"; } elseif ($opt['type'] == 'text') { - $ret .= '
    ' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= ''; $ret .= ''; - $ret .= '
  • ' . "\n"; } elseif ($opt['type'] == 'message_only') { - $ret .= '
    ' . "\n"; - $ret .= '

    ' . PMA_getString($opt['text']) . '

    '; - $ret .= '
    ' . "\n"; + $ret .= '
  • ' . "\n"; + $ret .= '

    ' . PMA_getString($opt['text']) . '

    '; } elseif ($opt['type'] == 'select') { - $ret .= '
    ' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= ''; $ret .= ''; - $ret .= '' . "\n"; + } elseif ($opt['type'] == 'radio') { + $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']); + foreach($opt['values'] as $key => $val) { + $ret .= '
  • ' + . PMA_getString($val) . ''; + } } elseif ($opt['type'] == 'hidden') { $ret .= ''; - } elseif ($opt['type'] == 'bgroup') { - $ret .= '
    '; - /* No checkbox without name */ - if (!empty($opt['name'])) { - $ret .= '' - . PMA_getString($opt['text']) . ''; - } else { - $ret .= PMA_getString($opt['text']); - } - $ret .= ''; - } elseif ($opt['type'] == 'egroup') { - $ret .= '
    '; + } elseif ($opt['type'] == 'begin_group') { + $ret .= '

    ' . PMA_getString($opt['text']) . '

    '; + } elseif ($opt['type'] == 'begin_subgroup') { + /* each subgroup can have a header, which may also be a form element */ + $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . ''; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ @@ -279,6 +279,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]); } } + $ret .= "\n"; return $ret; } @@ -286,10 +287,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) /** * string PMA_pluginGetOptions(string $section, array &$list) * - * return html fieldset with editable options for plugin + * return html div with editable options for plugin * * @uses PMA_getString() * @uses PMA_pluginGetOneOption() + * @uses PMA_pluginGetDefault(); * @param string $section name of config section in $GLOBALS['cfg'][$section] * @param array &$list array with plugin configuration defined in plugin file * @return string html fieldset with plugin options @@ -297,10 +299,14 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) function PMA_pluginGetOptions($section, &$list) { $ret = ''; + $default = PMA_pluginGetDefault('Export', 'format'); // Options for plugins that support them foreach ($list as $plugin_name => $val) { - $ret .= '
    '; - $ret .= '' . PMA_getString($val['options_text']) . ''; + $ret .= '
    0) { foreach ($val['options'] as $id => $opt) { @@ -311,70 +317,7 @@ function PMA_pluginGetOptions($section, &$list) if ($count == 0) { $ret .= __('This format has no options'); } - $ret .= '
    '; + $ret .= ''; } return $ret; } - -/** - * string PMA_pluginGetJavascript(array &$list) - * - * return html/javascript code which is needed for handling plugin stuff - * - * @param array &$list array with plugin configuration defined in plugin file - * @return string html fieldset with plugin options - */ -function PMA_pluginGetJavascript(&$list) { - $ret = ' - - '; - return $ret; -} -?> diff --git a/navigation.php b/navigation.php index 909bc0054..35d2e7909 100644 --- a/navigation.php +++ b/navigation.php @@ -238,16 +238,10 @@ if (! $GLOBALS['server']) { .'' . "\n" .'' . "\n"; } else { - if (! empty($db)) { - echo '
    ' . "\n"; - } echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n"; } $_url_params = array('pos' => $pos); PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']); - if (! empty($db)) { - echo '
    ' . "\n"; - } } ?> diff --git a/server_export.php b/server_export.php index e728465bc..183b784c4 100644 --- a/server_export.php +++ b/server_export.php @@ -12,6 +12,7 @@ require_once './libraries/common.inc.php'; $GLOBALS['js_include'][] = 'functions.js'; +$GLOBALS['js_include'][] = 'export.js'; /** * Displays the links @@ -23,12 +24,12 @@ $checkall_url = 'server_export.php?' . PMA_generate_common_url() . '&goto=db_export.php'; -$multi_values = '
    '; +$multi_values = '
    '; $multi_values .= '' . __('Select All') . ' / ' . __('Unselect All') . '
    '; -$multi_values .= ''; $multi_values .= "\n"; foreach ($GLOBALS['pma']->databases as $current_db) { @@ -41,7 +42,7 @@ foreach ($GLOBALS['pma']->databases as $current_db) { $multi_values .= ' ' . "\n"; } // end while $multi_values .= "\n"; -$multi_values .= '

    '; +$multi_values .= '
    '; $export_type = 'server'; require_once './libraries/display_export.lib.php'; diff --git a/server_import.php b/server_import.php index d0ec6872f..bbd6cf7f1 100644 --- a/server_import.php +++ b/server_import.php @@ -11,6 +11,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'import.js'; + /** * Does the common work */ diff --git a/tbl_export.php b/tbl_export.php index 086dd39f7..775650dc0 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -11,6 +11,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'export.js'; + /** * Gets tables informations and displays top links */ diff --git a/tbl_import.php b/tbl_import.php index a0500fd07..e5fcc9f11 100644 --- a/tbl_import.php +++ b/tbl_import.php @@ -11,6 +11,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'import.js'; + /** * Gets tables informations and displays top links */ diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index b3c510154..40189623a 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1228,3 +1228,70 @@ table#serverconnection_trg_local { */ .invalid_value {background:#F00;} + +/** + * Export styles + */ +select#db_select, select#table_select { + width: 400px; +} + +.exportoptions h3, .importoptions h3 { + border-bottom: 1px #999999 solid; +} + +.exportoptions ul, .importoptions ul, .format_specific_options ul { + list-style-type: none; + margin-bottom: 15px; +} + +.exportoptions li, .importoptions li { + margin: 7px; +} + +.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { + margin: 5px; + float: none; +} + +#csv_options .desc, #latex_options .desc, #output .desc{ + float: left; + width: 15em; +} + +.exportoptions, .importoptions { + margin: 30px 30px 30px 10px +} + +.exportoptions #buttonGo, .importoptions #buttonGo { + padding: 5px 30px; + -moz-border-radius: 11px; + -webkit-border-radius: + background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc)); + background: -moz-linear-gradient(top, #ffffff, #cccccc); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc'); + border: 1px solid #444444; + background-color: #ffffff; + cursor: pointer; +} + +.export_sub_options { + margin: 30px 0px 0px 0px; +} + +.export_sub_options h4 { + border-bottom: 1px #999999 solid; +} + +.importoptions #import_notification { + margin: 10px 0px; + font-style: italic; +} + +p.desc { + margin: 5px; +} + +.formelementrow { + margin: 5px 0px 5px 0px; +}