Merge branch 'master' of github.com:phpmyadmin/phpmyadmin
This commit is contained in:
commit
047b962d6e
@ -69,6 +69,7 @@ phpMyAdmin - ChangeLog
|
||||
+ rfe #1531 Cant use external config file
|
||||
+ rfe #1552 CSV import: Allow "Columns escaped with" to be optional
|
||||
+ rfe #1561 Being able to use multiple servers at the same time when using cookie auth
|
||||
+ rfe #1603 select structure or data for each table when exporting
|
||||
|
||||
4.4.11.0 (not yet released)
|
||||
- bug Missing selected/entered values when editing active options in visual query builder
|
||||
|
||||
@ -37,21 +37,25 @@ if ($num_tables < 1) {
|
||||
exit;
|
||||
} // end if
|
||||
|
||||
$multi_values = '<div>';
|
||||
$multi_values .= '<a href="#"';
|
||||
$multi_values .= ' onclick="setSelectOptions(\'dump\', \'table_select[]\', true);'
|
||||
. ' return false;">';
|
||||
$multi_values .= __('Select All');
|
||||
$multi_values .= '</a>';
|
||||
$multi_values .= ' / ';
|
||||
$multi_values .= '<a href="#"';
|
||||
$multi_values .= ' onclick="setSelectOptions(\'dump\', \'table_select[]\', false);'
|
||||
. ' return false;">';
|
||||
$multi_values .= __('Unselect All');
|
||||
$multi_values .= '</a><br />';
|
||||
|
||||
$multi_values .= '<select name="table_select[]" id="table_select" size="10"'
|
||||
. ' multiple="multiple">';
|
||||
$multi_values = '<div class="export_table_list_container">';
|
||||
if (isset($_GET['structure_or_data_forced'])) {
|
||||
$force_val = htmlspecialchars($_GET['structure_or_data_forced']);
|
||||
} else {
|
||||
$force_val = 0;
|
||||
}
|
||||
$multi_values .= '<input type="hidden" name="structure_or_data_forced" value="' . $force_val . '">';
|
||||
$multi_values .= '<table class="export_table_select">'
|
||||
. '<thead><tr><th></th>'
|
||||
. '<th>' . __('Tables') . '</th>'
|
||||
. '<th class="export_structure">' . __('Structure') . '</th>'
|
||||
. '<th class="export_data">' . __('Data') . '</th>'
|
||||
. '</tr><tr>'
|
||||
. '<td></td>'
|
||||
. '<td class="export_table_name all">' . __('Select all') . '</td>'
|
||||
. '<td class="export_structure all"><input type="checkbox" id="table_structure_all" /></td>'
|
||||
. '<td class="export_data all"><input type="checkbox" id="table_data_all" /></td>'
|
||||
. '</tr></thead>'
|
||||
. '<tbody>';
|
||||
$multi_values .= "\n";
|
||||
|
||||
// when called by libraries/mult_submits.inc.php
|
||||
@ -65,31 +69,63 @@ if (isset($_GET['table_select'])) {
|
||||
$_GET['table_select'] = urldecode($_GET['table_select']);
|
||||
$_GET['table_select'] = explode(",", $_GET['table_select']);
|
||||
}
|
||||
if (isset($_GET['table_structure'])) {
|
||||
$_GET['table_structure'] = urldecode($_GET['table_structure']);
|
||||
$_GET['table_structure'] = explode(",", $_GET['table_structure']);
|
||||
}
|
||||
if (isset($_GET['table_data'])) {
|
||||
$_GET['table_data'] = urldecode($_GET['table_data']);
|
||||
$_GET['table_data'] = explode(",", $_GET['table_data']);
|
||||
}
|
||||
|
||||
foreach ($tables as $each_table) {
|
||||
if (isset($_GET['table_select'])) {
|
||||
if (in_array($each_table['Name'], $_GET['table_select'])) {
|
||||
$is_selected = ' selected="selected"';
|
||||
$is_checked = ' checked="checked"';
|
||||
} else {
|
||||
$is_selected = '';
|
||||
$is_checked = '';
|
||||
}
|
||||
} elseif (isset($table_select)) {
|
||||
if (in_array($each_table['Name'], $table_select)) {
|
||||
$is_selected = ' selected="selected"';
|
||||
$is_checked = ' checked="checked"';
|
||||
} else {
|
||||
$is_selected = '';
|
||||
$is_checked = '';
|
||||
}
|
||||
} else {
|
||||
$is_selected = ' selected="selected"';
|
||||
$is_checked = ' checked="checked"';
|
||||
}
|
||||
if (isset($_GET['table_structure'])) {
|
||||
if (in_array($each_table['Name'], $_GET['table_structure'])) {
|
||||
$str_checked = ' checked="checked"';
|
||||
} else {
|
||||
$str_checked = '';
|
||||
}
|
||||
} else {
|
||||
$str_checked = $is_checked;
|
||||
}
|
||||
if (isset($_GET['table_data'])) {
|
||||
if (in_array($each_table['Name'], $_GET['table_data'])) {
|
||||
$data_checked = ' checked="checked"';
|
||||
} else {
|
||||
$data_checked = '';
|
||||
}
|
||||
} else {
|
||||
$data_checked = $is_checked;
|
||||
}
|
||||
$table_html = htmlspecialchars($each_table['Name']);
|
||||
$multi_values .= ' <option value="' . $table_html . '"'
|
||||
. $is_selected . '>'
|
||||
. str_replace(' ', ' ', $table_html) . '</option>' . "\n";
|
||||
$multi_values .= '<tr>';
|
||||
$multi_values .= '<td><input type="checkbox" name="table_select[]"'
|
||||
. ' value="' . $table_html . '"' . $is_checked . ' /></td>';
|
||||
$multi_values .= '<td class="export_table_name">' . str_replace(' ', ' ', $table_html) . '</td>';
|
||||
$multi_values .= '<td class="export_structure"><input type="checkbox" name="table_structure[]"'
|
||||
. ' value="' . $table_html . '"' . $str_checked . ' /></td>';
|
||||
$multi_values .= '<td class="export_data"><input type="checkbox" name="table_data[]"'
|
||||
. ' value="' . $table_html . '"' . $data_checked . ' /></td>';
|
||||
$multi_values .= '</tr>';
|
||||
} // end for
|
||||
|
||||
$multi_values .= "\n";
|
||||
$multi_values .= '</select></div>';
|
||||
$multi_values .= '</tbody></table></div>';
|
||||
|
||||
$export_type = 'database';
|
||||
require_once 'libraries/display_export.inc.php';
|
||||
|
||||
24
export.php
24
export.php
@ -49,6 +49,8 @@ if (!defined('TESTSUITE')) {
|
||||
'quick_or_custom',
|
||||
'db_select',
|
||||
'table_select',
|
||||
'table_structure',
|
||||
'table_data',
|
||||
'limit_to',
|
||||
'limit_from',
|
||||
'allrows',
|
||||
@ -432,13 +434,23 @@ if (!defined('TESTSUITE')) {
|
||||
$aliases, $separate_files
|
||||
);
|
||||
} elseif ($export_type == 'database') {
|
||||
if (!isset($table_structure) || !is_array($table_structure)) {
|
||||
$table_structure = array();
|
||||
}
|
||||
if (!isset($table_data) || !is_array($table_data)) {
|
||||
$table_data = array();
|
||||
}
|
||||
if (!empty($_REQUEST['structure_or_data_forced'])) {
|
||||
$table_structure = $tables;
|
||||
$table_data = $tables;
|
||||
}
|
||||
if (isset($lock_tables)) {
|
||||
PMA_lockTables($db, $tables, "READ");
|
||||
try {
|
||||
PMA_exportDatabase(
|
||||
$db, $tables, $whatStrucOrData, $export_plugin, $crlf,
|
||||
$err_url, $export_type, $do_relation, $do_comments,
|
||||
$do_mime, $do_dates, $aliases, $separate_files
|
||||
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
|
||||
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
|
||||
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
|
||||
);
|
||||
PMA_unlockTables();
|
||||
} catch (Exception $e) { // TODO use finally when PHP version is 5.5
|
||||
@ -447,9 +459,9 @@ if (!defined('TESTSUITE')) {
|
||||
}
|
||||
} else {
|
||||
PMA_exportDatabase(
|
||||
$db, $tables, $whatStrucOrData, $export_plugin, $crlf, $err_url,
|
||||
$export_type, $do_relation, $do_comments, $do_mime, $do_dates,
|
||||
$aliases, $separate_files
|
||||
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
|
||||
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
|
||||
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
244
js/export.js
244
js/export.js
@ -32,19 +32,19 @@ function enable_dump_some_rows_sub_options()
|
||||
AJAX.registerTeardown('export.js', function () {
|
||||
$("#plugins").unbind('change');
|
||||
$("input[type='radio'][name='sql_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name='latex_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name='odt_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name='texytext_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name='htmlword_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name='sql_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name$='_structure_or_data']").off('change');
|
||||
$("input[type='radio'][name='output_format']").unbind('change');
|
||||
$("#checkbox_sql_include_comments").unbind('change');
|
||||
$("#plugins").unbind('change');
|
||||
$("input[type='radio'][name='quick_or_custom']").unbind('change');
|
||||
$("input[type='radio'][name='allrows']").unbind('change');
|
||||
$('#btn_alias_config').off('click');
|
||||
$('#db_alias_select').off('change');
|
||||
$('.table_alias_select').off('change');
|
||||
$('input[name="table_select[]"]').off('change');
|
||||
$('input[name="table_structure[]"]').off('change');
|
||||
$('input[name="table_data[]"]').off('change');
|
||||
$('#table_structure_all').off('change');
|
||||
$('#table_data_all').off('change');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('export.js', function () {
|
||||
@ -99,15 +99,66 @@ AJAX.registerOnload('export.js', function () {
|
||||
$('input[type="checkbox"][name="as_separate_files"]').attr('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function setup_table_structure_or_data() {
|
||||
if ($("input[name='export_type']").val() != 'database') {
|
||||
return;
|
||||
}
|
||||
var pluginName = $("#plugins option:selected").val();
|
||||
var formElemName = pluginName + "_structure_or_data";
|
||||
var force_structure_or_data = !($("input[name='" + formElemName + "_default']").length);
|
||||
|
||||
if (force_structure_or_data === true) {
|
||||
$('input[name="structure_or_data_forced"]').val(1);
|
||||
$('.export_structure input[type="checkbox"], .export_data input[type="checkbox"]')
|
||||
.prop('disabled', true);
|
||||
$('.export_structure, .export_data').fadeTo('fast', 0.4);
|
||||
} else {
|
||||
$('input[name="structure_or_data_forced"]').val(0);
|
||||
$('.export_structure input[type="checkbox"], .export_data input[type="checkbox"]')
|
||||
.removeProp('disabled');
|
||||
$('.export_structure, .export_data').fadeTo('fast', 1);
|
||||
|
||||
var structure_or_data = $('input[name="' + formElemName + '_default"]').val();
|
||||
|
||||
if (structure_or_data == 'structure') {
|
||||
$('.export_data input[type="checkbox"]')
|
||||
.prop('checked', false);
|
||||
} else if (structure_or_data == 'data') {
|
||||
$('.export_structure input[type="checkbox"]')
|
||||
.prop('checked', false);
|
||||
}
|
||||
if (structure_or_data == 'structure' || structure_or_data == 'structure_and_data') {
|
||||
if (!$('.export_structure input[type="checkbox"]:checked').length) {
|
||||
$('input[name="table_select[]"]:checked')
|
||||
.closest('tr')
|
||||
.find('.export_structure input[type="checkbox"]')
|
||||
.prop('checked', true);
|
||||
}
|
||||
}
|
||||
if (structure_or_data == 'data' || structure_or_data == 'structure_and_data') {
|
||||
if (!$('.export_data input[type="checkbox"]:checked').length) {
|
||||
$('input[name="table_select[]"]:checked')
|
||||
.closest('tr')
|
||||
.find('.export_data input[type="checkbox"]')
|
||||
.prop('checked', true);
|
||||
}
|
||||
}
|
||||
|
||||
check_selected_tables();
|
||||
check_table_select_all();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of plugin structure-specific and data-specific
|
||||
* options
|
||||
*/
|
||||
function toggle_structure_data_opts(pluginName)
|
||||
function toggle_structure_data_opts()
|
||||
{
|
||||
var pluginName = $("select#plugins").val();
|
||||
var radioFormName = pluginName + "_structure_or_data";
|
||||
var dataDiv = "#" + pluginName + "_data";
|
||||
var structureDiv = "#" + pluginName + "_structure";
|
||||
@ -125,24 +176,6 @@ function toggle_structure_data_opts(pluginName)
|
||||
}
|
||||
}
|
||||
|
||||
AJAX.registerOnload('export.js', 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
|
||||
*/
|
||||
@ -185,6 +218,93 @@ function toggle_sql_include_comments()
|
||||
});
|
||||
}
|
||||
|
||||
function check_table_select_all() {
|
||||
var total = $('input[name="table_select[]"]').length;
|
||||
var str_checked = $('input[name="table_structure[]"]:checked').length;
|
||||
var data_checked = $('input[name="table_data[]"]:checked').length;
|
||||
var str_all = $('#table_structure_all');
|
||||
var data_all = $('#table_data_all');
|
||||
|
||||
if (str_checked == total) {
|
||||
str_all
|
||||
.prop("indeterminate", false)
|
||||
.prop('checked', true);
|
||||
} else if (str_checked === 0) {
|
||||
str_all
|
||||
.prop("indeterminate", false)
|
||||
.prop('checked', false);
|
||||
} else {
|
||||
str_all
|
||||
.prop("indeterminate", true)
|
||||
.prop('checked', false);
|
||||
}
|
||||
|
||||
if (data_checked == total) {
|
||||
data_all
|
||||
.prop("indeterminate", false)
|
||||
.prop('checked', true);
|
||||
} else if (data_checked === 0) {
|
||||
data_all
|
||||
.prop("indeterminate", false)
|
||||
.prop('checked', false);
|
||||
} else {
|
||||
data_all
|
||||
.prop("indeterminate", true)
|
||||
.prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_table_select_all_str() {
|
||||
var str_all = $('#table_structure_all').is(':checked');
|
||||
if (str_all) {
|
||||
$('input[name="table_structure[]"]').prop('checked', true);
|
||||
} else {
|
||||
$('input[name="table_structure[]"]').prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_table_select_all_data() {
|
||||
var data_all = $('#table_data_all').is(':checked');
|
||||
if (data_all) {
|
||||
$('input[name="table_data[]"]').prop('checked', true);
|
||||
} else {
|
||||
$('input[name="table_data[]"]').prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
function check_selected_tables(argument) {
|
||||
$('.export_table_select tbody tr').each(function() {
|
||||
check_table_selected(this);
|
||||
});
|
||||
}
|
||||
|
||||
function check_table_selected(row) {
|
||||
var $row = $(row);
|
||||
var table_select = $row.find('input[name="table_select[]"]');
|
||||
var str_check = $row.find('input[name="table_structure[]"]');
|
||||
var data_check = $row.find('input[name="table_data[]"]');
|
||||
|
||||
var data = data_check.is(':checked:not(:disabled)');
|
||||
var structure = str_check.is(':checked:not(:disabled)');
|
||||
|
||||
if (data || structure) {
|
||||
table_select.prop('checked', true);
|
||||
} else {
|
||||
table_select.prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_table_select(row) {
|
||||
var $row = $(row);
|
||||
var table_selected = $row.find('input[name="table_select[]"]').is(':checked');
|
||||
|
||||
if (table_selected) {
|
||||
$row.find('input[type="checkbox"]:not(:disabled)').prop('checked', true);
|
||||
} else {
|
||||
$row.find('input[type="checkbox"]:not(:disabled)').prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
AJAX.registerOnload('export.js', function () {
|
||||
/**
|
||||
* For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
|
||||
@ -216,6 +336,78 @@ AJAX.registerOnload('export.js', function () {
|
||||
$("#radio_view_as_text").prop('disabled', false).parent().fadeTo('fast', 1);
|
||||
}
|
||||
});
|
||||
|
||||
$("input[type='radio'][name$='_structure_or_data']").on('change', function () {
|
||||
toggle_structure_data_opts();
|
||||
});
|
||||
|
||||
$('input[name="table_select[]"]').on('change', function() {
|
||||
toggle_table_select($(this).closest('tr'));
|
||||
check_table_select_all();
|
||||
});
|
||||
|
||||
$('input[name="table_structure[]"]').on('change', function() {
|
||||
check_table_selected($(this).closest('tr'));
|
||||
check_table_select_all();
|
||||
});
|
||||
|
||||
$('input[name="table_data[]"]').on('change', function() {
|
||||
check_table_selected($(this).closest('tr'));
|
||||
check_table_select_all();
|
||||
});
|
||||
|
||||
$('#table_structure_all').on('change', function() {
|
||||
toggle_table_select_all_str();
|
||||
check_selected_tables();
|
||||
});
|
||||
|
||||
$('#table_data_all').on('change', function() {
|
||||
toggle_table_select_all_data();
|
||||
check_selected_tables();
|
||||
});
|
||||
|
||||
if ($("input[name='export_type']").val() == 'database') {
|
||||
// Hide structure or data radio buttons
|
||||
$("input[type='radio'][name$='_structure_or_data']").each(function() {
|
||||
var $this = $(this);
|
||||
var name = $this.prop('name');
|
||||
var val = $('input[name="' + name + '"]:checked').val();
|
||||
var name_default = name + '_default';
|
||||
if (!$('input[name="' + name_default + '"]').length) {
|
||||
$this
|
||||
.after(
|
||||
$('<input type="hidden" name="' + name_default + '" value="' + val + '" disabled>')
|
||||
)
|
||||
.after(
|
||||
$('<input type="hidden" name="' + name + '" value="structure_and_data">')
|
||||
);
|
||||
$this.parent().find('label').remove();
|
||||
} else {
|
||||
$this.parent().remove();
|
||||
}
|
||||
});
|
||||
$("input[type='radio'][name$='_structure_or_data']").remove();
|
||||
|
||||
// Disable CREATE table checkbox for sql
|
||||
var createTableCheckbox = $('#checkbox_sql_create_table');
|
||||
createTableCheckbox.prop('checked', true);
|
||||
var dummyCreateTable = $('#checkbox_sql_create_table')
|
||||
.clone()
|
||||
.removeAttr('id')
|
||||
.attr('type', 'hidden');
|
||||
createTableCheckbox
|
||||
.prop('disabled', true)
|
||||
.after(dummyCreateTable)
|
||||
.parent()
|
||||
.fadeTo('fast', 0.4);
|
||||
|
||||
setup_table_structure_or_data();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle force structure_or_data
|
||||
*/
|
||||
$("#plugins").change(setup_table_structure_or_data);
|
||||
});
|
||||
|
||||
/**
|
||||
@ -376,7 +568,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
.find("h3")
|
||||
.remove();
|
||||
toggle_quick_or_custom();
|
||||
toggle_structure_data_opts($("select#plugins").val());
|
||||
toggle_structure_data_opts();
|
||||
toggle_sql_include_comments();
|
||||
|
||||
/**
|
||||
|
||||
@ -1744,7 +1744,6 @@ AJAX.registerTeardown('functions.js', function () {
|
||||
$(document).off('blur', '#sqlquery');
|
||||
}
|
||||
$(document).off('change', '#parameterized');
|
||||
$("#export_type").unbind('change');
|
||||
$('#sqlquery').unbind('keydown');
|
||||
$('#sql_query_edit').unbind('keydown');
|
||||
|
||||
|
||||
@ -172,6 +172,13 @@ AJAX.registerOnload('tbl_operations.js', function () {
|
||||
event.preventDefault();
|
||||
var $form = $(this);
|
||||
|
||||
function submitPartitionMaintenance() {
|
||||
var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true';
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
}
|
||||
|
||||
if ($('#partition_operation_DROP').is(':checked')) {
|
||||
var question = PMA_messages.strDropPartitionWarning;
|
||||
$form.PMA_confirm(question, $form.attr('action'), function (url) {
|
||||
@ -185,13 +192,6 @@ AJAX.registerOnload('tbl_operations.js', function () {
|
||||
} else {
|
||||
submitPartitionMaintenance();
|
||||
}
|
||||
|
||||
function submitPartitionMaintenance() {
|
||||
var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true';
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', "#drop_tbl_anchor.ajax", function (event) {
|
||||
|
||||
@ -3208,11 +3208,11 @@ class PMA_Util
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for Foreign key check value
|
||||
* Is Foreign key check enabled?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function getDefaultFKCheckValue()
|
||||
public static function isForeignKeyCheck()
|
||||
{
|
||||
if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'enable') {
|
||||
return true;
|
||||
@ -3229,7 +3229,7 @@ class PMA_Util
|
||||
*/
|
||||
public static function getFKCheckbox()
|
||||
{
|
||||
$checked = self::getDefaultFKCheckValue();
|
||||
$checked = self::isForeignKeyCheck();
|
||||
$html = '<input type="hidden" name="fk_checks" value="0" />';
|
||||
$html .= '<input type="checkbox" name="fk_checks"'
|
||||
. ' id="fk_checks" value="1"'
|
||||
|
||||
@ -260,7 +260,23 @@ function PMA_getHtmlForExportOptionsSelection($export_type, $multi_values)
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints Html For Export Options Format
|
||||
* Prints Html For Export Options Format dropdown
|
||||
*
|
||||
* @param ExportPlugin[] $export_list Export List
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function PMA_getHtmlForExportOptionsFormatDropdown($export_list)
|
||||
{
|
||||
$html = '<div class="exportoptions" id="format">';
|
||||
$html .= '<h3>' . __('Format:') . '</h3>';
|
||||
$html .= PMA_pluginGetChoice('Export', 'what', $export_list, 'format');
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints Html For Export Options Format-specific options
|
||||
*
|
||||
* @param ExportPlugin[] $export_list Export List
|
||||
*
|
||||
@ -268,12 +284,7 @@ function PMA_getHtmlForExportOptionsSelection($export_type, $multi_values)
|
||||
*/
|
||||
function PMA_getHtmlForExportOptionsFormat($export_list)
|
||||
{
|
||||
$html = '<div class="exportoptions" id="format">';
|
||||
$html .= '<h3>' . __('Format:') . '</h3>';
|
||||
$html .= PMA_pluginGetChoice('Export', 'what', $export_list, 'format');
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div class="exportoptions" id="format_specific_opts">';
|
||||
$html = '<div class="exportoptions" id="format_specific_opts">';
|
||||
$html .= '<h3>' . __('Format-specific options:') . '</h3>';
|
||||
$html .= '<p class="no_js_msg" id="scroll_to_options_msg">';
|
||||
$html .= __(
|
||||
@ -760,6 +771,7 @@ function PMA_getHtmlForExportOptions(
|
||||
global $cfg;
|
||||
$html = PMA_getHtmlForExportOptionHeader($export_type, $db, $table);
|
||||
$html .= PMA_getHtmlForExportOptionsMethod();
|
||||
$html .= PMA_getHtmlForExportOptionsFormatDropdown($export_list);
|
||||
$html .= PMA_getHtmlForExportOptionsSelection($export_type, $multi_values);
|
||||
|
||||
$tableLength = /*overload*/mb_strlen($table);
|
||||
|
||||
@ -491,10 +491,20 @@ function PMA_getHtmlForDisplayedExportHeader($export_type, $db, $table)
|
||||
// Convert the multiple select elements from an array to a string
|
||||
if ($export_type == 'server' && isset($_REQUEST['db_select'])) {
|
||||
$_REQUEST['db_select'] = implode(",", $_REQUEST['db_select']);
|
||||
} elseif ($export_type == 'database'
|
||||
&& isset($_REQUEST['table_select'])
|
||||
) {
|
||||
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
|
||||
} elseif ($export_type == 'database') {
|
||||
if (isset($_REQUEST['table_select'])) {
|
||||
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
|
||||
}
|
||||
if (isset($_REQUEST['table_structure'])) {
|
||||
$_REQUEST['table_structure'] = implode(",", $_REQUEST['table_structure']);
|
||||
} else if (empty($_REQUEST['structure_or_data_forced'])) {
|
||||
$_REQUEST['table_structure'] = '';
|
||||
}
|
||||
if (isset($_REQUEST['table_data'])) {
|
||||
$_REQUEST['table_data'] = implode(",", $_REQUEST['table_data']);
|
||||
} else if (empty($_REQUEST['structure_or_data_forced'])) {
|
||||
$_REQUEST['table_data'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_REQUEST as $name => $value) {
|
||||
@ -546,9 +556,10 @@ function PMA_exportServer(
|
||||
) {
|
||||
$tables = $GLOBALS['dbi']->getTables($current_db);
|
||||
PMA_exportDatabase(
|
||||
$current_db, $tables, $whatStrucOrData, $export_plugin, $crlf,
|
||||
$err_url, $export_type, $do_relation, $do_comments, $do_mime,
|
||||
$do_dates, $aliases, $separate_files == 'database' ? $separate_files : ''
|
||||
$current_db, $tables, $whatStrucOrData, $tables, $tables,
|
||||
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
|
||||
$do_comments, $do_mime, $do_dates, $aliases,
|
||||
$separate_files == 'database' ? $separate_files : ''
|
||||
);
|
||||
if ($separate_files == 'server') {
|
||||
PMA_saveObjectInBuffer($current_db);
|
||||
@ -563,6 +574,8 @@ function PMA_exportServer(
|
||||
* @param string $db the database to export
|
||||
* @param array $tables the tables to export
|
||||
* @param string $whatStrucOrData structure or data or both
|
||||
* @param array $table_structure whether to export structure for each table
|
||||
* @param array $table_data whether to export data for each table
|
||||
* @param ExportPlugin $export_plugin the selected export plugin
|
||||
* @param string $crlf end of line character(s)
|
||||
* @param string $err_url the URL in case of error
|
||||
@ -577,9 +590,9 @@ function PMA_exportServer(
|
||||
* @return void
|
||||
*/
|
||||
function PMA_exportDatabase(
|
||||
$db, $tables, $whatStrucOrData, $export_plugin, $crlf, $err_url,
|
||||
$export_type, $do_relation, $do_comments, $do_mime, $do_dates,
|
||||
$aliases, $separate_files
|
||||
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
|
||||
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
|
||||
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
|
||||
) {
|
||||
$db_alias = !empty($aliases[$db]['alias'])
|
||||
? $aliases[$db]['alias'] : '';
|
||||
@ -630,8 +643,9 @@ function PMA_exportDatabase(
|
||||
if ($is_view) {
|
||||
$views[] = $table;
|
||||
}
|
||||
if ($whatStrucOrData == 'structure'
|
||||
|| $whatStrucOrData == 'structure_and_data'
|
||||
if (($whatStrucOrData == 'structure'
|
||||
|| $whatStrucOrData == 'structure_and_data')
|
||||
&& in_array($table, $table_structure)
|
||||
) {
|
||||
// for a view, export a stand-in definition of the table
|
||||
// to resolve view dependencies (only when it's a single-file export)
|
||||
@ -681,6 +695,7 @@ function PMA_exportDatabase(
|
||||
// if this is a view or a merge table, don't export data
|
||||
if (($whatStrucOrData == 'data'
|
||||
|| $whatStrucOrData == 'structure_and_data')
|
||||
&& in_array($table, $table_data)
|
||||
&& ! ($is_view || PMA_Table::isMerge($db, $table))
|
||||
) {
|
||||
$local_query = 'SELECT * FROM ' . PMA_Util::backquote($db)
|
||||
@ -700,6 +715,7 @@ function PMA_exportDatabase(
|
||||
// triggers can modify already imported tables)
|
||||
if (isset($GLOBALS['sql_create_trigger']) && ($whatStrucOrData == 'structure'
|
||||
|| $whatStrucOrData == 'structure_and_data')
|
||||
&& in_array($table, $table_structure)
|
||||
) {
|
||||
if (! $export_plugin->exportStructure(
|
||||
$db, $table, $crlf, $err_url, 'triggers',
|
||||
|
||||
@ -322,9 +322,10 @@ class ImportOds extends ImportPlugin
|
||||
/**
|
||||
* Bring accumulated rows into the corresponding table
|
||||
*/
|
||||
$num_tbls = count($tables);
|
||||
for ($i = 0; $i < $num_tbls; ++$i) {
|
||||
for ($j = 0; $j < count($rows); ++$j) {
|
||||
$num_tables = count($tables);
|
||||
for ($i = 0; $i < $num_tables; ++$i) {
|
||||
$num_rows = count($rows);
|
||||
for ($j = 0; $j < $num_rows; ++$j) {
|
||||
if (strcmp($tables[$i][TBL_NAME], $rows[$j][TBL_NAME])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -245,7 +245,8 @@ class ImportXml extends ImportPlugin
|
||||
$tbl_attr = $v1->attributes();
|
||||
|
||||
$isInTables = false;
|
||||
for ($i = 0; $i < count($tables); ++$i) {
|
||||
$num_tables = count($tables);
|
||||
for ($i = 0; $i < $num_tables; ++$i) {
|
||||
if (! strcmp($tables[$i][TBL_NAME], (string)$tbl_attr['name'])) {
|
||||
$isInTables = true;
|
||||
break;
|
||||
@ -277,9 +278,10 @@ class ImportXml extends ImportPlugin
|
||||
/**
|
||||
* Bring accumulated rows into the corresponding table
|
||||
*/
|
||||
$num_tbls = count($tables);
|
||||
for ($i = 0; $i < $num_tbls; ++$i) {
|
||||
for ($j = 0; $j < count($rows); ++$j) {
|
||||
$num_tables = count($tables);
|
||||
for ($i = 0; $i < $num_tables; ++$i) {
|
||||
$num_rows = count($rows);
|
||||
for ($j = 0; $j < $num_rows; ++$j) {
|
||||
if (! strcmp($tables[$i][TBL_NAME], $rows[$j][TBL_NAME])) {
|
||||
if (! isset($tables[$i][COL_NAMES])) {
|
||||
$tables[$i][] = $rows[$j][COL_NAMES];
|
||||
|
||||
1473
po/be@latin.po
1473
po/be@latin.po
File diff suppressed because it is too large
Load Diff
1498
po/en_GB.po
1498
po/en_GB.po
File diff suppressed because it is too large
Load Diff
1462
po/phpmyadmin.pot
1462
po/phpmyadmin.pot
File diff suppressed because it is too large
Load Diff
1570
po/pt_BR.po
1570
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
1478
po/sr@latin.po
1478
po/sr@latin.po
File diff suppressed because it is too large
Load Diff
1478
po/uz@latin.po
1478
po/uz@latin.po
File diff suppressed because it is too large
Load Diff
1478
po/zh_CN.po
1478
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
1500
po/zh_TW.po
1500
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@ -287,7 +287,8 @@ Todo now:
|
||||
version 2.7.1-rc1 gets RELEASE_2_7_1RC1
|
||||
|
||||
2. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
|
||||
this release and paste into it the ChangeLog for this release
|
||||
this release and paste into it the ChangeLog for this release, followed
|
||||
by the notes of all previous incremental versions (i.e. 4.4.9 through 4.4.0)
|
||||
3. upload the files to SF, you can use scripts/upload-release, eg.:
|
||||
|
||||
./scripts/upload-release \$USER $version release
|
||||
|
||||
2
sql.php
2
sql.php
@ -114,7 +114,7 @@ if (isset($_REQUEST['get_default_fk_check_value'])
|
||||
) {
|
||||
$response = PMA_Response::getInstance();
|
||||
$response->addJSON(
|
||||
'default_fk_check_value', PMA_Util::getDefaultFKCheckValue()
|
||||
'default_fk_check_value', PMA_Util::isForeignKeyCheck()
|
||||
);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -1508,6 +1508,30 @@ select.invalid_value,
|
||||
* Export and Import styles
|
||||
*/
|
||||
|
||||
.export_table_list_container {
|
||||
display: inline-block;
|
||||
max-height: 20em;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.export_table_select th {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.export_table_select .all {
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
.export_structure, .export_data {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.export_table_name {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.exportoptions h3, .importoptions h3 {
|
||||
border-bottom: 1px #999999 solid;
|
||||
font-size: 110%;
|
||||
|
||||
@ -1994,6 +1994,30 @@ select.invalid_value,
|
||||
* Export and Import styles
|
||||
*/
|
||||
|
||||
.export_table_list_container {
|
||||
display: inline-block;
|
||||
max-height: 20em;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.export_table_select th {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.export_table_select .all {
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
.export_structure, .export_data {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.export_table_name {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.exportoptions h3,
|
||||
.importoptions h3 {
|
||||
border-bottom: 1px #999 solid;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user