Merge branch 'gsoc', remote branch 'origin'

This commit is contained in:
lorilee
2010-06-11 01:19:51 -04:00
36 changed files with 866 additions and 585 deletions

View File

@@ -16,6 +16,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'export.js';
// $sub_part is also used in db_info.inc.php to see if we are coming from
// db_export.php, in which case we don't obey $cfg['MaxTableList']
$sub_part = '_export';
@@ -39,12 +41,12 @@ $checkall_url = 'db_export.php?'
. PMA_generate_common_url($db)
. '&goto=db_export.php';
$multi_values = '<div align="center">';
$multi_values = '<div>';
$multi_values .= '<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'table_select[]\', true); return false;">' . __('Select All') . '</a>
/
<a href="' . $checkall_url . '&amp;unselectall=1" onclick="setSelectOptions(\'dump\', \'table_select[]\', false); return false;">' . __('Unselect All') . '</a><br />';
$multi_values .= '<select name="table_select[]" size="10" multiple="multiple">';
$multi_values .= '<select name="table_select[]" id="table_select" size="10" multiple="multiple">';
$multi_values .= "\n";
if (!empty($selected_tbl) && empty($table_select)) {
@@ -65,7 +67,7 @@ foreach ($tables as $each_table) {
} // end for
$multi_values .= "\n";
$multi_values .= '</select></div><br />';
$multi_values .= '</select></div>';
$export_type = 'database';
require_once './libraries/display_export.lib.php';

View File

@@ -11,6 +11,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'import.js';
/**
* Gets tables informations and displays top links
*/

View File

@@ -42,7 +42,7 @@ $compression = false;
$onserver = false;
$save_on_server = false;
$buffer_needed = false;
if (empty($_REQUEST['asfile'])) {
if ($_REQUEST['output_format'] == 'astext') {
$asfile = false;
} else {
$asfile = true;
@@ -56,7 +56,6 @@ if (empty($_REQUEST['asfile'])) {
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
}
}
// Does export require to be into file?
if (isset($export_list[$type]['force_file']) && ! $asfile) {
$message = PMA_Message::error(__('Selected export type has to be saved in file!'));
@@ -390,7 +389,7 @@ if (!PMA_exportHeader()) {
// Will we need relation & co. setup?
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']);
$do_comments = isset($GLOBALS[$what . '_include_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
require_once './libraries/relation.lib.php';
@@ -431,7 +430,7 @@ if ($export_type == 'server') {
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
@@ -439,7 +438,7 @@ if ($export_type == 'server') {
}
}
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($current_db, $table))) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($current_db, $table))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
break 3;
@@ -447,7 +446,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -455,7 +454,7 @@ if ($export_type == 'server') {
}
foreach($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
break 3;
}
@@ -480,7 +479,7 @@ if ($export_type == 'server') {
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
@@ -488,7 +487,7 @@ if ($export_type == 'server') {
}
}
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($db, $table))) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($db, $table))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
break 2;
@@ -496,7 +495,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -504,7 +503,7 @@ if ($export_type == 'server') {
}
foreach ($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
break 2;
}

150
js/export.js Normal file
View File

@@ -0,0 +1,150 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the export tab
*
* @version $Id$
*/
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
$(document).ready(function() {
$("#plugins").change(function() {
$(".format_specific_options").each(function() {
$(this).hide();
});
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").show();
});
});
/**
* Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
*/
$(document).ready(function() {
$("input[type='radio'][name$='sql_structure_or_data']").change(function() {
var show = $("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value");
if(show == 'data') {
// disable the SQL comment options
$("#checkbox_sql_dates").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_dates").attr('disabled', 'disabled');
$("#checkbox_sql_relation").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_relation").attr('disabled', 'disabled');
$("#checkbox_sql_mime").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_mime").attr('disabled', 'disabled');
} else {
// enable the SQL comment options
$("#checkbox_sql_dates").parent().fadeTo('fast', 1);
$("#checkbox_sql_dates").removeAttr('disabled');
$("#checkbox_sql_relation").parent().fadeTo('fast', 1);
$("#checkbox_sql_relation").removeAttr('disabled');
$("#checkbox_sql_mime").parent().fadeTo('fast', 1);
$("#checkbox_sql_mime").removeAttr('disabled');
}
});
});
/**
* Toggles the hiding and showing of plugin structure-specific and data-specific
* options
*/
$(document).ready(function() {
function toggleStructureAndDataOpts(pluginName) {
var radioFormName = pluginName + "_structure_or_data";
var dataDiv = "#" + pluginName + "_data";
var structureDiv = "#" + pluginName + "_structure";
var show = $("input[type='radio'][name='" + radioFormName + "']:checked").attr("value");
if(show == 'data') {
$(dataDiv).slideDown('slow');
$(structureDiv).slideUp('slow');
} else {
$(structureDiv).slideDown('slow');
if(show == 'structure') {
$(dataDiv).slideUp('slow');
} else {
$(dataDiv).slideDown('slow');
}
}
}
$("input[type='radio'][name='latex_structure_or_data']").change(function() {
toggleStructureAndDataOpts("latex");
});
$("input[type='radio'][name='odt_structure_or_data']").change(function() {
toggleStructureAndDataOpts("odt");
});
$("input[type='radio'][name='texytext_structure_or_data']").change(function() {
toggleStructureAndDataOpts("texytext");
});
$("input[type='radio'][name='htmlword_structure_or_data']").change(function() {
toggleStructureAndDataOpts("htmlword");
});
$("input[type='radio'][name='sql_structure_or_data']").change(function() {
toggleStructureAndDataOpts("sql");
});
});
/**
* Toggles the disabling of the "save to file" options
*/
$(document).ready(function() {
$("input[type='radio'][name='output_format']").change(function() {
if($("#radio_dump_asfile:checked").length == 0) {
$("#ul_save_asfile > li").fadeTo('fast', 0.4);
$("#ul_save_asfile > li > input").attr('disabled', 'disabled');
$("#ul_save_asfile > li> select").attr('disabled', 'disabled');
} else {
$("#ul_save_asfile > li").fadeTo('fast', 1);
$("#ul_save_asfile > li > input").removeAttr('disabled');
$("#ul_save_asfile > li> select").removeAttr('disabled');
}
});
});
/**
* For SQL plugin, toggles the disabling of the "display comments" options
*/
$(document).ready(function() {
$("#checkbox_sql_include_comments").change(function() {
if($("#checkbox_sql_include_comments:checked").length == 0) {
$("#ul_include_comments > li").fadeTo('fast', 0.4);
$("#ul_include_comments > li > input").attr('disabled', 'disabled');
} else {
$("#ul_include_comments > li").fadeTo('fast', 1);
$("#ul_include_comments > li > input").removeAttr('disabled');
}
});
});
/**
* For SQL plugin, if "CREATE TABLE options" is checked/uncheck, check/uncheck each of its sub-options
*/
$(document).ready(function() {
$("#checkbox_sql_create_table_statements").change(function() {
if($("#checkbox_sql_create_table_statements:checked").length == 0) {
$("#checkbox_sql_if_not_exists").removeAttr('checked');
$("#checkbox_sql_auto_increment").removeAttr('checked');
} else {
$("#checkbox_sql_if_not_exists").attr('checked', 'checked');
$("#checkbox_sql_auto_increment").attr('checked', 'checked');
}
});
});
/**
* Disables the view output as text option if the output must be saved as a file
*/
$(document).ready(function() {
$("#plugins").change(function() {
var active_plugin = $("#plugins option:selected").attr("value");
var force_file = $("#force_file_" + active_plugin).attr("value");
if(force_file == "true") {
$("#radio_view_as_text").attr('disabled', 'disabled');
$("#radio_view_as_text").parent().fadeTo('fast', 0.4);
} else {
$("#radio_view_as_text").removeAttr('disabled');
$("#radio_view_as_text").parent().fadeTo('fast', 1);
}
});
});

65
js/import.js Normal file
View File

@@ -0,0 +1,65 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the import tab
*
* @version $Id$
*/
$(document).ready(function() {
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
function changePluginOpts() {
$(".format_specific_options").each(function() {
$(this).hide();
});
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").fadeIn('slow');
if(selected_plugin_name == "csv") {
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
} else {
$("#import_notification").text("");
}
}
/**
* Toggles the hiding and showing of each plugin's options and sets the selected value
* in the plugin dropdown list according to the format of the selected file
*/
function matchFile(fname) {
fname_array = fname.toLowerCase().split(".");
len = fname_array.length;
if(len != 0) {
extension = fname_array[len - 1];
if (extension == "gz" || extension == "bz2" || extension == "zip") {
len--;
}
$("option:selected").removeAttr("selected");
switch (fname_array[len - 1]) {
case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break;
case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break;
case "ldi" : $("select[name='format'] option[value='ldi']").attr('selected', 'selected'); break;
case "ods" : $("select[name='format'] option[value='ods']").attr('selected', 'selected'); break;
case "sql" : $("select[name='format'] option[value='sql']").attr('selected', 'selected'); break;
case "xls" : $("select[name='format'] option[value='xls']").attr('selected', 'selected'); break;
case "xlsx" : $("select[name='format'] option[value='xlsx']").attr('selected', 'selected'); break;
case "xml" : $("select[name='format'] option[value='xml']").attr('selected', 'selected'); break;
}
changePluginOpts();
}
}
$("#plugins").change(function() {
changePluginOpts();
});
$("#input_import_file").change(function() {
matchFile($(this).attr("value"));
});
$("#select_local_import_file").change(function() {
matchFile($(this).attr("value"));
})
});

View File

@@ -1130,6 +1130,13 @@ $cfg['Export']['file_template_database'] = '__DB__';
*/
$cfg['Export']['file_template_server'] = '__SERVER__';
/**
*
*
* @global string $cfg['Export']['codegen_structure_or_data']
*/
$cfg['Export']['codegen_structure_or_data'] = 'data';
/**
*
*
@@ -1147,16 +1154,9 @@ $cfg['Export']['ods_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['odt_structure']
* @global string $cfg['Export']['odt_structure_or_data']
*/
$cfg['Export']['odt_structure'] = true;
/**
*
*
* @global boolean $cfg['Export']['odt_data']
*/
$cfg['Export']['odt_data'] = true;
$cfg['Export']['odt_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1196,16 +1196,9 @@ $cfg['Export']['odt_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['htmlword_structure']
* @global boolean $cfg['Export']['htmlword_structure_or_data']
*/
$cfg['Export']['htmlword_structure'] = true;
/**
*
*
* @global boolean $cfg['Export']['htmlword_data']
*/
$cfg['Export']['htmlword_data'] = true;
$cfg['Export']['htmlword_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1224,16 +1217,9 @@ $cfg['Export']['htmlword_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['texytext_structure']
* @global string $cfg['Export']['texytext_structure_or_data']
*/
$cfg['Export']['texytext_structure'] = TRUE;
/**
*
*
* @global boolean $cfg['Export']['texytext_data']
*/
$cfg['Export']['texytext_data'] = TRUE;
$cfg['Export']['texytext_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1256,6 +1242,13 @@ $cfg['Export']['texytext_null'] = 'NULL';
*/
$cfg['Export']['xls_columns'] = false;
/**
*
*
* @global string $cfg['Export']['xls_structure_or_data']
*/
$cfg['Export']['xls_structure_or_data'] = 'data';
/**
*
*
@@ -1270,6 +1263,13 @@ $cfg['Export']['xls_null'] = 'NULL';
*/
$cfg['Export']['xlsx_columns'] = false;
/**
*
*
* @global string $cfg['Export']['xlsx_structure_or_data']
*/
$cfg['Export']['xlsx_structure_or_data'] = 'data';
/**
*
*
@@ -1284,6 +1284,13 @@ $cfg['Export']['xlsx_null'] = 'NULL';
*/
$cfg['Export']['csv_columns'] = false;
/**
*
*
* @global string $cfg['Export']['csv_structure_or_data']
*/
$cfg['Export']['csv_structure_or_data'] = 'data';
/**
*
*
@@ -1343,16 +1350,16 @@ $cfg['Export']['excel_edition'] = 'win';
/**
*
*
* @global boolean $cfg['Export']['latex_structure']
* @global string $cfg['Export']['excel_structure_or_data']
*/
$cfg['Export']['latex_structure'] = true;
$cfg['Export']['excel_structure_or_data'] = 'data';
/**
*
*
* @global boolean $cfg['Export']['latex_data']
* @global string $cfg['Export']['latex_structure_or_data']
*/
$cfg['Export']['latex_data'] = true;
$cfg['Export']['latex_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1441,16 +1448,37 @@ $cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure';
/**
*
*
* @global boolean $cfg['Export']['sql_structure']
* @global string $cfg['Export']['mediawiki_structure_or_data']
*/
$cfg['Export']['sql_structure'] = true;
$cfg['Export']['mediawiki_structure_or_data'] = 'data';
/**
*
*
* @global boolean $cfg['Export']['sql_data']
* @global string $cfg['Export']['ods_structure_or_data']
*/
$cfg['Export']['sql_data'] = true;
$cfg['Export']['ods_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['pdf_structure_or_data']
*/
$cfg['Export']['pdf_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['php_array_structure_or_data']
*/
$cfg['Export']['php_array_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['sql_structure_or_data']
*/
$cfg['Export']['sql_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1538,13 +1566,6 @@ $cfg['Export']['sql_dates'] = false;
*/
$cfg['Export']['sql_relation'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_columns']
*/
$cfg['Export']['sql_columns'] = true;
/**
*
*
@@ -1580,13 +1601,6 @@ $cfg['Export']['sql_hex_for_blob'] = true;
*/
$cfg['Export']['sql_type'] = 'insert';
/**
*
*
* @global boolean $cfg['Export']['sql_extended']
*/
$cfg['Export']['sql_extended'] = true;
/**
*
*
@@ -1618,16 +1632,16 @@ $cfg['Export']['sql_header_comment'] = '';
/**
*
*
* @global boolean $cfg['Export']['pdf_structure']
* @global boolean $cfg['Export']['sql_create_table_statements']
*/
$cfg['Export']['pdf_structure'] = false;
$cfg['Export']['sql_create_table_statements'] = true;
/**
* Whether to use complete inserts, extended inserts, both, or neither
*
*
* @global boolean $cfg['Export']['pdf_data']
* @global string $cfg['Export']['sql_insert_syntax']
*/
$cfg['Export']['pdf_data'] = true;
$cfg['Export']['sql_insert_syntax'] = 'both';
/**
*
@@ -1636,6 +1650,12 @@ $cfg['Export']['pdf_data'] = true;
*/
$cfg['Export']['pdf_report_title'] = '';
/**
*
*
*@global string $cfg['Export']['xml_structure_or_data']
*/
$cfg['Export']['xml_structure_or_data'] = 'data';
/**
* Export schema for each structure
*
@@ -1685,7 +1705,12 @@ $cfg['Export']['xml_export_views'] = true;
*/
$cfg['Export']['xml_export_contents'] = true;
/**
*
*
* @global string $cfg['Export']['yaml_structure_or_data']
*/
$cfg['Export']['yaml_structure_or_data'] = 'data';
/*******************************************************************************
* Import defaults
*/

View File

@@ -65,204 +65,180 @@ echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' .
if (! empty($sql_query)) {
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";
}
echo PMA_pluginGetJavascript($export_list);
?>
<fieldset id="fieldsetexport">
<legend><?php echo $export_page_title; ?></legend>
<?php
/*
* this table is needed to fix rendering in Opera <= 9 and Safari <= 2
* normaly just the two fieldset would have float: left
*/
?>
<table><tr><td>
<div id="div_container_exportoptions">
<fieldset id="exportoptions">
<legend><?php echo __('Export'); ?></legend>
<?php if (! empty($multi_values)) { ?>
<div class="formelementrow">
<?php echo $multi_values; ?>
</div>
<?php } ?>
<?php echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?>
</fieldset>
<div class="exportoptions" id="databases_and_tables">
<?php
if($export_type == 'server') {
echo '<h3>' . __('Database(s):') . '</h3>';
} else if($export_type == 'database') {
echo '<h3>' . __('Table(s):') . '</h3>';
}
if (! empty($multi_values)) {
echo $multi_values;
}
?>
</div>
</td><td>
<div id="div_container_sub_exportoptions">
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
</div>
</td></tr></table>
<?php if (strlen($table) && ! isset($num_tables) && ! PMA_Table::isMerge($db, $table)) { ?>
<div class="formelementrow">
<?php
echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';
echo sprintf(__('Dump %s row(s) starting at row # %s'),
'<input type="text" name="limit_to" size="5" value="'
. (isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table))
. '" onfocus="this.select()" />',
'<input type="text" name="limit_from" value="0" size="5"'
.' onfocus="this.select()" /> ');
echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
echo '<label for="radio_allrows_1">' . __('Dump all rows') . '</label>';
?>
</div>
<div class="exportoptions" id="rows">
<h3><?php echo __('Rows:'); ?></h3>
<ul>
<li>
<?php echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';
echo '<label for ="radio_allrows_0">' . __('Dump some row(s)') . '</label>'; ?>
<ul>
<li> <?php echo __('Number of rows:') . ' <input type="text" name="limit_to" size="5" value="'
. (isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table))
. '" onfocus="this.select()" />' ?></li>
<li><?php echo __('Row to begin at:') . ' <input type="text" name="limit_from" value="0" size="5"'
.' onfocus="this.select()" />'; ?></li>
</ul>
</li>
<li>
<?php echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
echo ' <label for="radio_allrows_1">' . __('Dump all rows') . '</label>';?>
</li>
</ul>
</div>
<?php } ?>
</fieldset>
<fieldset>
<legend>
<input type="checkbox" name="asfile" value="sendit"
id="checkbox_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> />
<label for="checkbox_dump_asfile"><?php echo __('Save as file'); ?></label>
</legend>
<div class="exportoptions" id="output">
<h3><?php echo __('Output:'); ?></h3>
<ul id="output">
<li>
<input type="radio" name="output_format" value="sendit" id="radio_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> />
<label for="radio_dump_asfile"><?php echo __('Save output to a file'); ?></label>
<ul id="ul_save_asfile">
<?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
<li>
<input type="checkbox" name="onserver" value="saveit"
id="checkbox_dump_onserver"
<?php PMA_exportCheckboxCheck('onserver'); ?> />
<label for="checkbox_dump_onserver">
<?php echo sprintf(__('Save on server in %s directory'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
</label>
</li>
<li>
<input type="checkbox" name="onserverover" value="saveitover"
id="checkbox_dump_onserverover"
<?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
<label for="checkbox_dump_onserverover"><?php echo __('Overwrite existing file(s)'); ?></label>
</li>
<?php } ?>
<li>
<label for="filename_template" class="desc">
<?php
echo __('File name template:');
$trans = new PMA_Message;
$trans->addMessage('__SERVER__/');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('__DB__/');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage('__TABLE__/');
$trans->addString(__('table name'));
}
}
<?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
<input type="checkbox" name="onserver" value="saveit"
id="checkbox_dump_onserver"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportCheckboxCheck('onserver'); ?> />
<label for="checkbox_dump_onserver">
<?php echo sprintf(__('Save on server in %s directory'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
</label>,<br />
<input type="checkbox" name="onserverover" value="saveitover"
id="checkbox_dump_onserverover"
onclick="document.getElementById('checkbox_dump_onserver').checked = true;
document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
<label for="checkbox_dump_onserverover">
<?php echo __('Overwrite existing file(s)'); ?></label>
<br />
<?php } ?>
$message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.'));
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
. __('Documentation') . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
<label for="filename_template">
<?php
echo __('File name template');
echo PMA_showHint($message);
?>
</label>
<input type="text" name="filename_template" id="filename_template"
<?php
echo ' value="';
if ($export_type == 'database') {
if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
echo htmlspecialchars($_COOKIE['pma_db_filename_template']);
} else {
echo $GLOBALS['cfg']['Export']['file_template_database'];
}
} elseif ($export_type == 'table') {
if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
echo htmlspecialchars($_COOKIE['pma_table_filename_template']);
} else {
echo $GLOBALS['cfg']['Export']['file_template_table'];
}
} else {
if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
echo htmlspecialchars($_COOKIE['pma_server_filename_template']);
} else {
echo $GLOBALS['cfg']['Export']['file_template_server'];
}
}
echo '"';
?>
/>
<input type="checkbox" name="remember_template"
id="checkbox_remember_template"
<?php PMA_exportCheckboxCheck('remember_file_template'); ?> />
<label for="checkbox_remember_template">
<?php echo __('use this for future exports'); ?></label>
</li>
<li>
<?php
// charset of file
if ($cfg['AllowAnywhereRecoding']) {
echo ' <label for="select_charset_of_file" class="desc">'
. __('Character set of the file:') . '</label>' . "\n";
reset($cfg['AvailableCharsets']);
echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
echo '<option value="' . $temp_charset . '"';
if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
|| $temp_charset == $cfg['Export']['charset']) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>';
} // end foreach
echo '</select>';
} // end if
?>
</li>
<li>
<?php
// zip, gzip and bzip2 encode features
$is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress'));
$is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode'));
$is_bzip = ($cfg['BZipDump'] && @function_exists('bzcompress'));
if ($is_zip || $is_gzip || $is_bzip) { ?>
<label for="compression" class="desc"><?php echo __('Compression:'); ?></label>
<select id="compression" name="compression">
<option value="none"><?php echo __('None'); ?></option>
<?php if ($is_zip) { ?>
<option value="zip"><?php echo __('zipped'); ?></option>
<?php } if ($is_gzip) { ?>
<option value="gzip"><?php echo __('gzipped'); ?></option>
<?php } if ($is_bzip) { ?>
<option value="bzip"><?php echo __('bzipped'); ?></option>
<?php } ?>
</select>
<?php } else { ?>
<input type="hidden" name="compression" value="none" />
<?php } ?>
</li>
</ul>
</li>
<li><input type="radio" id="radio_view_as_text" name="output_format" value="astext"><label for="radio_view_as_text">View output as text</label></li>
</ul>
</div>
$trans = new PMA_Message;
$trans->addMessage('__SERVER__/');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('__DB__/');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage('__TABLE__/');
$trans->addString(__('table name'));
}
}
<div class="exportoptions" id="format">
<h3>Format:</h3>
<?php echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?>
</div>
$message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.'));
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
. __('Documentation') . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
echo PMA_showHint($message);
?>
</label>:
<input type="text" name="filename_template" id="filename_template"
<?php
echo ' value="';
if ($export_type == 'database') {
if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
echo htmlspecialchars($_COOKIE['pma_db_filename_template']);
} else {
echo $GLOBALS['cfg']['Export']['file_template_database'];
}
} elseif ($export_type == 'table') {
if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
echo htmlspecialchars($_COOKIE['pma_table_filename_template']);
} else {
echo $GLOBALS['cfg']['Export']['file_template_table'];
}
} else {
if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
echo htmlspecialchars($_COOKIE['pma_server_filename_template']);
} else {
echo $GLOBALS['cfg']['Export']['file_template_server'];
}
}
echo '"';
?>
/>
(
<input type="checkbox" name="remember_template"
id="checkbox_remember_template"
<?php PMA_exportCheckboxCheck('remember_file_template'); ?> />
<label for="checkbox_remember_template">
<?php echo __('remember template'); ?></label>
)
<div class="formelementrow">
<?php
// charset of file
if ($cfg['AllowAnywhereRecoding']) {
echo ' <label for="select_charset_of_file">'
. __('Character set of the file:') . '</label>' . "\n";
reset($cfg['AvailableCharsets']);
echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
echo '<option value="' . $temp_charset . '"';
if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
|| $temp_charset == $cfg['Export']['charset']) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>';
} // end foreach
echo '</select>';
} // end if
?>
</div>
<?php
// zip, gzip and bzip2 encode features
$is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress'));
$is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode'));
$is_bzip = ($cfg['BZipDump'] && @function_exists('bzcompress'));
if ($is_zip || $is_gzip || $is_bzip) { ?>
<div class="formelementrow">
<?php echo __('Compression'); ?>:
<input type="radio" name="compression" value="none"
id="radio_compression_none"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'none'); ?> />
<label for="radio_compression_none"><?php echo __('None'); ?></label>
<?php
if ($is_zip) { ?>
<input type="radio" name="compression" value="zip"
id="radio_compression_zip"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'zip'); ?> />
<label for="radio_compression_zip"><?php echo __('"zipped"'); ?></label>
<?php } if ($is_gzip) { ?>
<input type="radio" name="compression" value="gzip"
id="radio_compression_gzip"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'gzip'); ?> />
<label for="radio_compression_gzip"><?php echo __('"gzipped"'); ?></label>
<?php } if ($is_bzip) { ?>
<input type="radio" name="compression" value="bzip"
id="radio_compression_bzip"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'bzip2'); ?> />
<label for="radio_compression_bzip"><?php echo __('"bzipped"'); ?></label>
<?php } ?>
</div>
<?php } else { ?>
<input type="hidden" name="compression" value="none" />
<?php } ?>
</fieldset>
<div class="exportoptions" id="format_specific_opts">
<h3><?php echo __('Format-Specific Options:'); ?></h3>
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
</div>
<?php if (function_exists('PMA_set_enc_form')) { ?>
<!-- Encoding setting form appended by Y.Kawada -->
@@ -270,8 +246,8 @@ if ($is_zip || $is_gzip || $is_bzip) { ?>
<?php echo PMA_set_enc_form(' '); ?>
<?php } ?>
<fieldset class="tblFooters">
<div class="exportoptions" id="submit">
<?php PMA_externalBug(__('SQL compatibility mode'), 'mysql', '50027', '14515'); ?>
<input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" />
</fieldset>
</div>
</form>

View File

@@ -120,12 +120,26 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
echo PMA_generate_common_hidden_inputs($db, $table, 1);
}
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
echo PMA_pluginGetJavascript($import_list);
?>
<fieldset class="options">
<legend><?php echo __('File to import'); ?></legend>
<div class="importoptions">
<h3><?php echo __('File to Import:'); ?></h3>
<?php
// zip, gzip and bzip2 encode features
$compressions = array();
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 != array()) {
printf(__('<p>File may be compressed (%s) or uncompressed.</p><p>A compressed file\'s name must end in <b>.[format].[compression]</b>. Example: <b>.sql.zip</b></p>'), implode(", ", $compressions));
}
if ($GLOBALS['is_upload']) {
$uid = uniqid("");
@@ -134,13 +148,13 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
<div id="upload_form_status" style="display: none;"></div>
<div id="upload_form_status_info" style="display: none;"></div>
<div id="upload_form_form">
<label for="input_import_file"><?php echo __('Location of the text file'); ?></label>
<label for="input_import_file"><?php echo __('Location of the file:'); ?></label>
<input style="margin: 5px" type="file" name="import_file" id="input_import_file" onchange="match_file(this.value);" />
<?php
<?php
echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
// some browsers should respect this :)
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
?>
?>
</div>
</div>
<?php
@@ -192,31 +206,10 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
} // end if (recoding)
echo '</div>' . "\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 '<div class="formelementrow">' . "\n";
printf(__('Imported file compression will be automatically detected from: %s'), $compressions);
echo '</div>' . "\n";
}
echo "\n";
?>
</fieldset>
<fieldset class="options">
<legend><?php echo __('Partial import'); ?></legend>
</div>
<div class="importoptions">
<h3><?php echo __('Partial Import:'); ?></h3>
<?php
if (isset($timeout_passed) && $timeout_passed) {
@@ -229,14 +222,14 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
<div class="formelementrow">
<input type="checkbox" name="allow_interrupt" value="yes"
id="checkbox_allow_interrupt" <?php echo PMA_pluginCheckboxCheck('Import', 'allow_interrupt'); ?>/>
<label for="checkbox_allow_interrupt"><?php echo __('Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. This might be good way to import large files, however it can break transactions.'); ?></label><br />
<label for="checkbox_allow_interrupt"><?php echo __('Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. <i>(This might be good way to import large files, however it can break transactions.)</i>'); ?></label><br />
</div>
<?php
if (! (isset($timeout_passed) && $timeout_passed)) {
?>
<div class="formelementrow">
<label for="text_skip_queries"><?php echo __('Number of queries to skip from start'); ?></label>
<label for="text_skip_queries"><?php echo __('Number of rows to skip, starting from the first row:'); ?></label>
<input type="text" name="skip_queries" value="<?php echo PMA_pluginGetDefault('Import', 'skip_queries');?>" id="text_skip_queries" />
</div>
<?php
@@ -249,22 +242,20 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
<?php
}
?>
</fieldset>
</div>
<fieldset class="options">
<legend><?php echo __('Format of imported file'); ?></legend>
<?php
// Let's show format options now
echo '<div style="float: left;">';
echo PMA_pluginGetChoice('Import', 'format', $import_list);
echo '</div>';
<div class="importoptions">
<h3><?php echo __('Format:'); ?></h3>
<?php echo PMA_pluginGetChoice('Import', 'format', $import_list); ?>
<div id="import_notification"></div>
</div>
echo '<div style="float: left;">';
echo PMA_pluginGetOptions('Import', $import_list);
echo '</div>';
?>
<div class="importoptions" id="format_specific_opts">
<h3><?php echo __('Format-Specific Options:'); ?></h3>
<?php echo PMA_pluginGetOptions('Import', $import_list); ?>
</div>
<div class="clearfloat"></div>
</fieldset>
</div>
<?php
// Encoding setting form appended by Y.Kawada
if (function_exists('PMA_set_enc_form')) {
@@ -272,8 +263,8 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
}
echo "\n";
?>
<fieldset class="tblFooters">
<div class="importoptions" id="submit">
<input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" />
</fieldset>
</div>
</form>
</div>

View File

@@ -32,9 +32,9 @@ if (isset($plugin_list)) {
'text' => 'CodeGen',
'extension' => 'cs',
'mime_type' => 'text/cs',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'select', 'name' => 'format', 'text' => __('Format'), 'values' => $CG_FORMATS),
'options' => array(
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS),
),
'options_text' => __('Options'),
);

View File

@@ -18,14 +18,14 @@ if (isset($plugin_list)) {
'extension' => 'csv',
'mime_type' => 'text/comma-separated-values',
'options' => array(
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated by')),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by')),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated by')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')),
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated with:')),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:')),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated with:')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line field characters within columns')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -19,8 +19,8 @@ if (isset($plugin_list)) {
'extension' => 'csv',
'mime_type' => 'text/comma-separated-values',
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array(
'type' => 'select',
@@ -29,8 +29,8 @@ if (isset($plugin_list)) {
'win' => 'Windows',
'mac_excel2003' => 'Excel 2003 / Macintosh',
'mac_excel2008' => 'Excel 2008 / Macintosh'),
'text' => __('Excel edition')),
array('type' => 'hidden', 'name' => 'data'),
'text' => __('Excel edition:')),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -20,11 +20,15 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.ms-word',
'force_file' => true,
'options' => array(
array('type' => 'bool', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'),
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
/* what to dump (structure/data/both) */
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))),
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
array('type' => 'end_subgroup'),
/* data options */
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'egroup'),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);

View File

@@ -27,44 +27,52 @@ if (isset($plugin_list)) {
),
'options_text' => __('Options'),
);
/* what to dump (structure/data/both) */
$plugin_list['latex']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table')));
$plugin_list['latex']['options'][] =
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$plugin_list['latex']['options'][] = array('type' => 'end_subgroup');
/* Structure options */
if (!$hide_structure) {
$plugin_list['latex']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'));
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption:'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'));
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued):'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'));
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key:'));
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
}
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments'));
array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments'));
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
}
$plugin_list['latex']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
}
/* Data */
$plugin_list['latex']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'));
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption:'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'));
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued):'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'));
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key:'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:'));
$plugin_list['latex']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
} else {
/**

View File

@@ -16,7 +16,7 @@ if (isset($plugin_list)) {
'extension' => 'txt',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -20,9 +20,9 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet',
'force_file' => true,
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -26,32 +26,40 @@ if (isset($plugin_list)) {
'options' => array(), /* Filled later */
'options_text' => __('Options'),
);
/* what to dump (structure/data/both) */
$plugin_list['odt']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table')));
$plugin_list['odt']['options'][] =
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$plugin_list['odt']['options'][] = array('type' => 'end_subgroup');
/* Structure options */
if (!$hide_structure) {
$plugin_list['odt']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
}
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments'));
array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments'));
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
}
$plugin_list['odt']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
}
/* Data */
$plugin_list['odt']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
$plugin_list['odt']['options'][] =
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:'));
$plugin_list['odt']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
} else {
$GLOBALS['odt_buffer'] = '';

View File

@@ -21,8 +21,8 @@ if (isset($plugin_list)) {
'force_file' => true,
'options' => array(
array('type' => 'message_only', 'name' => 'explanation', 'text' => __('(Generates a report containing the data of a single table)')),
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title:')),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -19,7 +19,7 @@ if (isset($plugin_list)) {
'options' => array(
array(
'type' => 'hidden',
'name' => 'data',
'name' => 'structure_or_data',
),
),
'options_text' => __('Options'),

View File

@@ -25,14 +25,35 @@ if (isset($plugin_list)) {
'text' => __('SQL'),
'extension' => 'sql',
'mime_type' => 'text/x-sql',
'options' => array(
array('type' => 'text', 'name' => 'header_comment', 'text' => __('Add custom comment into header (\\n splits lines)')),
array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Comments')),
array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction')),
array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')),
),
'options_text' => __('Options'),
);
'options' => array());
/* comments */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Display comments <i>(includes info such as export timestamp, PHP version, and server version)</i>')));
$plugin_list['sql']['options'][] =
array('type' => 'text', 'name' => 'header_comment', 'text' => __('Additional custom header comment (\n splits lines):'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'dates', 'text' => __('Include a timestamp of when databases were created, last updated, and last checked'));
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Foreign key relationships'));
}
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME types'));
}
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
/* end comments */
/* enclose in a transaction */
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'));
/* disable foreign key checks */
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'));
$plugin_list['sql']['options_text'] = __('Options');
/* compatibility maximization */
$compats = PMA_DBI_getCompatibilities();
if (count($compats) > 0) {
$values = array();
@@ -40,88 +61,114 @@ if (isset($plugin_list)) {
$values[$val] = $val;
}
$plugin_list['sql']['options'][] =
array('type' => 'select', 'name' => 'compatibility', 'text' => __('SQL compatibility mode'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
array('type' => 'select', 'name' => 'compatibility', 'text' => __('Database system or older MySQL server to maximize output compatibility with:'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
unset($values);
}
/* Server export options */
/* server export options */
if ($plugin_param['export_type'] == 'server') {
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'text' => __('Database export options'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s'), 'DROP DATABASE'));
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
}
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>'));
}
/* Structure options */
if (!$hide_structure) {
/* what to dump (structure/data/both) */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table')));
$plugin_list['sql']['options'][] =
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
/* begin Structure options */
if (!$hide_structure) {
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
if ($plugin_param['export_type'] == 'table') {
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
/* begin SQL Statements */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'add_statements', 'text' => __('Add statements:')));
if ($plugin_param['export_type'] == 'table') {
if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) {
$drop_clause = 'DROP VIEW';
$drop_clause = '<code>DROP VIEW</code>';
} else {
$drop_clause = 'DROP TABLE';
$drop_clause = '<code>DROP TABLE</code>';
}
} else {
$drop_clause = 'DROP TABLE / VIEW / PROCEDURE / FUNCTION';
if (PMA_MYSQL_INT_VERSION > 50100) {
$drop_clause .= ' / EVENT';
$drop_clause = '<code>DROP TABLE / VIEW / PROCEDURE / FUNCTION</code>';
if (PMA_MYSQL_INT_VERSION > 50100) {
$drop_clause .= '<code> / EVENT</code>';
}
}
$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'), '<code>CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT</code>' : '</code>')));
/* 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' => __('<code>CREATE TABLE</code> 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' => __('<code>IF NOT EXISTS</code>'));
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
array('type' => 'bool', 'name' => 'auto_increment', 'text' => __('<code>AUTO_INCREMENT</code>'));
$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 <i>(Protects field and table names formed with special characters)</i>'));
$plugin_list['sql']['options'][] =
array('type' => 'end_group');
}
/* end Structure options */
/* Data */
/* begin Data options */
$plugin_list['sql']['options'][] =
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
/* begin SQL statements */
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Add statements:')));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Complete inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_complete-insert-option'));
array('type' => 'bool', 'name' => 'delayed', 'text' => __('<code>INSERT DELAYED</code>'));
$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' => __('<code>INSERT IGNORE</code>'));
$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 <code>INSERT</code> statement <br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)</code>'),
'extended' => __('insert multiple rows in every <code>INSERT</code> statement<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
'both' => __('both of the above<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
'none' => __('neither of the above<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code>')));
$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 <i>(for example, "abc" becomes 0x616263)</i>'));
/* 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 <i>(enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)</i>'));
$plugin_list['sql']['options'][] = array('type' => 'end_group');
/* end Data options */
}
} else {
@@ -389,7 +436,7 @@ function PMA_exportDBFooter($db)
foreach($procedure_names as $procedure_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
}
$text .= PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf;
}
@@ -403,7 +450,7 @@ function PMA_exportDBFooter($db)
foreach($function_names as $function_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
}
$text .= PMA_DBI_get_definition($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf;
}
@@ -417,7 +464,7 @@ function PMA_exportDBFooter($db)
foreach($event_names as $event_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
}
$text .= PMA_DBI_get_definition($db, 'EVENT', $event_name) . $delimiter . $crlf . $crlf;
}
@@ -953,7 +1000,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
}
// scheme for inserting fields
if (isset($GLOBALS['sql_columns'])) {
if ($GLOBALS['sql_insert_syntax'] == 'complete' || $GLOBALS['sql_insert_syntax'] == 'both') {
$fields = implode(', ', $field_set);
$schema_insert = $sql_command . $insert_delayed .' INTO ' . PMA_backquote($table, $sql_backquotes)
// avoid EOL blank
@@ -968,7 +1015,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$replace = array('\0', '\n', '\r', '\Z');
$current_row = 0;
$query_size = 0;
if (isset($GLOBALS['sql_extended']) && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
if (($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
$separator = ',';
$schema_insert .= $crlf;
} else {
@@ -1032,7 +1079,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
} else {
// Extended inserts case
if (isset($GLOBALS['sql_extended'])) {
if ($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') {
if ($current_row == 1) {
$insert_line = $schema_insert . '(' . implode(', ', $values) . ')';
} else {

View File

@@ -18,22 +18,15 @@ if (isset($plugin_list)) {
'extension' => 'txt',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'bool',
'name' => 'structure',
'text' => __('Structure'),
'force' => 'data'),
array('type' => 'bgroup',
'name' => 'data',
'text' => __('Data'),
'force' => 'structure'),
array('type' => 'text',
'name' => 'null',
'text' => __('Replace NULL by')),
array('type' => 'bool',
'name' => 'columns',
'text' => __('Put columns names in the first row')),
array('type' => 'egroup'),
),
/* what to dump (structure/data/both) */
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))),
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
array('type' => 'end_subgroup'),
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);
} else {

View File

@@ -20,9 +20,9 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.ms-excel',
'force_file' => true,
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -20,9 +20,9 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'force_file' => true,
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options'),
);

View File

@@ -19,26 +19,26 @@ if (isset($plugin_list)) {
'extension' => 'xml',
'mime_type' => 'text/xml',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
),
'options_text' => __('Options')
);
/* Export structure */
$plugin_list['xml']['options'][] =
array('type' => 'bgroup', 'name' => 'export_struc', 'text' => __('Export Structure Schemas (recommended)'));
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):')));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Export functions'));
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Export procedures'));
array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Procedures'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Export tables'));
array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Tables'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Export triggers'));
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Export views'));
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views'));
$plugin_list['xml']['options'][] =
array('type' => 'egroup');
array('type' => 'end_subgroup');
/* Data */
$plugin_list['xml']['options'][] =

View File

@@ -22,7 +22,7 @@ if (isset($plugin_list)) {
'options' => array(
array(
'type' => 'hidden',
'name' => 'data',
'name' => 'structure_or_data',
),
),
'options_text' => __('Options'),

View File

@@ -24,17 +24,17 @@ if (isset($plugin_list)) {
'options' => array(
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated with:'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated with:'), 'size' => 2),
),
'options_text' => __('Options'),
);
if ($plugin_param !== 'table') {
$plugin_list['csv']['options'][] =
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row'));
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>'));
} else {
$plugin_list['csv']['options'][] =
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names'));

View File

@@ -22,10 +22,10 @@ if (isset($plugin_list)) {
'text' => __('Open Document Spreadsheet'),
'extension' => 'ods',
'options' => array(
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
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 <i>(ex. 12.00% to .12)</i>')),
array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies <i>(ex. $5.00 to 5.00)</i>')),
),
'options_text' => __('Options'),
);

View File

@@ -29,7 +29,7 @@ if (isset($plugin_list)) {
array(
'type' => 'select',
'name' => 'compatibility',
'text' => __('SQL compatibility mode'),
'text' => __('SQL compatibility mode:'),
'values' => $values,
'doc' => array(
'manual_MySQL_Database_Administration',
@@ -39,7 +39,7 @@ if (isset($plugin_list)) {
array(
'type' => 'bool',
'name' => 'no_auto_value_on_zero',
'text' => __('Do not use AUTO_INCREMENT for zero values'),
'text' => __('Do not use <code>AUTO_INCREMENT</code> for zero values'),
'doc' => array(
'manual_MySQL_Database_Administration',
'Server_SQL_mode',

View File

@@ -21,7 +21,7 @@ if (isset($plugin_list)) {
'text' => __('Excel 97-2003 XLS Workbook'),
'extension' => 'xls',
'options' => array(
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
),
'options_text' => __('Options'),
);

View File

@@ -21,7 +21,7 @@ if (isset($plugin_list)) {
'text' => __('Excel 2007 XLSX Workbook'),
'extension' => 'xlsx',
'options' => array(
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
),
'options_text' => __('Options'),
);

View File

@@ -142,37 +142,44 @@ function PMA_pluginIsActive($section, $opt, $val)
/**
* string PMA_pluginGetChoice(string $section, string $name, array &$list, string $cfgname)
*
* returns html radio form element for plugin choice
* returns html select form element for plugin choice
* and hidden fields denoting whether each plugin must be exported as a file
*
* @uses PMA_pluginIsActive()
* @uses PMA_pluginGetDefault()
* @uses PMA_getString()
* @param string $section name of config section in
* $GLOBALS['cfg'][$section] for plugin
* @param string $name name of radio element
* @param string $name name of select element
* @param array &$list array with plugin configuration defined in plugin file
* @param string $cfgname name of config value, if none same as $name
* @return string html input radio tag
* @return string html select tag
*/
function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
{
if (!isset($cfgname)) {
$cfgname = $name;
}
$ret = '';
$ret = '<select id="plugins" name="' . $name . '">';
$default = PMA_pluginGetDefault($section, $cfgname);
foreach ($list as $plugin_name => $val) {
$ret .= '<!-- ' . $plugin_name . ' -->' . "\n";
$ret .= '<input type="radio" name="' . $name . '" value="' . $plugin_name . '"'
. ' id="radio_plugin_' . $plugin_name . '"'
. ' onclick="if(this.checked) { hide_them_all();';
if (isset($val['force_file'])) {
$ret .= 'document.getElementById(\'checkbox_dump_asfile\').checked = true;';
$ret .= '<option';
if($plugin_name == $default) {
$ret .= ' selected="selected"';
}
$ret .= ' document.getElementById(\'' . $plugin_name . '_options\').style.display = \'block\'; };'
.' return true"'
. PMA_pluginIsActive($section, $cfgname, $plugin_name) . '/>' . "\n";
$ret .= '<label for="radio_plugin_' . $plugin_name . '">'
. PMA_getString($val['text']) . '</label>' . "\n";
$ret .= '<br />' . "\n";
$ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . '</option> \n';
}
$ret .= '</select>' . "\n";
// Whether each plugin has to be saved as a file
foreach ($list as $plugin_name => $val) {
$ret .= '<input type="hidden" id="force_file_' . $plugin_name . '" value="';
if(isset($val['force_file'])) {
$ret .= 'true';
} else {
$ret .= 'false';
}
$ret .= '">'. "\n";
}
return $ret;
}
@@ -180,7 +187,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
/**
* string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt)
*
* returns single option in a table row
* returns single option in a list element
*
* @uses PMA_getString()
* @uses PMA_pluginCheckboxCheck()
@@ -196,7 +203,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
{
$ret = "\n";
if ($opt['type'] == 'bool') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']);
@@ -210,9 +217,8 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= ' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'text') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"'
@@ -220,13 +226,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
. ' id="text_' . $plugin_name . '_' . $opt['name'] . '"'
. (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '')
. (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '') . ' />';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'message_only') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<p class="desc">' . PMA_getString($opt['text']) . '</p>';
$ret .= '</div>' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<p>' . PMA_getString($opt['text']) . '</p>';
} elseif ($opt['type'] == 'select') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<label for="select_' . $plugin_name . '_' . $opt['name'] . '" class="desc">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"'
@@ -240,33 +244,29 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= '>' . PMA_getString($val) . '</option>';
}
$ret .= '</select>';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'radio') {
$default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']);
foreach($opt['values'] as $key => $val) {
$ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $opt['name'] . '" value="' . $key
. '" id="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '"';
if($key == $default) {
$ret .= 'checked="checked"';
}
$ret .= '>' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">'
. PMA_getString($val) . '</label>';
}
} elseif ($opt['type'] == 'hidden') {
$ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />';
} elseif ($opt['type'] == 'bgroup') {
$ret .= '<fieldset><legend>';
/* No checkbox without name */
if (!empty($opt['name'])) {
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']);
if (isset($opt['force'])) {
/* Same code is also few lines higher, update both if needed */
$ret .= ' onclick="if (!this.checked &amp;&amp; '
. '(!document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\') '
. '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\').checked)) '
. 'return false; else return true;"';
}
$ret .= ' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>';
} else {
$ret .= PMA_getString($opt['text']);
}
$ret .= '</legend>';
} elseif ($opt['type'] == 'egroup') {
$ret .= '</fieldset>';
} elseif ($opt['type'] == 'begin_group') {
$ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $opt['name'] . '"><h4>' . PMA_getString($opt['text']) . '</h4><ul>';
} elseif ($opt['type'] == 'end_group') {
$ret .= '</ul></div>';
} 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']) . '<ul id="ul_' . $opt['subgroup_header']['name'] . '">';
} elseif ($opt['type'] == 'end_subgroup') {
$ret .= '</ul>';
} else {
/* This should be seen only by plugin writers, so I do not thing this
* needs translation. */
@@ -279,6 +279,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]);
}
}
$ret .= "\n";
return $ret;
}
@@ -286,10 +287,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
/**
* string PMA_pluginGetOptions(string $section, array &$list)
*
* return html fieldset with editable options for plugin
* return html div with editable options for plugin
*
* @uses PMA_getString()
* @uses PMA_pluginGetOneOption()
* @uses PMA_pluginGetDefault();
* @param string $section name of config section in $GLOBALS['cfg'][$section]
* @param array &$list array with plugin configuration defined in plugin file
* @return string html fieldset with plugin options
@@ -297,10 +299,14 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
function PMA_pluginGetOptions($section, &$list)
{
$ret = '';
$default = PMA_pluginGetDefault('Export', 'format');
// Options for plugins that support them
foreach ($list as $plugin_name => $val) {
$ret .= '<fieldset id="' . $plugin_name . '_options" class="options">';
$ret .= '<legend>' . PMA_getString($val['options_text']) . '</legend>';
$ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options"';
if($plugin_name != $default) {
$ret .= ' style="display: none;">';
}
$ret .= '<ul>';
$count = 0;
if (isset($val['options']) && count($val['options']) > 0) {
foreach ($val['options'] as $id => $opt) {
@@ -311,70 +317,7 @@ function PMA_pluginGetOptions($section, &$list)
if ($count == 0) {
$ret .= __('This format has no options');
}
$ret .= '</fieldset>';
$ret .= '</ul></div>';
}
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 = '
<script type="text/javascript">
//<![CDATA[
function hide_them_all() {
';
foreach ($list as $plugin_name => $val) {
$ret .= 'document.getElementById("' . $plugin_name . '_options").style.display = "none";' . "\n";
}
$ret .= '
}
function init_options() {
hide_them_all();
';
foreach ($list as $plugin_name => $val) {
$ret .= 'if (document.getElementById("radio_plugin_' . $plugin_name . '").checked) {' . "\n";
if (isset($val['force_file'])) {
$ret .= 'document.getElementById(\'checkbox_dump_asfile\').checked = true;' . "\n";
}
$ret .= 'document.getElementById("' . $plugin_name . '_options").style.display = "block";' . "\n";
$ret .= ' } else ' . "\n";
}
$ret .= '
{
;
}
}
function match_file(fname) {
farr = fname.toLowerCase().split(".");
if (farr.length != 0) {
len = farr.length
if (farr[len - 1] == "gz" || farr[len - 1] == "bz2" || farr[len -1] == "zip") len--;
switch (farr[len - 1]) {
';
foreach ($list as $plugin_name => $val) {
$ret .= 'case "' . $val['extension'] . '" :';
$ret .= 'document.getElementById("radio_plugin_' . $plugin_name . '").checked = true;';
$ret .= 'init_options();';
$ret .= 'break;' . "\n";
}
$ret .='
}
}
}
$(document).ready(init_options);
//]]>
</script>
';
return $ret;
}
?>

View File

@@ -238,16 +238,10 @@ if (! $GLOBALS['server']) {
.'</noscript>' . "\n"
.'</form>' . "\n";
} else {
if (! empty($db)) {
echo '<div id="databaseList">' . "\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 '</div>' . "\n";
}
}
?>

View File

@@ -12,6 +12,7 @@
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'export.js';
/**
* Displays the links
@@ -23,12 +24,12 @@ $checkall_url = 'server_export.php?'
. PMA_generate_common_url()
. '&amp;goto=db_export.php';
$multi_values = '<div align="center">';
$multi_values = '<div align="left">';
$multi_values .= '<a href="' . $checkall_url . '&amp;selectall=1" onclick="setSelectOptions(\'dump\', \'db_select[]\', true); return false;">' . __('Select All') . '</a>
/
<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'db_select[]\', false); return false;">' . __('Unselect All') . '</a><br />';
$multi_values .= '<select name="db_select[]" size="10" multiple="multiple">';
$multi_values .= '<select name="db_select[]" id="db_select" size="10" multiple="multiple">';
$multi_values .= "\n";
foreach ($GLOBALS['pma']->databases as $current_db) {
@@ -41,7 +42,7 @@ foreach ($GLOBALS['pma']->databases as $current_db) {
$multi_values .= ' <option value="' . $current_db . '"' . $is_selected . '>' . $current_db . '</option>' . "\n";
} // end while
$multi_values .= "\n";
$multi_values .= '</select></div><br />';
$multi_values .= '</select></div>';
$export_type = 'server';
require_once './libraries/display_export.lib.php';

View File

@@ -11,6 +11,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'import.js';
/**
* Does the common work
*/

View File

@@ -11,6 +11,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'export.js';
/**
* Gets tables informations and displays top links
*/

View File

@@ -11,6 +11,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'import.js';
/**
* Gets tables informations and displays top links
*/

View File

@@ -1228,3 +1228,70 @@ table#serverconnection_trg_local {
*/
.invalid_value
{background:#F00;}
/**
* Export styles
*/
select#db_select, select#table_select {
width: 400px;
}
.exportoptions h3, .importoptions h3 {
border-bottom: 1px #999999 solid;
}
.exportoptions ul, .importoptions ul, .format_specific_options ul {
list-style-type: none;
margin-bottom: 15px;
}
.exportoptions li, .importoptions li {
margin: 7px;
}
.exportoptions label, .importoptions label, .exportoptions p, .importoptions p {
margin: 5px;
float: none;
}
#csv_options .desc, #latex_options .desc, #output .desc{
float: left;
width: 15em;
}
.exportoptions, .importoptions {
margin: 30px 30px 30px 10px
}
.exportoptions #buttonGo, .importoptions #buttonGo {
padding: 5px 30px;
-moz-border-radius: 11px;
-webkit-border-radius:
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
background: -moz-linear-gradient(top, #ffffff, #cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc');
border: 1px solid #444444;
background-color: #ffffff;
cursor: pointer;
}
.export_sub_options {
margin: 30px 0px 0px 0px;
}
.export_sub_options h4 {
border-bottom: 1px #999999 solid;
}
.importoptions #import_notification {
margin: 10px 0px;
font-style: italic;
}
p.desc {
margin: 5px;
}
.formelementrow {
margin: 5px 0px 5px 0px;
}