diff --git a/Documentation.html b/Documentation.html index edfad9bdc..2238acf1c 100644 --- a/Documentation.html +++ b/Documentation.html @@ -2021,6 +2021,14 @@ setfacl -d -m "g:www-data:rwx" tmp identify what they mean. +
$cfg['Export']['method'] string
+
+ Defines how the export form is displayed when it loads. Valid values are: +
  • quick to display the minimum number of options to configure
  • +
  • custom to display every available option to configure
  • +
  • custom-no-form same as custom but does not display the option of using quick export
  • +
    +
    $cfg['Import'] array
    In this array are defined default parameters for import, names of diff --git a/db_export.php b/db_export.php index a44469ef2..a24ed18d7 100644 --- a/db_export.php +++ b/db_export.php @@ -15,6 +15,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'; @@ -38,20 +40,32 @@ $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)) { $table_select = $selected_tbl; } +// Check if the selected tables are defined in $_GET (from clicking Back button on export.php) +if(isset($_GET['table_select'])) { + $_GET['table_select'] = urldecode($_GET['table_select']); + $_GET['table_select'] = explode(",", $_GET['table_select']); +} + foreach ($tables as $each_table) { - if (! empty($unselectall) + if(isset($_GET['table_select'])) { + if(in_array($each_table['Name'], $_GET['table_select'])) { + $is_selected = ' selected="selected"'; + } else { + $is_selected = ''; + } + } elseif (! empty($unselectall) || (! empty($table_select) && !in_array($each_table['Name'], $table_select))) { $is_selected = ''; } else { @@ -64,7 +78,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 73ba817fa..f39f7c8cf 100644 --- a/db_import.php +++ b/db_import.php @@ -10,6 +10,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'import.js'; + /** * Gets tables informations and displays top links */ diff --git a/enum_editor.php b/enum_editor.php new file mode 100644 index 000000000..f7397ea0e --- /dev/null +++ b/enum_editor.php @@ -0,0 +1,75 @@ + + + + + +
    +
    +

    +

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

    + + + Restart insertion and add a new value + +

    + + + + + + +
    +

    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 00639e22a..1a5d6e645 100644 --- a/export.php +++ b/export.php @@ -41,7 +41,15 @@ $compression = false; $onserver = false; $save_on_server = false; $buffer_needed = false; -if (empty($_REQUEST['asfile'])) { + +// 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 { $asfile = true; @@ -49,8 +57,12 @@ if (empty($_REQUEST['asfile'])) { $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; } @@ -261,7 +273,13 @@ if ($asfile) { $filename = PMA_convert_string($charset, 'iso-8859-1', $filename); // Grab basic dump extension and mime type - $filename .= '.' . $export_list[$type]['extension']; + // Check if the user already added extension; get the substring where the extension would be if it was included + $extension_start_pos = strlen($filename) - strlen($export_list[$type]['extension']) - 1; + $user_extension = substr($filename, $extension_start_pos, strlen($filename)); + $required_extension = "." . $export_list[$type]['extension']; + if(strtolower($user_extension) != $required_extension) { + $filename .= $required_extension; + } $mime_type = $export_list[$type]['mime_type']; // If dump is going to be compressed, set correct mime_type and add @@ -282,7 +300,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 { @@ -360,6 +378,32 @@ if (!$save_on_server) { unset($backup_cfgServer); echo "\n" . '
    ' . "\n"; //echo '
    ' . "\n";
    +
    +        /**
    +         * Displays a back button with all the $_REQUEST data in the URL (store in a variable to also display after the textarea)
    +         */
    +         $back_button = '

    [ $value) { + $back_button .= '&' . urlencode($name) . '=' . urlencode($value); + } + $back_button .= '&repopulate=1">Back ]

    '; + + echo $back_button; echo '
    ' . "\n" // remove auto-select for now: there is no way to select // only a part of the text; anyway, it should obey @@ -380,7 +424,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) { $cfgRelation = PMA_getRelationsParam(); @@ -420,7 +464,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)) { @@ -428,7 +472,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; @@ -436,7 +480,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; } @@ -444,7 +488,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; } @@ -469,7 +513,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)) { @@ -477,7 +521,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; @@ -485,7 +529,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; } @@ -493,7 +537,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; } @@ -518,7 +562,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; } @@ -526,7 +570,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)) { @@ -544,7 +588,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; } @@ -640,9 +684,11 @@ else { /** * Close the html tags and add the footers in dump is displayed on screen */ - //echo '
    ' . "\n"; echo '' . "\n" . ' ' . "\n"; + echo $back_button; + + echo "\n"; echo '
    ' . "\n"; echo "\n"; ?> diff --git a/js/export.js b/js/export.js new file mode 100644 index 000000000..8f5cba563 --- /dev/null +++ b/js/export.js @@ -0,0 +1,221 @@ +/* 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 + */ + +function toggle_structure_data_opts(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'); + } + } +} + +$(document).ready(function() { + $("input[type='radio'][name='latex_structure_or_data']").change(function() { + toggle_structure_data_opts("latex"); + }); + $("input[type='radio'][name='odt_structure_or_data']").change(function() { + toggle_structure_data_opts("odt"); + }); + $("input[type='radio'][name='texytext_structure_or_data']").change(function() { + toggle_structure_data_opts("texytext"); + }); + $("input[type='radio'][name='htmlword_structure_or_data']").change(function() { + toggle_structure_data_opts("htmlword"); + }); + $("input[type='radio'][name='sql_structure_or_data']").change(function() { + toggle_structure_data_opts("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 + */ +function toggle_sql_include_comments() { + $("#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 { + // If structure is not being exported, the comment options for structure should not be enabled + if($("#radio_sql_structure_or_data_data:checked").length == 1) { + $("#text_sql_header_comment").parent("li").fadeTo('fast', 1); + $("#text_sql_header_comment").removeAttr('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/unchecked, 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); + } + }); +}); + +/** + * Toggles display of options when quick and custom export are selected + */ +function toggle_quick_or_custom() { + 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(); + } +} + +$(document).ready(function() { + $("input[type='radio'][name='quick_or_custom']").change(function() { + toggle_quick_or_custom(); + }); +}); + +/** + * Sets up the interface for Javascript-enabled browsers since the default is for + * Javascript-disabled browsers + */ + $(document).ready(function() { + if($("input[type='hidden'][name='export_method']").attr("value") != "custom-no-form") { + $("#quick_or_custom").show(); + } + $("#scroll_to_options_msg").hide(); + $(".format_specific_options").hide(); + $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0}); + $(".format_specific_options h3").remove(); + toggle_quick_or_custom(); + toggle_structure_data_opts($("select[id='plugins']").attr("value")); + toggle_sql_include_comments(); +}); + +/** + * Disables the "Dump some row(s)" sub-options when it is not selected + */ + $(document).ready(function() { + $("input[type='radio'][name='allrows']").change(function() { + 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 3ebdcbfc7..2d57f3b48 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1697,3 +1697,200 @@ $(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 = windowWidth/2; + var popupHeight = windowHeight*0.8; + var popupOffsetTop = windowHeight/2 - popupHeight/2; + var popupOffsetLeft = windowWidth/2 - popupWidth/2; + $("#enum_editor").css({"position":"absolute", "top": popupOffsetTop, "left": popupOffsetLeft, "width": popupWidth, "height": popupHeight}); + + // 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) { + if(jQuery.trim(val) != "") { + // enclose the string in single quotes if it's not already + if(val.substr(0, 1) != "'") { + val = "'" + val; + } + if(val.substr(val.length-1, val.length) != "'") { + val = val + "'"; + } + // escape the single quotes, except the mandatory ones enclosing the entire string + val = val.substr(1, val.length-2).replace(/'/g, "'"); + // escape the greater-than symbol + val = val.replace(/>/g, ">"); + $("#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 "add a new value" is clicked, append an empty text field + $("a[class='add_value']").click(function() { + $("#enum_editor #values").append(""); + }); + + // When the submit button is clicked, put the data back into the original form + $("#enum_editor input[type='submit']").click(function() { + 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 + "'"); + } + }); + // get the Length/Values text field where this value belongs + var values_id = $("#enum_editor input[type='hidden']").attr("value"); + $("input[id='" + values_id + "']").attr("value", value_array.join(",")); + disable_popup(); + }); + + /** + * Hides certain table structure actions, replacing them with the word "More". They are displayed + * in a dropdown menu when the user hovers over the word "More." + */ + // Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers) + // if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point) + if($("input[type='hidden'][name='table_type']").attr("value") == "table") { + $("table[id='tablestructure'] td[class='browse']").remove(); + $("table[id='tablestructure'] td[class='primary']").remove(); + $("table[id='tablestructure'] td[class='unique']").remove(); + $("table[id='tablestructure'] td[class='index']").remove(); + $("table[id='tablestructure'] td[class='fulltext']").remove(); + $("table[id='tablestructure'] th[class='action']").attr("colspan", 3); + + // Display the "more" text + $("table[id='tablestructure'] td[class='more_opts']").show() + + // Position the dropdown + $.each($(".structure_actions_dropdown"), function() { + // The top offset must be set for IE even if it didn't change + var cell_right_edge_offset = $(this).parent().offset().left + $(this).parent().innerWidth(); + var left_offset = cell_right_edge_offset - $(this).innerWidth(); + var top_offset = $(this).parent().offset().top + $(this).parent().innerHeight(); + $(this).offset({ top: top_offset, left: left_offset }); + }); + + // A hack for IE6 to prevent the after_field select element from being displayed on top of the dropdown by + // positioning an iframe directly on top of it + $("iframe[class='IE_hack']").width($("select[name='after_field']").width()); + $("iframe[class='IE_hack']").height($("select[name='after_field']").height()); + $("iframe[class='IE_hack']").offset({ top: $("select[name='after_field']").offset().top, left: $("select[name='after_field']").offset().left }); + + // When "more" is hovered over, show the hidden actions + $("table[id='tablestructure'] td[class='more_opts']").mouseenter( + function() { + if($.browser.msie && $.browser.version == "6.0") { + $("iframe[class='IE_hack']").show(); + $("iframe[class='IE_hack']").width($("select[name='after_field']").width()+4); + $("iframe[class='IE_hack']").height($("select[name='after_field']").height()+4); + $("iframe[class='IE_hack']").offset({ top: $("select[name='after_field']").offset().top, left: $("select[name='after_field']").offset().left}); + } + $(".structure_actions_dropdown").hide(); // Hide all the other ones that may be open + $(this).children(".structure_actions_dropdown").show(); + // Need to do this again for IE otherwise the offset is wrong + if($.browser.msie) { + var left_offset_IE = $(this).offset().left + $(this).innerWidth() - $(this).children(".structure_actions_dropdown").innerWidth(); + var top_offset_IE = $(this).offset().top + $(this).innerHeight(); + $(this).children(".structure_actions_dropdown").offset({ top: top_offset_IE, left: left_offset_IE }); + } + }); + $(".structure_actions_dropdown").mouseleave(function() { + $(this).hide(); + if($.browser.msie && $.browser.version == "6.0") { + $("iframe[class='IE_hack']").hide(); + } + }); + } +}); + +/* Displays tooltips */ +$(document).ready(function() { + // Hide the footnotes from the footer (which are displayed for + // JavaScript-disabled browsers) since the tooltip is sufficient + $(".footnotes").hide(); + $(".footnotes span").each(function() { + $(this).children("sup").remove(); + }); + // The border and padding must be removed otherwise a thin yellow box remains visible + $(".footnotes").css("border", "none"); + $(".footnotes").css("padding", "0px"); + + // Replace the superscripts with the help icon + $("sup[class='footnotemarker']").hide(); + $("img[class='footnotemarker']").show(); + + $("img[class='footnotemarker']").each(function() { + var span_id = $(this).attr("id"); + span_id = span_id.split("_")[1]; + var tooltip_text = $(".footnotes span[id='footnote_" + span_id + "']").html(); + $(this).qtip({ + content: tooltip_text, + show: { delay: 0 }, + hide: { when: 'unfocus', delay: 0 }, + style: { background: '#ffffcc' } + }); + }); +}); \ No newline at end of file diff --git a/js/import.js b/js/import.js new file mode 100644 index 000000000..be7938886 --- /dev/null +++ b/js/import.js @@ -0,0 +1,83 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions used in the import tab + * + * @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) { + var fname_array = fname.toLowerCase().split("."); + var len = fname_array.length; + if(len != 0) { + var extension = fname_array[len - 1]; + if (extension == "gz" || extension == "bz2" || extension == "zip") { + len--; + } + // Only toggle if the format of the file can be imported + if($("select[name='format'] option[value='" + fname_array[len - 1] + "']").length == 1) { + $("#plugins option:selected").removeAttr("selected"); + $("select[name='format'] option[value='" + fname_array[len - 1] + "']").attr('selected', 'selected'); + changePluginOpts(); + } + } +} +$(document).ready(function() { + // Initially display the options for the selected plugin + changePluginOpts(); + + // Whenever the selected plugin changes, change the options displayed + $("#plugins").change(function() { + changePluginOpts(); + }); + + $("#input_import_file").change(function() { + matchFile($(this).attr("value")); + }); + + $("#select_local_import_file").change(function() { + matchFile($(this).attr("value")); + }); + + /* + * 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/js/jquery.qtip-1.0.0.min.js b/js/jquery.qtip-1.0.0.min.js new file mode 100644 index 000000000..2d1b70264 --- /dev/null +++ b/js/jquery.qtip-1.0.0.min.js @@ -0,0 +1,15 @@ +/* + * jquery.qtip. The jQuery tooltip plugin + * + * Copyright (c) 2009 Craig Thompson + * http://craigsworks.com + * + * Licensed under MIT + * http://www.opensource.org/licenses/mit-license.php + * + * Launch : February 2009 + * Version : 1.0.0-rc3 + * Released: Tuesday 12th May, 2009 - 00:00 + * Debug: jquery.qtip.debug.js + */ +(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;CG.dimensions.width){G.dimensions.width=J[C]}if(J[C]G.dimensions.height){G.dimensions.height=J[C]}if(J[C]0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","
    ");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","
    ");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='
    ';if(f("").get(0).getContext){u[z]+=''}else{if(f.browser.msie){G=B*2+3;u[z]+=''}}u[z]+="
    "}D=F.getDimensions().width-(Math.max(t,B)*2);y='
    ';w='
    '+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='
    '+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='
    ';if(f("").get(0).getContext){t.elements.tip+=''}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='';t.elements.tip+='';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"
    ");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('
    ').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t=' +
    ajax clock @@ -119,60 +119,67 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { echo PMA_generate_common_hidden_inputs($db, $table, 1); } echo ' '."\n"; - echo PMA_pluginGetJavascript($import_list); ?> -
    - - -
    - - -
    - - - -
    -
    + + +
    +

    + $val) { - if (!empty($extensions)) { - $extensions .= '|'; - } - $extensions .= $val['extension']; - } - $matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@'; + 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 != array()) { + printf(__('
    File may be compressed (%s) or uncompressed.
    A compressed file\'s name must end in .[format].[compression]. Example: .sql.zip
    '), implode(", ", $compressions)); + }?> - $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"; +
    + +
      +
    • + + +
    • +
    • + + +
    • +
    + display(); + } 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']); @@ -190,32 +197,11 @@ 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"; - -// 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 '
    '; - ?> +
    +

    +

    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 e0898934e..8e36f408f 100644 --- a/libraries/export/codegen.php +++ b/libraries/export/codegen.php @@ -31,9 +31,11 @@ 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' => '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 b4d081032..0d872426c 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -17,14 +17,16 @@ 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' => '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:')), + 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'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/excel.php b/libraries/export/excel.php index 9e01fedb2..08961eb13 100644 --- a/libraries/export/excel.php +++ b/libraries/export/excel.php @@ -18,8 +18,9 @@ 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' => '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')), array( 'type' => 'select', @@ -28,8 +29,9 @@ 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'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index ffaf5f272..f5425bc4e 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -19,11 +19,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_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_group'), + /* 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/json.php b/libraries/export/json.php index 5a092654c..ce1430d8d 100644 --- a/libraries/export/json.php +++ b/libraries/export/json.php @@ -16,10 +16,12 @@ if (isset($plugin_list)) { 'extension' => 'json', 'mime_type' => 'text/plain', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'hidden', 'name' => 'data', ), + array('type' => 'end_group') ), 'options_text' => 'strOptions', ); diff --git a/libraries/export/latex.php b/libraries/export/latex.php index 056b69f33..5ff186891 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -27,48 +27,58 @@ 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_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_group'); + /* 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'), 'doc' => 'faq6_27'); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27'); + array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27'); $plugin_list['latex']['options'][] = array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27'); 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'), 'doc' => 'faq6_27'); $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27'); + array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27'); $plugin_list['latex']['options'][] = array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27'); $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..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' => 'hidden', 'name' => 'data'), + 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 0cd3cdce8..28a5dfd4c 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -19,9 +19,11 @@ 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' => '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' => 'data'), + 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 408c54efe..b70388dd3 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -25,32 +25,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_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_group'); + /* 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 f478a11b8..10b4ea479 100644 --- a/libraries/export/pdf.php +++ b/libraries/export/pdf.php @@ -19,9 +19,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' => 'data'), + 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 7d1fb5e8c..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' => 'data', + 'name' => 'structure_or_data', ), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/sql.php b/libraries/export/sql.php index e0a69b87d..60a0864ba 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -24,14 +24,37 @@ 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()); + + $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)'))); + $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' => __('Display foreign key relationships')); + } + if (!empty($GLOBALS['cfgRelation']['mimework'])) { + $plugin_list['sql']['options'][] = + 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'), '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'), 'doc' => array('manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks')); + + $plugin_list['sql']['options_text'] = __('Options'); + + /* compatibility maximization */ $compats = PMA_DBI_getCompatibilities(); if (count($compats) > 0) { $values = array(); @@ -39,88 +62,116 @@ 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'); + + $plugin_list['sql']['options'][] = array('type' => 'end_group'); + + /* 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' => __('Instead of INSERT statements, use:'))); $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 statements'), 'doc' => array('manual_MySQL_Database_Administration', '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 statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert')); + $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 { @@ -386,7 +437,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; } @@ -400,7 +451,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; } @@ -414,7 +465,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; } @@ -950,7 +1001,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 @@ -965,7 +1016,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 { @@ -1029,7 +1080,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..8ed6a742a 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_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_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')), + array('type' => 'end_group'), + ), 'options_text' => __('Options'), ); } else { diff --git a/libraries/export/xls.php b/libraries/export/xls.php index cc291380a..599025d63 100644 --- a/libraries/export/xls.php +++ b/libraries/export/xls.php @@ -19,9 +19,11 @@ 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' => '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' => 'data'), + 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 f3cc84902..89c528857 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -19,9 +19,11 @@ 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' => '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' => 'data'), + 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 470aaeb08..9bafb0998 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -18,30 +18,34 @@ if (isset($plugin_list)) { 'extension' => 'xml', 'mime_type' => 'text/xml', 'options' => array( - array('type' => 'hidden', 'name' => 'data'), + 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' => 'bgroup', 'name' => 'export_struc', 'text' => __('Export Structure Schemas (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' => __('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')); - $plugin_list['xml']['options'][] = - array('type' => 'egroup'); + array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views')); + $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 c44499805..bcf404efa 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -19,10 +19,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' => 'data', + 'name' => 'structure_or_data', ), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/footer.inc.php b/libraries/footer.inc.php index ee76e917a..715cf3b82 100644 --- a/libraries/footer.inc.php +++ b/libraries/footer.inc.php @@ -64,7 +64,7 @@ if ($GLOBALS['error_handler']->hasDisplayErrors()) { } if (count($GLOBALS['footnotes'])) { - echo '
    '; + echo '
    '; foreach ($GLOBALS['footnotes'] as $footnote) { echo '' . $footnote['nr'] . ' ' . $footnote['note'] . '
    '; diff --git a/libraries/header_scripts.inc.php b/libraries/header_scripts.inc.php index 8021c3454..94aff1a71 100644 --- a/libraries/header_scripts.inc.php +++ b/libraries/header_scripts.inc.php @@ -31,18 +31,13 @@ $title = PMA_expandUserString( $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser(); $GLOBALS['js_include'][] = 'functions.js'; -$GLOBALS['js_include'][] = 'tooltip.js'; +$GLOBALS['js_include'][] = 'jquery.qtip-1.0.0.min.js'; $params = array('lang' => $GLOBALS['lang']); if (isset($GLOBALS['db'])) { $params['db'] = $GLOBALS['db']; } $GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params); -$GLOBALS['js_events'][] = array( - 'event' => 'load', - 'function' => 'PMA_TT_init', -); - /** * Here we add a timestamp when loading the file, so that users who * upgrade phpMyAdmin are not stuck with older .js files in their diff --git a/libraries/import/csv.php b/libraries/import/csv.php index d444950cb..b6e635b82 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -21,23 +21,26 @@ 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 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 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), ), '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 { + $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; @@ -115,7 +118,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; @@ -358,7 +361,7 @@ if ($analyze) { } } - if ($_REQUEST['csv_col_names']) { + if (isset($_REQUEST['csv_col_names'])) { $col_names = array_splice($rows, 0, 1); $col_names = $col_names[0]; } diff --git a/libraries/import/docsql.php b/libraries/import/docsql.php index 7a5e1db1c..a64a09410 100644 --- a/libraries/import/docsql.php +++ b/libraries/import/docsql.php @@ -27,7 +27,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 adf42c1b9..39d42ed8d 100644 --- a/libraries/import/ldi.php +++ b/libraries/import/ldi.php @@ -34,6 +34,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), @@ -42,6 +43,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 395a8fc6d..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' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')), + 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 (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)')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/sql.php b/libraries/import/sql.php index e6e7725e6..fe62ca571 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -25,10 +25,11 @@ if (isset($plugin_list)) { $values[$val] = $val; } $plugin_list['sql']['options'] = array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'select', 'name' => 'compatibility', - 'text' => __('SQL compatibility mode'), + 'text' => __('SQL compatibility mode:'), 'values' => $values, 'doc' => array( 'manual_MySQL_Database_Administration', @@ -38,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', @@ -46,6 +47,7 @@ if (isset($plugin_list)) { ), ), + array('type' => 'end_group'), ); } diff --git a/libraries/import/xls.php b/libraries/import/xls.php index e6ac76ffe..6d5c0e218 100644 --- a/libraries/import/xls.php +++ b/libraries/import/xls.php @@ -20,7 +20,9 @@ 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' => '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 00cadde35..54796230f 100644 --- a/libraries/import/xlsx.php +++ b/libraries/import/xlsx.php @@ -20,7 +20,9 @@ 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' => '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 74e7698f4..1f17ef719 100644 --- a/libraries/kanji-encoding.lib.php +++ b/libraries/kanji-encoding.lib.php @@ -137,18 +137,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 b2c441b3d..ffa5cb432 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -60,6 +60,7 @@ function PMA_getString($name) * returns html input tag option 'checked' if plugin $opt should be set by config or request * * @uses $_REQUEST + * @uses $_GET * @uses $GLOBALS['cfg'] * @uses $GLOBALS['timeout_passed'] * @param string $section name of config section in @@ -69,8 +70,9 @@ function PMA_getString($name) */ function PMA_pluginCheckboxCheck($section, $opt) { - if ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) || - (isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt])) { + // If the form is being repopulated using $_GET data, that is priority + if (isset($_GET[$opt]) || !isset($_GET['repopulate']) && ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) || + (isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt]))) { return ' checked="checked"'; } return ''; @@ -83,6 +85,7 @@ function PMA_pluginCheckboxCheck($section, $opt) * * @uses htmlspecialchars() * @uses $_REQUEST + * @uses $_GET * @uses $GLOBALS['cfg'] * @uses $GLOBALS['timeout_passed'] * @param string $section name of config section in @@ -92,7 +95,9 @@ function PMA_pluginCheckboxCheck($section, $opt) */ function PMA_pluginGetDefault($section, $opt) { - if (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) { + if(isset($_GET[$opt])) { // If the form is being repopulated using $_GET data, that is priority + return htmlspecialchars($_GET[$opt]); + } elseif (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) { return htmlspecialchars($_REQUEST[$opt]); } elseif (isset($GLOBALS['cfg'][$section][$opt])) { $matches = array(); @@ -141,37 +146,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; } @@ -179,7 +191,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() @@ -195,7 +207,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'] == 'hidden') { - $ret .= ''; - } elseif ($opt['type'] == 'bgroup') { - $ret .= '
    '; - /* No checkbox without name */ - if (!empty($opt['name'])) { - $ret .= ' $val) { + $ret .= '
  • ' - . PMA_getString($opt['text']) . ''; - } else { - $ret .= PMA_getString($opt['text']); + $ret .= ' />' . '
  • '; } - $ret .= '
    '; - } elseif ($opt['type'] == 'egroup') { - $ret .= '
    '; + } elseif ($opt['type'] == 'hidden') { + $ret .= '
  • '; + } elseif ($opt['type'] == 'begin_group') { + $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']) . '
  • '; + } else { + $ret .= '>'; + } + } elseif ($opt['type'] == 'end_subgroup') { + $ret .= '
  • '; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ @@ -280,6 +294,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]); } } + + // 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; } @@ -287,10 +306,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 @@ -298,84 +318,24 @@ 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 .= '
    '; $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; } - -/** - * 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/libraries/select_server.lib.php b/libraries/select_server.lib.php index e6804fc02..f71f7cde0 100644 --- a/libraries/select_server.lib.php +++ b/libraries/select_server.lib.php @@ -35,13 +35,13 @@ function PMA_select_server($not_only_options, $ommit_fieldset) if (! $ommit_fieldset) { echo '
    '; } - echo ' '; + echo ' '; echo ''; + $select_id = 'field_' . $i . '_' . ($ci - $ci_offset); + $content_cells[$i][$ci] = ''; + . ' class="textfield" />' + . '

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

    '; $ci++; // column default @@ -787,3 +792,14 @@ if ($action == 'tbl_create.php') {
    + + + + \ No newline at end of file diff --git a/main.php b/main.php index 08faf4959..3933c94aa 100644 --- a/main.php +++ b/main.php @@ -54,17 +54,16 @@ if ($server > 0) { // should we add the port info here? $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose']) - ? $GLOBALS['cfg']['Server']['verbose'] - : $GLOBALS['cfg']['Server']['host']); + ? $GLOBALS['cfg']['Server']['verbose'] + : $GLOBALS['cfg']['Server']['host']); } echo '
    ' . "\n"; echo '
    '; - if ($server > 0 || (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)) { echo '
    '; - echo '

    ' . __('Actions') . '

    '; + echo '

    ' . __('General Settings') . '

    '; echo '
      '; /** @@ -90,52 +89,27 @@ if ($server > 0 PMA_printListItem(__('Change password'), 'li_change_password', './user_password.php?' . $common_url_query); } - - $http_logout = ($cfg['Server']['auth_type'] == 'http') - ? '' - . ($cfg['ReplaceHelpImg'] ? 'Info' : '(*)') . '' - : ''; - PMA_printListItem('' . __('Log out') . ' ' . $http_logout, - 'li_log_out', - './index.php?' . $common_url_query . '&old_usr=' . urlencode($PHP_AUTH_USER), null, '_parent'); } // end if - } // end of if ($server > 0) + echo '
    • '; + echo '
      ' . "\n" + . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection') + . ' ' . "\n" + . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true) + . ' ' . "\n" + . '
      ' . "\n" + . '
    • ' . "\n"; + } // end of if ($server > 0) echo '
    '; echo '
    '; } - -if ($server > 0) { - echo '
    '; - echo '

    MySQL ' . $short_server_info . '

    '; - echo '
      ' . "\n"; - - if ($cfg['ShowCreateDb']) { - echo '
    • '; - require './libraries/display_create_database.lib.php'; - echo '
    • ' . "\n"; - } - - echo '
    • '; - echo '
      ' . "\n" - . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection') - . ' ' . "\n" - . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true) - . ' ' . "\n" - // put the doc link in the form so that it appears on the same line - . PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n" - . '
      ' . "\n" - . '
    • ' . "\n"; - - echo '
    '; - echo '
    '; -} - echo '
    '; -echo '

    ' . __('Interface') . '

    '; +echo '

    ' . __('Appearance Settings') . '

    '; echo '
      '; // Displays language selection combo @@ -155,14 +129,13 @@ if ($GLOBALS['cfg']['ThemeManager']) { // see js/main_custom_color.js echo '
    • '; - echo PMA_escapeJsString(__('Custom color')) . ': '; + echo PMA_escapeJsString(__('Background color')) . ': '; + echo ''; echo '
      '; echo PMA_generate_common_hidden_inputs(); echo ''; echo ''; echo '
      '; - echo '
      '; - echo '
      '; echo '
    • '; } echo '
    • '; diff --git a/navigation.php b/navigation.php index cd9ca7d31..7d6d66c83 100644 --- a/navigation.php +++ b/navigation.php @@ -229,18 +229,13 @@ if (! $GLOBALS['server']) { echo '' . "\n" - .'' . "\n"; + .'' . "\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"; - } } ?> @@ -294,7 +289,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) { if ($table_count) { ?> - + X '; +$multi_values = '
    '; $multi_values .= '' . __('Select All') . ' / ' . __('Unselect All') . '
    '; -$multi_values .= ''; $multi_values .= "\n"; +// Check if the selected databases are defined in $_GET (from clicking Back button on export.php) +if(isset($_GET['db_select'])) { + $_GET['db_select'] = urldecode($_GET['db_select']); + $_GET['db_select'] = explode(",", $_GET['db_select']); +} + foreach ($GLOBALS['pma']->databases as $current_db) { - if (!empty($selectall) || (isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))) { + if(isset($_GET['db_select'])) { + if(in_array($current_db, $_GET['db_select'])) { + $is_selected = ' selected="selected"'; + } else { + $is_selected = ''; + } + } elseif (!empty($selectall) || (isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))) { $is_selected = ' selected="selected"'; } else { $is_selected = ''; @@ -38,7 +52,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 e7a911894..e0eb68479 100644 --- a/server_import.php +++ b/server_import.php @@ -10,6 +10,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'import.js'; + /** * Does the common work */ diff --git a/setup/lib/config_info.inc.php b/setup/lib/config_info.inc.php index b48cb5d47..71f2e233a 100644 --- a/setup/lib/config_info.inc.php +++ b/setup/lib/config_info.inc.php @@ -91,6 +91,7 @@ $cfg_db['Export']['format'] = array('codegen', 'csv', 'excel', 'htmlexcel', 'yaml'); $cfg_db['Export']['compression'] = array('none', 'zip', 'gzip', 'bzip2'); $cfg_db['Export']['charset'] = array_merge(array(''), $GLOBALS['cfg']['AvailableCharsets']); +$cfg_db['Export']['method'] = array('quick', 'custom', 'custom-no-form'); /** * Config options which will be placed in config file even if they are set diff --git a/setup/lib/forms.inc.php b/setup/lib/forms.inc.php index 9770a4f39..3219709b4 100644 --- a/setup/lib/forms.inc.php +++ b/setup/lib/forms.inc.php @@ -170,6 +170,7 @@ $forms['Import_defaults'] = array('Import' => array( 'skip_queries')); $forms['Export_defaults'] = array('Export' => array( 'format', + 'method', 'compression', 'asfile', 'charset', diff --git a/setup/lib/messages.inc.php b/setup/lib/messages.inc.php index d1ceb05ed..428448549 100644 --- a/setup/lib/messages.inc.php +++ b/setup/lib/messages.inc.php @@ -83,6 +83,7 @@ $strSetupExport_file_template_database_name = __('Database name template'); $strSetupExport_file_template_server_name = __('Server name template'); $strSetupExport_file_template_table_name = __('Table name template'); $strSetupExport_format_name = __('Format'); +$strSetupExport_method_name = __('Method'); $strSetupExport_onserver_name = __('Save on server'); $strSetupExport_onserver_overwrite_name = __('Overwrite existing file(s)'); $strSetupExport_remember_file_template_name = __('Remember file name template'); diff --git a/tbl_export.php b/tbl_export.php index 959a95dc9..6a7d03ff0 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -10,6 +10,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 6fb74cd2a..ff99ca85b 100644 --- a/tbl_import.php +++ b/tbl_import.php @@ -10,6 +10,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'import.js'; + /** * Gets tables informations and displays top links */ diff --git a/tbl_structure.php b/tbl_structure.php index e78fd85c5..c9c7fd3a1 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -158,6 +158,18 @@ $titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), tru $titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), true); $titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true); +// hidden action titles (image and string) +$hidden_titles = array(); +$hidden_titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), false, true); +$hidden_titles['Primary'] = PMA_getIcon('b_primary.png', __('Primary'), false, true); +$hidden_titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Primary'), false, true); +$hidden_titles['Index'] = PMA_getIcon('b_index.png', __('Index'), false, true); +$hidden_titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Index'), false, true); +$hidden_titles['Unique'] = PMA_getIcon('b_unique.png', __('Unique'), false, true); +$hidden_titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), false, true); +$hidden_titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Fulltext'), false, true); +$hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), false, true); + /** * Displays the table structure ('show table' works correct since 3.23.03) */ @@ -166,31 +178,40 @@ $titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinc $i = 0; ?>
    - + '; + } else if ($tbl_is_view) { + echo '"view" />'; + } else { + echo '"table" />'; + } ?> + - - - - - - - + + + + + + + - + - + + $GLOBALS['cfg']['LimitChars']) { + $type = '' . substr($type, 0, $GLOBALS['cfg']['LimitChars']) . ''; + } $type_nowrap = ''; @@ -358,59 +382,63 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { echo '' . _pgettext('None for default','None') . ''; } ?> - - - - - - - + +
    ; color: ; } @@ -373,11 +375,16 @@ img.lightbulb { } /* leave some space between icons and text */ -.icon { +.icon, img.footnotemarker { vertical-align: middle; margin-right: 0.3em; margin-left: 0.3em; } + +img.footnotemarker { + display: none; +} + /* no extra space in table cells */ td .icon { margin: 0; @@ -402,7 +409,8 @@ div.error h1 { div.success, div.notice, div.warning, -div.error { +div.error, +div.footnotes { margin: 0.3em 0 0 0; border: 2px solid; width: 90%; @@ -443,12 +451,13 @@ div.success { border-color: #00FF00; } -.notice { +.notice, .footnotes { color: #000000; background-color: #FFFFDD; } h1.notice, -div.notice { +div.notice, +div.footnotes { border-color: #FFD700; background-image: url(getImgPath(); ?>s_notice.png); @@ -1050,7 +1059,7 @@ div#queryboxcontainer div#bookmarkoptions { } #maincontainer ul { - list-style-image: url(getImgPath(); ?>item_.png); + list-style-type: disc; vertical-align: middle; } @@ -1070,8 +1079,7 @@ li#li_select_lang { list-style-image: url(getImgPath(); ?>s_lang.png); } -li#li_select_mysql_collation, -li#li_select_mysql_charset { +li#li_select_mysql_collation { list-style-image: url(getImgPath(); ?>s_asci.png); } @@ -1079,11 +1087,6 @@ li#li_select_theme{ list-style-image: url(getImgPath(); ?>s_theme.png); } -li#li_server_info, -li#li_server_version{ - list-style-image: url(getImgPath(); ?>s_host.png); -} - li#li_user_info{ /* list-style-image: url(getImgPath(); ?>s_rights.png); */ } @@ -1132,19 +1135,6 @@ li#li_log_out { list-style-image: url(getImgPath(); ?>s_loggoff.png); } -li#li_pma_docs, -li#li_pma_wiki { - list-style-image: url(getImgPath(); ?>b_docs.png); -} - -li#li_phpinfo { - list-style-image: url(getImgPath(); ?>php_sym.png); -} - -li#li_pma_homepage { - list-style-image: url(getImgPath(); ?>b_home.png); -} - li#li_mysql_privilegs{ list-style-image: url(getImgPath(); ?>s_rights.png); } @@ -1240,6 +1230,10 @@ label.desc { float: ; } +label.desc sup { + position: absolute; +} + code.sql, div.sqlvalidate { display: block; padding: 0.3em; @@ -1271,7 +1265,7 @@ code.sql, div.sqlvalidate { } .group h2 { - background-color: ; + background: ; padding: 0.1em 0.3em; margin-top: 0; } @@ -1282,9 +1276,11 @@ code.sql, div.sqlvalidate { } #li_select_server { - padding-bottom: 0.3em; - border-bottom: 0.3em solid ; - margin-bottom: 0.3em; + list-style-image: url(getImgPath(); ?>s_host.png); +} + +#list_server { + list-style-image: none; } /** @@ -1334,3 +1330,170 @@ 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: 20px 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; +} + +#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; +} + +/** + * Table structure styles + */ +.structure_actions_dropdown { + position: absolute; + padding: 3px; + display: none; +} + +td.more_opts { + display: none; + white-space: nowrap; +} \ No newline at end of file diff --git a/themes/darkblue_orange/img/more.png b/themes/darkblue_orange/img/more.png new file mode 100644 index 000000000..e83694b3b Binary files /dev/null and b/themes/darkblue_orange/img/more.png differ diff --git a/themes/darkblue_orange/layout.inc.php b/themes/darkblue_orange/layout.inc.php index e7282e1c5..617ee9606 100644 --- a/themes/darkblue_orange/layout.inc.php +++ b/themes/darkblue_orange/layout.inc.php @@ -76,7 +76,7 @@ $GLOBALS['cfg']['FontFamilyFixed'] = 'monospace'; // border $GLOBALS['cfg']['Border'] = 0; // table header and footer color -$GLOBALS['cfg']['ThBackground'] = '#ff9900 url(' . $_SESSION['PMA_Theme']->getImgPath() . 'tbl_th.png) repeat-x top'; +$GLOBALS['cfg']['ThBackground'] = '#ff9900 url("' . $_SESSION['PMA_Theme']->getImgPath() . 'tbl_th.png") repeat-x top'; // table header and footer background $GLOBALS['cfg']['ThColor'] = '#000000'; // table data row background diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 5583fa8b6..13a115274 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -31,6 +31,8 @@ body { margin: 0.5em; color: ; background: ; + width: 100%; + height: 100%; } @@ -52,11 +54,12 @@ h3 { font-weight: bold; } -a:link, +a, a:link, a:visited, a:active { text-decoration: none; color: #0000FF; + cursor: pointer; } a:hover { @@ -208,7 +211,8 @@ table tr.marked { /* hovered items */ .odd:hover, .even:hover, -.hover { +.hover, +.structure_actions_dropdown { background: ; color: ; } @@ -350,11 +354,16 @@ img.lightbulb { } /* leave some space between icons and text */ -.icon { +.icon, img.footnotemarker { vertical-align: middle; margin-right: 0.3em; margin-left: 0.3em; } + +img.footnotemarker { + display: none; +} + /* no extra space in table cells */ td .icon { margin: 0; @@ -379,7 +388,8 @@ div.error h1 { div.success, div.notice, div.warning, -div.error { +div.error, +div.footnotes { margin: 0.3em 0 0 0; border: 2px solid; @@ -419,12 +429,13 @@ div.success { border-color: #00FF00; } -.notice { +.notice, .footnotes { color: #000000; background-color: #FFFFDD; } h1.notice, -div.notice { +div.notice, +div.footnotes { border-color: #FFD700; background-image: url(getImgPath(); ?>s_notice.png); @@ -512,6 +523,7 @@ fieldset.confirmation legend { } + /* end messageboxes */ @@ -998,12 +1010,12 @@ div#queryboxcontainer div#bookmarkoptions { } #maincontainer ul { - list-style-image: url(getImgPath(); ?>item_.png); + list-style-type: disc; vertical-align: middle; } #maincontainer li { - margin-bottom: 0.3em; + margin: 0.2em 0em; } /* END main page */ @@ -1018,8 +1030,7 @@ li#li_select_lang { list-style-image: url(getImgPath(); ?>s_lang.png); } -li#li_select_mysql_collation, -li#li_select_mysql_charset { +li#li_select_mysql_collation { list-style-image: url(getImgPath(); ?>s_asci.png); } @@ -1027,11 +1038,6 @@ li#li_select_theme{ list-style-image: url(getImgPath(); ?>s_theme.png); } -li#li_server_info, -li#li_server_version{ - list-style-image: url(getImgPath(); ?>s_host.png); -} - li#li_user_info{ /* list-style-image: url(getImgPath(); ?>s_rights.png); */ } @@ -1080,19 +1086,6 @@ li#li_log_out { list-style-image: url(getImgPath(); ?>s_loggoff.png); } -li#li_pma_docs, -li#li_pma_wiki { - list-style-image: url(getImgPath(); ?>b_docs.png); -} - -li#li_phpinfo { - list-style-image: url(getImgPath(); ?>php_sym.png); -} - -li#li_pma_homepage { - list-style-image: url(getImgPath(); ?>b_home.png); -} - li#li_mysql_privilegs{ list-style-image: url(getImgPath(); ?>s_rights.png); } @@ -1192,6 +1185,10 @@ label.desc { float: ; } +label.desc sup { + position: absolute; +} + code.sql, div.sqlvalidate { display: block; padding: 0.3em; @@ -1223,7 +1220,7 @@ code.sql, div.sqlvalidate { } .group h2 { - background-color: ; + background: ; padding: 0.1em 0.3em; margin-top: 0; } @@ -1234,9 +1231,11 @@ code.sql, div.sqlvalidate { } #li_select_server { - padding-bottom: 0.3em; - border-bottom: 0.3em solid ; - margin-bottom: 0.3em; + list-style-image: url(getImgPath(); ?>s_host.png); +} + +#list_server { + list-style-image: none; } /** @@ -1267,3 +1266,190 @@ table#serverconnection_trg_local { */ .invalid_value {background:#F00;} + +/** + * Export and Import styles + */ + +.exportoptions h3, .importoptions h3 { + border-bottom: 1px #999999 solid; + font-size: 110%; +} + +.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: 20px 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; +} + +.export_sub_options li.subgroup { + display: inline-block; + margin-top: 0; +} + +.export_sub_options li { + margin-bottom: 0; +} + +#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-y: auto; + overflow-x: hidden; +} + +#enum_editor_no_js { + margin: auto auto; +} + +#enum_editor, #enum_editor_no_js { + background: #D0DCE0; + padding: 15px; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE6 */ + width: 100%; + height: 100%; + top: 0; + left: 0; + background: #000; + z-index: 100; + overflow: hidden; +} + +a.close_enum_editor { + float: right; +} + +#enum_editor #values, #enum_editor_no_js #values { + margin: 15px 0px; + width: 100%; +} + +#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; +} + +/** + * Table structure styles + */ +.structure_actions_dropdown { + position: absolute; + padding: 3px; + display: none; + z-index: 100; +} + +td.more_opts { + display: none; + white-space: nowrap; +} + +iframe.IE_hack { + z-index: 1; + position: absolute; + display: none; + border: 0; + filter: alpha(opacity=0); +} \ No newline at end of file diff --git a/themes/original/img/more.png b/themes/original/img/more.png new file mode 100644 index 000000000..e83694b3b Binary files /dev/null and b/themes/original/img/more.png differ
    #
    + + + + hasColumn($field_name))) { echo $titles['NoPrimary'] . "\n"; + $primary_enabled = false; } else { echo "\n"; ?> - + - + @@ -421,22 +449,88 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { && (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char'))) { echo "\n"; ?> - + + + + + More show more actions +
    + +
    + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +