diff --git a/enum_editor.php b/enum_editor.php new file mode 100644 index 000000000..4ab0d7f59 --- /dev/null +++ b/enum_editor.php @@ -0,0 +1,64 @@ + + + + + +
+
+

Values for the column ""

+

Enter each value in a separate field.

+
+ '; + $stripped_values[] = $value; + } + } + // If extra fields are added, display them + if($_GET['add_extra_fields']) { + $extra_fields = $_GET['extra_fields']; + $total_fields = $extra_fields + $field_counter; + for($i = ($field_counter+1); $i <= $total_fields; $i++) { + echo ''; + } + } else { + $total_fields = $field_counter; + } + ?> +
+

+ Add more values +

+ + + + + + +
+

Output

+

Copy and paste the joined values into the "Length/Values" field

+ +
+
+ + \ No newline at end of file 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; } diff --git a/js/export.js b/js/export.js index 38419a058..166e65555 100644 --- a/js/export.js +++ b/js/export.js @@ -118,7 +118,7 @@ $(document).ready(function() { }); /** - * For SQL plugin, if "CREATE TABLE options" is checked/uncheck, check/uncheck each of its sub-options + * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options */ $(document).ready(function() { $("#checkbox_sql_create_table_statements").change(function() { @@ -148,3 +148,63 @@ $(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() { + if($("$(this):checked").attr("value") == "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(); + } + }); +}); + +/** + * Sets up the interface for Javascript-enabled browsers since the default is for + * Javascript-disabled browsers + */ + $(document).ready(function() { + $("#quick_or_custom").show(); + $("#databases_and_tables").hide(); + $("#rows").hide(); + $("#output_quick_export").show(); + $("#output").hide(); + $("#format_specific_opts").hide(); + $("#scroll_to_options_msg").hide(); + $(".format_specific_options").hide(); + $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0}); + $(".format_specific_options h3").remove(); +}); + +/** + * Disables the "Dump some row(s)" sub-options when it is not selected + */ + $(document).ready(function() { + $("input[type='radio'][name='allrows']").change(function() { +// alert(("$(this):checked").attr("name")); + if($("input[type='radio'][name='allrows']:checked").attr("value") == "1") { + $("label[for='limit_to']").fadeTo('fast', 0.4); + $("label[for='limit_from']").fadeTo('fast', 0.4); + $("input[type='text'][name='limit_to']").attr('disabled', 'disabled'); + $("input[type='text'][name='limit_from']").attr('disabled', 'disabled'); + } else { + $("label[for='limit_to']").fadeTo('fast', 1); + $("label[for='limit_from']").fadeTo('fast', 1); + $("input[type='text'][name='limit_to']").removeAttr('disabled'); + $("input[type='text'][name='limit_from']").removeAttr('disabled'); + } + }); +}); \ No newline at end of file diff --git a/js/functions.js b/js/functions.js index f03b9e3ff..a2292031f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1727,3 +1727,102 @@ $(document).ready(function(){ }); }); +/** + * Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected + */ +function toggle_enum_notice(selectElement) { + var enum_notice_id = selectElement.attr("id").split("_")[1]; + enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1); + var selectedType = selectElement.attr("value"); + if(selectedType == "ENUM" || selectedType == "SET") { + $("p[id='enum_notice_" + enum_notice_id + "']").show(); + } else { + $("p[id='enum_notice_" + enum_notice_id + "']").hide(); + } +} + +/** + * Toggle the hiding/showing of the "Open in ENUM/SET editor" message when + * the page loads and when the selected data type changes + */ +$(document).ready(function() { + $.each($("select[class='column_type']"), function() { + toggle_enum_notice($(this)); + }); + $("select[class='column_type']").change(function() { + toggle_enum_notice($(this)); + }); +}); + +/** + * Closes the ENUM/SET editor and removes the data in it + */ +function disable_popup() { + $("#popup_background").fadeOut("fast"); + $("#enum_editor").fadeOut("fast"); + // clear the data from the text boxes + $("#enum_editor #values input").remove(); + $("#enum_editor input[type='hidden']").remove(); +} + +/** + * Opens the ENUM/SET editor and controls its functions + */ +$(document).ready(function() { + $("a[class='open_enum_editor']").click(function() { + // Center the popup + var windowWidth = document.documentElement.clientWidth; + var windowHeight = document.documentElement.clientHeight; + var popupWidth = $("#enum_editor").width(); + var popupHeight = $("#enum_editor").height(); + var top = windowHeight/2 - popupHeight/2; + var left = windowWidth/2 - popupWidth/2; + $("#enum_editor").css({"position":"absolute", "top": top, "left": left}); + // Make it appear + $("#popup_background").css({"opacity":"0.7"}); + $("#popup_background").fadeIn("fast"); + $("#enum_editor").fadeIn("fast"); + // Get the values + var values = $(this).parent().prev("input").attr("value").split(","); + $.each(values, function(index, val) { + $("#enum_editor #values").append(""); + }); + // So we know which column's data is being edited + $("#enum_editor").append(""); + return false; + }); + + // If the "close" link is clicked, close the enum editor + $("a[class='close_enum_editor']").click(function() { + disable_popup(); + }); + + // If the "cancel" link is clicked, close the enum editor + $("a[class='cancel_enum_editor']").click(function() { + disable_popup(); + }); + + // When the submit button is clicked, put the data back into the original form if + // the "add x more values" checkbox is not checked. Otherwise, just insert x more + // textboxes + $("#enum_editor input[type='submit']").click(function() { + if($("input[type='checkbox'][name='add_extra_fields']").attr("checked")) { + for(i = 0; i < $("input[type='text'][name='extra_fields']").attr("value"); i++) { + $("#enum_editor #values").append(""); + } + // Uncheck it + $("input[type='checkbox'][name='add_extra_fields']").removeAttr("checked"); + } else { + var value_array = new Array(); + $.each($("#enum_editor #values input"), function(index, input_element) { + val = jQuery.trim(input_element.value); + if(val != "") { + value_array.push("'" + val + "'"); + } + }); + var values_id = $("#enum_editor input[type='hidden']").attr("value"); + $("input[id='" + values_id + "']").attr("value", value_array.join(",")); + disable_popup(); + } + }); +}); diff --git a/js/import.js b/js/import.js index 303405f29..f1ef6ebcb 100644 --- a/js/import.js +++ b/js/import.js @@ -5,53 +5,56 @@ * @version $Id$ */ + +/** + * 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--; + } + $("#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; + 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(); + } +} $(document).ready(function() { + // Initially display the options for the selected plugin + changePluginOpts(); - /** - * 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() { + // Whenever the selected plugin changes, change the options displayed + $("#plugins").change(function() { changePluginOpts(); }); @@ -61,5 +64,26 @@ $(document).ready(function() { $("#select_local_import_file").change(function() { matchFile($(this).attr("value")); - }) - }); \ No newline at end of file + }); + + /* + * When the "Browse the server" form is clicked or the "Select from the web server upload directory" + * form is clicked, the radio button beside it becomes selected and the other form becomes disabled. + */ + $("#input_import_file").focus(function() { + $("#radio_import_file").attr('checked', 'checked'); + $("#radio_local_import_file").removeAttr('checked'); + }); + $("#select_local_import_file").focus(function() { + $("#radio_local_import_file").attr('checked', 'checked'); + $("#radio_import_file").removeAttr('checked'); + }); + + /** + * Set up the interface for Javascript-enabled browsers since the default is for + * Javascript-disabled browsers + */ + $("#scroll_to_options_msg").hide(); + $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 }); + $(".format_specific_options h3").remove(); +}); \ No newline at end of file diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 6591715ec..f8e8e85d8 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 local 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 diff --git a/libraries/config.default.php b/libraries/config.default.php index 1aa5ee8e2..b8dd97eb3 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1306,7 +1306,7 @@ $cfg['Export']['csv_null'] = 'NULL'; * * @global string $cfg['Export']['csv_separator'] */ -$cfg['Export']['csv_separator'] = ';'; +$cfg['Export']['csv_separator'] = ','; /** * @@ -1539,7 +1539,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; /** * diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index fef74e062..9fcfe5570 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,6 +67,34 @@ if (! empty($sql_query)) { } ?> + + +
+

+ +
+
'; echo ''; ?> @@ -103,9 +131,32 @@ if (! empty($sql_query)) {
+ + +
+

+ +
+ +

- -
  • +
  • -

    Format:

    +

    +

    Scroll down to fill in the options for the selected format and ignore the options for other formats.

    - +
    +

    + +
    diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index 97ba08a94..023e4fbf1 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -25,7 +25,7 @@ if (empty($import_list)) { } ?> - +
    ajax clock @@ -120,6 +120,21 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { } echo ' '."\n"; ?> + + +

    File may be compressed (%s) or uncompressed.

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

    '), implode(", ", $compressions)); - } + 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']) { - $uid = uniqid(""); - ?>
    - - -
    - - - -
    -
    - +
      +
    • + + +
    • +
    • + + +
    • +
    + 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 - echo '
    ' . "\n"; +
    + ' . __('Character set of the file:') . ''; reset($cfg['AvailableCharsets']); @@ -204,8 +197,8 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { echo '' . "\n"; echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE); } // end if (recoding) - echo '
    ' . "\n"; ?> +

    @@ -251,15 +244,19 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {

    +

    Scroll down to fill in the options for the selected format and ignore the options for other formats.

    +
    +

    + +
    +
    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 fccc3d90b..a071a9810 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -18,7 +18,8 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( - array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated with:')), + array('type' => 'begin_group', 'name' => 'general_opts'), + array('type' => 'text', 'name' => 'separator', 'text' => __('Columns separated 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:')), @@ -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 2a8b438ed..8011e9541 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)'))); @@ -36,20 +38,20 @@ if (isset($plugin_list)) { 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')); + array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); } if (!empty($GLOBALS['cfgRelation']['mimework'])) { $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME types')); + array('type' => 'bool', 'name' => 'mime', 'text' => __('Display 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')); + $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_single-transaction')); /* disable foreign key checks */ - $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')); + $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'), 'doc' => array('manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks')); $plugin_list['sql']['options_text'] = __('Options'); @@ -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'][] = @@ -130,11 +134,11 @@ if (isset($plugin_list)) { /* begin SQL statements */ $plugin_list['sql']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Add statements:'))); + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Instead of INSERT statements, use:'))); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'delayed', 'text' => __('INSERT DELAYED')); + array('type' => 'bool', 'name' => 'delayed', 'text' => __('INSERT DELAYED statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert_delayed')); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'ignore', 'text' => __('INSERT IGNORE')); + array('type' => 'bool', 'name' => 'ignore', 'text' => __('INSERT IGNORE statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert')); $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); /* end SQL statements */ @@ -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..e87ab55ff 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -19,14 +19,16 @@ 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 (all are recommended)')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions')); $plugin_list['xml']['options'][] = @@ -37,12 +39,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'), ); diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 80a3d79f0..09e600446 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -22,9 +22,10 @@ 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), + array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns separated 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), @@ -36,9 +37,11 @@ if (isset($plugin_list)) { $plugin_list['csv']['options'][] = 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 { + $hint = new PMA_Message(__('If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.')); $plugin_list['csv']['options'][] = - array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')); + array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ' . PMA_showHint($hint))); } + $plugin_list['csv']['options'][] = array('type' => 'end_group'); /* We do not define function when plugin is just queried for information above */ return; @@ -116,7 +119,7 @@ if (!$analyze) { } } if (!$found) { - $message = PMA_Message::error(__('Invalid column (%s) specified!')); + $message = PMA_Message::error(__('Invalid column (%s) specified! Ensure that columns names are spelled correctly, separated by commas, and not enclosed in quotes.' )); $message->addParam($val); $error = TRUE; break; 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'), ); diff --git a/libraries/kanji-encoding.lib.php b/libraries/kanji-encoding.lib.php index e1590a312..4da2d078a 100644 --- a/libraries/kanji-encoding.lib.php +++ b/libraries/kanji-encoding.lib.php @@ -138,18 +138,16 @@ function PMA_kanji_file_conv($file, $enc, $kana) { */ function PMA_set_enc_form($spaces) { return "\n" - . "
    \n" - /* l10n: This is currently used only in Japanese locales */ - . $spaces . '' . __('Encoding conversion') . '' . "\n" - /* l10n: This is currently used only in Japanese locales */ + /* l10n: This is currently used only in Japanese locales */ + . $spaces . '
      ' . "\n" . '
    • ' . $spaces . '\n" . $spaces . '' . "\n" . $spaces . '' . "\n" - . $spaces . '
      ' + . $spaces . '
    • ' . "\n" . '
    • ' . $spaces . '' . "\n" /* l10n: This is currently used only in Japanese locales */ . $spaces . '
      ' . "\n" - . "
    \n" + . $spaces . '' . "\n" . '' ; } // end of the 'PMA_set_enc_form' function diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index ffaddec67..1c074789f 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -162,12 +162,11 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) $ret = '' . "\n"; @@ -179,7 +178,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) } else { $ret .= 'false'; } - $ret .= '">'. "\n"; + $ret .= '" />'. "\n"; } return $ret; } @@ -252,21 +251,30 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) if($key == $default) { $ret .= 'checked="checked"'; } - $ret .= '>' . ''; + $ret .= ' />' . ''; } } elseif ($opt['type'] == 'hidden') { - $ret .= ''; + $ret .= '
  • '; } elseif ($opt['type'] == 'begin_group') { - $ret .= '

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

      '; + $ret .= '
      '; + if (isset($opt['text'])) { + $ret .= '

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

      '; + } + $ret .= '
        '; } elseif ($opt['type'] == 'end_group') { $ret .= '
      '; } 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']) . '
        '; + $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . '
      • '; + } else { + $ret .= '>'; + } } elseif ($opt['type'] == 'end_subgroup') { - $ret .= '
      '; + $ret .= '
    '; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ @@ -280,6 +288,10 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) } } + // Close the list element after $opt['doc'] link is displayed + if($opt['type'] == 'bool' || $opt['type'] == 'text' || $opt['type'] == 'message_only' || $opt['type'] == 'select') { + $ret .= ''; + } $ret .= "\n"; return $ret; } @@ -302,22 +314,21 @@ function PMA_pluginGetOptions($section, &$list) $default = PMA_pluginGetDefault('Export', 'format'); // Options for plugins that support them foreach ($list as $plugin_name => $val) { - $ret .= '
    '; $count = 0; + $ret .= '

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

    '; if (isset($val['options']) && count($val['options']) > 0) { foreach ($val['options'] as $id => $opt) { - if ($opt['type'] != 'hidden') $count++; + if ($opt['type'] != 'hidden' && $opt['type'] != 'begin_group' && $opt['type'] != 'end_group' && $opt['type'] != 'begin_subgroup' && $opt['type'] != 'end_subgroup') { + $count++; + } $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt); } } if ($count == 0) { - $ret .= __('This format has no options'); + $ret .= __('

    This format has no options

    '); } - $ret .= '
    '; + $ret .= '
    '; } return $ret; } diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index 0d00d17ec..e0a91546c 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -279,8 +279,9 @@ for ($i = 0; $i < $num_fields; $i++) { $ci++; // column type - $content_cells[$i][$ci] = ''; if (empty($row['Type'])) { // creating a column @@ -367,7 +368,11 @@ for ($i = 0; $i < $num_fields; $i++) { $content_cells[$i][$ci] = ''; + . ' class="textfield" />' + . '

    '; + $content_cells[$i][$ci] .= __('ENUM or SET data too long?') + . ' ' + . __('Get more editing space') . '

    '; $ci++; // column default @@ -789,3 +794,13 @@ if ($action == 'tbl_create.php') {
    + +
    +Close +

    Enter each value in a separate field.

    +
    +

    Add more values

    + Cancel +
    + + \ No newline at end of file diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index c4b8cda00..fe64ca925 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -57,11 +57,12 @@ pre, tt, code { font-size: 110%; } -a:link, +a, a:link, a:visited, a:active { text-decoration: none; color: #333399; + cursor: pointer; } a:hover { @@ -1202,6 +1203,10 @@ label.desc { float: ; } +label.desc sup { + position: absolute; +} + code.sql { display: block; padding: 0.3em; @@ -1296,3 +1301,152 @@ table#serverconnection_trg_local { */ .invalid_value {background:#F00;} + +/** + * Export and Import styles + */ +.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 label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.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: 11px; + border-radius: 11px; + 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; + cursor: pointer; +} + +.format_specific_options h3 { + margin: 10px 0px 0px 10px; + border: 0px; +} + +.format_specific_options { + border: 1px solid #999999; + margin: 7px 0px; + padding: 3px; +} + +p.desc { + margin: 5px; +} + +/** + * Export styles only + */ +select#db_select, select#table_select { + width: 400px; +} + +.export_sub_options { + margin: 20px 0px 0px 30px; +} + +.export_sub_options h4 { + border-bottom: 1px #999999 solid; +} + +/** + * Import styles only + */ + +.importoptions #import_notification { + margin: 10px 0px; + font-style: italic; +} + +input#input_import_file { + margin: 5px; +} + +.formelementrow { + margin: 5px 0px 5px 0px; +} + +/** + * ENUM/SET editor styles + */ +p.enum_notice { + margin: 5px 2px; + font-size: 80%; +} + +#enum_editor { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + z-index: 101; + overflow: auto; +} + +#enum_editor_no_js { + margin: auto auto; +} + +#enum_editor, #enum_editor_no_js { + width: 50%; + height: 80%; + background: #D0DCE0; + padding: 15px; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + width: 100%; + height: 100%; + top: 0; + left: 0; + background: #000; + z-index: 100; +} + +a.close_enum_editor { + float: right; +} + +#enum_editor #values, #enum_editor_no_js #values { + margin: 15px 0px; +} + +#enum_editor #values input, #enum_editor_no_js #values input { + margin: 5px 0px; + float: top; + width: 100%; +} + +#enum_editor input, #enum_editor_no_js input { + float: bottom; +} + +#enum_editor_output { + margin-top: 50px; +} \ No newline at end of file diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 40189623a..3189a0840 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -53,11 +53,12 @@ h3 { font-weight: bold; } -a:link, +a, a:link, a:visited, a:active { text-decoration: none; color: #0000FF; + cursor: pointer; } a:hover { @@ -1153,6 +1154,10 @@ label.desc { float: ; } +label.desc sup { + position: absolute; +} + code.sql { display: block; padding: 0.3em; @@ -1230,14 +1235,12 @@ table#serverconnection_trg_local { {background:#F00;} /** - * Export styles + * Export and Import styles */ -select#db_select, select#table_select { - width: 400px; -} .exportoptions h3, .importoptions h3 { border-bottom: 1px #999999 solid; + font-size: 110%; } .exportoptions ul, .importoptions ul, .format_specific_options ul { @@ -1248,50 +1251,139 @@ select#db_select, select#table_select { .exportoptions li, .importoptions li { margin: 7px; } - -.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { +.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { margin: 5px; float: none; } -#csv_options .desc, #latex_options .desc, #output .desc{ +#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{ float: left; width: 15em; } .exportoptions, .importoptions { - margin: 30px 30px 30px 10px + margin: 20px 30px 30px 10px } .exportoptions #buttonGo, .importoptions #buttonGo { padding: 5px 30px; -moz-border-radius: 11px; - -webkit-border-radius: + -webkit-border-radius: 11px; + border-radius: 11px; 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; +.format_specific_options h3 { + margin: 10px 0px 0px 10px; + border: 0px; } -.export_sub_options h4 { - border-bottom: 1px #999999 solid; -} - -.importoptions #import_notification { - margin: 10px 0px; - font-style: italic; +.format_specific_options { + border: 1px solid #999999; + margin: 7px 0px; + padding: 3px; } p.desc { margin: 5px; } +/** + * Export styles only + */ +select#db_select, select#table_select { + width: 400px; +} + +.export_sub_options { + margin: 20px 0px 0px 30px; +} + +.export_sub_options h4 { + border-bottom: 1px #999999 solid; +} + +#quick_or_custom, #output_quick_export { + display: none; +} +/** + * Import styles only + */ + +.importoptions #import_notification { + margin: 10px 0px; + font-style: italic; +} + +input#input_import_file { + margin: 5px; +} + .formelementrow { margin: 5px 0px 5px 0px; } + +/** + * ENUM/SET editor styles + */ +p.enum_notice { + margin: 5px 2px; + font-size: 80%; +} + +#enum_editor { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + z-index: 101; + overflow: auto; +} + +#enum_editor_no_js { + margin: auto auto; +} + +#enum_editor, #enum_editor_no_js { + width: 50%; + height: 80%; + background: #D0DCE0; + padding: 15px; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + width: 100%; + height: 100%; + top: 0; + left: 0; + background: #000; + z-index: 100; +} + +a.close_enum_editor { + float: right; +} + +#enum_editor #values, #enum_editor_no_js #values { + margin: 15px 0px; +} + +#enum_editor #values input, #enum_editor_no_js #values input { + margin: 5px 0px; + float: top; + width: 100%; +} + +#enum_editor input, #enum_editor_no_js input { + float: bottom; +} + +#enum_editor_output { + margin-top: 50px; +} \ No newline at end of file