From e3f4e4a776b7fd129f1227c54667c965861bb271 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:19:27 -0400 Subject: [PATCH 01/58] Quick export Fixes table export --- export.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/export.php b/export.php index ae7a5662a..9c82ed11a 100644 --- a/export.php +++ b/export.php @@ -42,6 +42,14 @@ $compression = false; $onserver = false; $save_on_server = false; $buffer_needed = false; + +// Is it a quick or custom export? +if($_REQUEST['quick_or_custom'] == 'quick') { + $quick_export = true; +} else { + $quick_export = false; +} + if ($_REQUEST['output_format'] == 'astext') { $asfile = false; } else { @@ -50,12 +58,17 @@ if ($_REQUEST['output_format'] == 'astext') { $compression = $_REQUEST['compression']; $buffer_needed = true; } - if (!empty($_REQUEST['onserver'])) { - $onserver = $_REQUEST['onserver']; + if (($quick_export && !empty($_REQUEST['quick_export_onserver'])) || (!$quick_export && !empty($_REQUEST['onserver']))) { + if($quick_export) { + $onserver = $_REQUEST['quick_export_onserver']; + } else { + $onserver = $_REQUEST['onserver']; + } // Will we save dump on server? $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!')); @@ -289,7 +302,7 @@ if ($asfile) { if ($save_on_server) { $save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename); unset($message); - if (file_exists($save_filename) && empty($onserverover)) { + if (file_exists($save_filename) && ((!$quick_export && empty($onserverover)) || ($quick_export && $_REQUEST['quick_export_onserverover'] != 'saveitover'))) { $message = PMA_Message::error(__('File %s already exists on server, change filename or check overwrite option.')); $message->addParam($save_filename); } else { @@ -528,7 +541,7 @@ if ($export_type == 'server') { } $is_view = PMA_Table::isView($db, $table); - 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, $is_view ? 'create_view' : 'create_table', $export_type)) { break; } @@ -536,7 +549,7 @@ if ($export_type == 'server') { // If this is an export of a single view, we have to export data; // for example, a PDF report // if it is a merge table, no data is exported - if (isset($GLOBALS[$what . '_data']) && ! PMA_Table::isMerge($db, $table)) { + if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) { if (!empty($sql_query)) { // only preg_replace if needed if (!empty($add_query)) { @@ -554,7 +567,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; } From 33cd3de818873332dcf6ceae2b45c160bdfcc1cb Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:19:53 -0400 Subject: [PATCH 02/58] Quick export --- js/export.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/js/export.js b/js/export.js index 38419a058..0257f34bf 100644 --- a/js/export.js +++ b/js/export.js @@ -148,3 +148,27 @@ $(document).ready(function() { } }); }); + +/** + * Toggles display of options when quick and custom export are selected + */ +$(document).ready(function() { + $("input[type='radio'][name='quick_or_custom']").change(function() { + export_type = $("input[type='radio'][name='quick_or_custom']:checked").attr("value"); + if(export_type == "custom") { + $("#databases_and_tables").show(); + $("#rows").show(); + $("#output").show(); + $("#format_specific_opts").show(); + $("#output_quick_export").hide(); + var selected_plugin_name = $("#plugins option:selected").attr("value"); + $("#" + selected_plugin_name + "_options").show(); + } else { + $("#databases_and_tables").hide(); + $("#rows").hide(); + $("#output").hide(); + $("#format_specific_opts").hide(); + $("#output_quick_export").show(); + } + }); +}); From 0828cbf8032304e3a27742e0b1385aa0d1d8b357 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:20:11 -0400 Subject: [PATCH 03/58] Fixes bug that occurs when selecting a file from web server upload directory --- js/import.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/import.js b/js/import.js index 303405f29..0e3af7ce6 100644 --- a/js/import.js +++ b/js/import.js @@ -36,7 +36,7 @@ $(document).ready(function() { if (extension == "gz" || extension == "bz2" || extension == "zip") { len--; } - $("option:selected").removeAttr("selected"); + $("#plugins 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; From fe90e236cd63ddfdc239cbc17cdefa02402757cc Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:21:44 -0400 Subject: [PATCH 04/58] Quick export --- libraries/display_export.lib.php | 50 +++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index fef74e062..28481efb5 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,7 +67,21 @@ if (! empty($sql_query)) { } ?> -
+
+

+
    +
  • + '; + echo ''; ?> +
  • +
  • + '; + echo '';?> +
  • +
+
+ + -
+ -
+ + +
+

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

Format:

+

-
+ @@ -243,7 +280,6 @@ if (! empty($sql_query)) { -
From a2dfd7170aa23fb4f33abcf4740ec5776da647bf Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:36:20 -0400 Subject: [PATCH 05/58] Added functions used to display file select forms in import --- libraries/common.lib.php | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index d7333c7a9..a06c875b3 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2856,4 +2856,46 @@ function PMA_js($code, $print=true) return $out; } -?> + +/** + * Display the form used to browse anywhere on the server for the file to import + */ +function PMA_browseUploadFile($max_upload_size) { + $uid = uniqid(""); + echo ''; + echo ''; + echo ''; + echo ''; + echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; + // some browsers should respect this :) + echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; +} + +/** + * Display the form used to select a file to import from the server upload directory + */ +function PMA_selectUploadFile($import_list, $uploaddir) { + echo ''; + $extensions = ''; + foreach ($import_list as $key => $val) { + if (!empty($extensions)) { + $extensions .= '|'; + } + $extensions .= $val['extension']; + } + $matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@'; + + $files = PMA_getFileSelectOptions(PMA_userDir($uploaddir), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : ''); + if ($files === FALSE) { + PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display(); + } elseif (!empty($files)) { + echo "\n"; + echo ' ' . "\n"; + } elseif (empty ($files)) { + echo 'There are no files to upload'; + } +} +?> \ No newline at end of file From d5ba4231ec5206881ba3b31716411902142636ec Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:37:25 -0400 Subject: [PATCH 06/58] SQL export option "CREATE PROCEDURE / FUNCTION / EVENT" default set to true --- libraries/config.default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/config.default.php b/libraries/config.default.php index 34af11161..fd95c6263 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1536,7 +1536,7 @@ $cfg['Export']['sql_if_not_exists'] = true; * * @global boolean $cfg['Export']['sql_procedure_function'] */ -$cfg['Export']['sql_procedure_function'] = false; +$cfg['Export']['sql_procedure_function'] = true; /** * From 135868db800c477cbcd10a40a318a903d64e356b Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:38:28 -0400 Subject: [PATCH 07/58] Updated the formatting for selecting a file to import --- libraries/display_import.lib.php | 54 ++++++++++---------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index ebeef87fa..10c65f47a 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -141,49 +141,29 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { printf(__('

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']) { + if($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) { ?> +
    +
  • + + +
  • +
  • + + +
  • +
+
- - -
- - - -
+ +
display(); - } - if (!empty($cfg['UploadDir'])) { - $extensions = ''; - foreach ($import_list as $key => $val) { - if (!empty($extensions)) { - $extensions .= '|'; - } - $extensions .= $val['extension']; - } - $matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@'; - - $files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : ''); - echo '
' . "\n"; - if ($files === FALSE) { - PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display(); - } elseif (!empty($files)) { - echo "\n"; - echo ' ' . __('Or') . '
 : ' . "\n"; - echo ' ' . "\n"; - } - echo '
' . "\n"; + } else if (!empty($cfg['UploadDir'])) { + PMA_selectUploadFile($import_list, $cfg['UploadDir']); } // end if (web-server upload directory) // charset of file From 347cfc7eaa30c9a1b581b2e816d920ac118c855c Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:39:42 -0400 Subject: [PATCH 08/58] The default plugin options should be displayed on the import form but not on the export form (because of quick export) --- libraries/plugin_interface.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index ffaddec67..5a982cc43 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -303,7 +303,9 @@ function PMA_pluginGetOptions($section, &$list) // Options for plugins that support them foreach ($list as $plugin_name => $val) { $ret .= '
Date: Tue, 15 Jun 2010 23:40:42 -0400 Subject: [PATCH 09/58] Added styles for "CSV using LOAD DATA" plugin options --- themes/original/css/theme_right.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 40189623a..ddaf51385 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1254,7 +1254,7 @@ select#db_select, select#table_select { float: none; } -#csv_options .desc, #latex_options .desc, #output .desc{ +#csv_options .desc, #ldi_options .desc, #latex_options .desc, #output .desc{ float: left; width: 15em; } From 3ba5c8e0f4b34dd8e618ac6854badf193c32f3d8 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:11:52 -0400 Subject: [PATCH 10/58] Fixed XHTML syntax problems --- libraries/export/codegen.php | 2 ++ libraries/export/csv.php | 2 ++ libraries/export/excel.php | 2 ++ libraries/export/htmlword.php | 4 ++-- libraries/export/latex.php | 6 ++++-- libraries/export/mediawiki.php | 2 ++ libraries/export/ods.php | 2 ++ libraries/export/odt.php | 4 ++-- libraries/export/pdf.php | 2 ++ libraries/export/php_array.php | 2 ++ libraries/export/sql.php | 12 ++++++++---- libraries/export/texytext.php | 4 ++-- libraries/export/xls.php | 2 ++ libraries/export/xlsx.php | 2 ++ libraries/export/xml.php | 13 ++++++++++--- libraries/export/yaml.php | 2 ++ 16 files changed, 48 insertions(+), 15 deletions(-) diff --git a/libraries/export/codegen.php b/libraries/export/codegen.php index 9c829c007..52f8577dd 100644 --- a/libraries/export/codegen.php +++ b/libraries/export/codegen.php @@ -33,8 +33,10 @@ if (isset($plugin_list)) { 'extension' => 'cs', 'mime_type' => 'text/cs', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'hidden', 'name' => 'structure_or_data'), array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/csv.php b/libraries/export/csv.php index dfe9885ad..39defdcb4 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -18,6 +18,7 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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:')), @@ -26,6 +27,7 @@ if (isset($plugin_list)) { 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' => 'structure_or_data'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/excel.php b/libraries/export/excel.php index 68d2b5c8c..1e1ab2f55 100644 --- a/libraries/export/excel.php +++ b/libraries/export/excel.php @@ -19,6 +19,7 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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')), @@ -31,6 +32,7 @@ if (isset($plugin_list)) { 'mac_excel2008' => 'Excel 2008 / Macintosh'), 'text' => __('Excel edition:')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 7b8595bd6..3d534cdef 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -21,9 +21,9 @@ if (isset($plugin_list)) { 'force_file' => true, 'options' => array( /* what to dump (structure/data/both) */ - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))), + array('type' => 'begin_group', 'name' => 'dump_what', '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' => 'end_group'), /* data options */ array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), diff --git a/libraries/export/latex.php b/libraries/export/latex.php index 4f8578858..61a933b64 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -23,17 +23,19 @@ if (isset($plugin_list)) { 'extension' => 'tex', 'mime_type' => 'application/x-tex', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'caption', 'text' => __('Include table caption')), + array('type' => 'end_group') ), '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'))); + array('type' => 'begin_group', 'name' => 'dump_what', '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'); + $plugin_list['latex']['options'][] = array('type' => 'end_group'); /* Structure options */ if (!$hide_structure) { diff --git a/libraries/export/mediawiki.php b/libraries/export/mediawiki.php index bcbf22968..9fa1b483e 100644 --- a/libraries/export/mediawiki.php +++ b/libraries/export/mediawiki.php @@ -16,7 +16,9 @@ if (isset($plugin_list)) { 'extension' => 'txt', 'mime_type' => 'text/plain', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/ods.php b/libraries/export/ods.php index 177019412..5b70944dd 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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' => 'structure_or_data'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/odt.php b/libraries/export/odt.php index 2b2e5c43c..b5d500d30 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -29,10 +29,10 @@ if (isset($plugin_list)) { /* what to dump (structure/data/both) */ $plugin_list['odt']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))); + array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts'); $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'); + $plugin_list['odt']['options'][] = array('type' => 'end_group'); /* Structure options */ if (!$hide_structure) { diff --git a/libraries/export/pdf.php b/libraries/export/pdf.php index ee33c3f3f..2f544b551 100644 --- a/libraries/export/pdf.php +++ b/libraries/export/pdf.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/pdf', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/php_array.php b/libraries/export/php_array.php index c3698cf12..5cf6fb760 100644 --- a/libraries/export/php_array.php +++ b/libraries/export/php_array.php @@ -17,10 +17,12 @@ if (isset($plugin_list)) { 'extension' => 'php', 'mime_type' => 'text/plain', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'hidden', 'name' => 'structure_or_data', ), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 354fac70a..aee3313d9 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -27,6 +27,8 @@ if (isset($plugin_list)) { 'mime_type' => 'text/x-sql', 'options' => array()); + $plugin_list['sql']['options'][] = array('type' => 'begin_group', 'name' => 'general_opts'); + /* 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)'))); @@ -78,6 +80,8 @@ if (isset($plugin_list)) { 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'); + $plugin_list['sql']['options'][] = array('type' => 'end_group'); + /* begin Structure options */ if (!$hide_structure) { $plugin_list['sql']['options'][] = @@ -148,10 +152,10 @@ if (isset($plugin_list)) { 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)'))); + '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'); diff --git a/libraries/export/texytext.php b/libraries/export/texytext.php index d07bb5afc..8ed6a742a 100644 --- a/libraries/export/texytext.php +++ b/libraries/export/texytext.php @@ -19,9 +19,9 @@ if (isset($plugin_list)) { 'mime_type' => 'text/plain', 'options' => array( /* what to dump (structure/data/both) */ - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))), + array('type' => 'begin_group', 'text' => __('Dump table'), 'name' => 'general_opts'), 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' => 'end_group'), 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')), diff --git a/libraries/export/xls.php b/libraries/export/xls.php index 68075b152..188667798 100644 --- a/libraries/export/xls.php +++ b/libraries/export/xls.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.ms-excel', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/xlsx.php b/libraries/export/xlsx.php index 833e7e09b..a5459579b 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/xml.php b/libraries/export/xml.php index b6da9c4d8..4f6f97813 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -19,14 +19,18 @@ if (isset($plugin_list)) { 'extension' => 'xml', 'mime_type' => 'text/xml', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options') ); /* Export structure */ $plugin_list['xml']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):'))); + array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options')); + $plugin_list['xml']['options'][] = + array('type' => 'begin_subgroup', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions')); $plugin_list['xml']['options'][] = @@ -37,12 +41,15 @@ if (isset($plugin_list)) { array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views')); - $plugin_list['xml']['options'][] = - array('type' => 'end_subgroup'); + $plugin_list['xml']['options'][] = array('type' => 'end_subgroup'); + $plugin_list['xml']['options'][] = array('type' => 'end_group'); /* Data */ + $plugin_list['xml']['options'][] = + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_contents', 'text' => __('Export contents')); + $plugin_list['xml']['options'][] = array('type' => 'end_group'); } else { /** diff --git a/libraries/export/yaml.php b/libraries/export/yaml.php index 29055f331..9fce67f83 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -20,10 +20,12 @@ if (isset($plugin_list)) { 'mime_type' => 'text/yaml', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'hidden', 'name' => 'structure_or_data', ), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); From 71ee3e6421432742c9a134e7d7fd61bcfea66393 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:12:41 -0400 Subject: [PATCH 11/58] Fixed XHTML syntax problems --- libraries/import/csv.php | 2 ++ libraries/import/docsql.php | 2 ++ libraries/import/ldi.php | 2 ++ libraries/import/ods.php | 2 ++ libraries/import/sql.php | 2 ++ libraries/import/xls.php | 2 ++ libraries/import/xlsx.php | 2 ++ 7 files changed, 14 insertions(+) diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 80a3d79f0..a774371a8 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -22,6 +22,7 @@ if (isset($plugin_list)) { 'text' => __('CSV'), 'extension' => 'csv', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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 with:'), 'size' => 2, 'len' => 2), @@ -39,6 +40,7 @@ if (isset($plugin_list)) { $plugin_list['csv']['options'][] = array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')); } + $plugin_list['csv']['options'][] = array('type' => 'end_group'); /* We do not define function when plugin is just queried for information above */ return; diff --git a/libraries/import/docsql.php b/libraries/import/docsql.php index fa458ac30..35119b457 100644 --- a/libraries/import/docsql.php +++ b/libraries/import/docsql.php @@ -29,7 +29,9 @@ if (isset($plugin_list)) { 'text' => __('DocSQL'), // text to be displayed as choice 'extension' => '', // extension this plugin can handle 'options' => array( // array of options for your plugin (optional) + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'table', 'text' => __('Table name')), + array('type' => 'end_group') ), 'options_text' => __('Options'), // text to describe plugin options (must be set if options are used) ); diff --git a/libraries/import/ldi.php b/libraries/import/ldi.php index 2c8702af3..cf9502715 100644 --- a/libraries/import/ldi.php +++ b/libraries/import/ldi.php @@ -35,6 +35,7 @@ if (isset($plugin_list)) { 'text' => __('CSV using LOAD DATA'), 'extension' => 'ldi', // This is nonsense, however we want to default to our parser for csv 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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), @@ -43,6 +44,7 @@ if (isset($plugin_list)) { array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2), array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')), array('type' => 'bool', 'name' => 'local_option', 'text' => __('Use LOCAL keyword')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/ods.php b/libraries/import/ods.php index 0a1393bb9..7df7edcbf 100644 --- a/libraries/import/ods.php +++ b/libraries/import/ods.php @@ -22,10 +22,12 @@ if (isset($plugin_list)) { 'text' => __('Open Document Spreadsheet'), 'extension' => 'ods', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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 (ex. 12.00% to .12)')), array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies (ex. $5.00 to 5.00)')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/sql.php b/libraries/import/sql.php index eafe2c0c6..a73d8be20 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -26,6 +26,7 @@ if (isset($plugin_list)) { $values[$val] = $val; } $plugin_list['sql']['options'] = array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'select', 'name' => 'compatibility', @@ -47,6 +48,7 @@ if (isset($plugin_list)) { ), ), + array('type' => 'end_group'), ); } diff --git a/libraries/import/xls.php b/libraries/import/xls.php index 6b50cf7b0..503f7c900 100644 --- a/libraries/import/xls.php +++ b/libraries/import/xls.php @@ -21,7 +21,9 @@ if (isset($plugin_list)) { 'text' => __('Excel 97-2003 XLS Workbook'), 'extension' => 'xls', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/xlsx.php b/libraries/import/xlsx.php index 309f8f9ad..82cd0917a 100644 --- a/libraries/import/xlsx.php +++ b/libraries/import/xlsx.php @@ -21,7 +21,9 @@ if (isset($plugin_list)) { 'text' => __('Excel 2007 XLSX Workbook'), 'extension' => 'xlsx', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), 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' => 'end_group') ), 'options_text' => __('Options'), ); From 92779ae9c0b73f82788f97a135fda069c80b2d5e Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:14:09 -0400 Subject: [PATCH 12/58] Fixed XHTML syntax problemsloris-computer:/Library/WebServer/Documents/gsoc Lori$ git commit libraries/common.lib.php Fixed XHTML syntax problems --- libraries/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 0f1dc34a5..cb7e1afbf 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2865,7 +2865,7 @@ function PMA_browseUploadFile($max_upload_size) { echo ''; echo ''; echo ''; - echo ''; + echo ''; echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; // some browsers should respect this :) echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; From b967bd91690a5742368cc70e4a5fab6f164b08b5 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:14:48 -0400 Subject: [PATCH 13/58] Fixed XHTML syntax problems --- libraries/display_export.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 28481efb5..b0fcf9dfd 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -81,7 +81,7 @@ if (! empty($sql_query)) {
-