Merge branch 'master' of ssh://repo.or.cz/srv/git/phpmyadmin/lorilee
This commit is contained in:
64
enum_editor.php
Normal file
64
enum_editor.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
require_once './libraries/header_http.inc.php';
|
||||
require_once './libraries/header_meta_style.inc.php';
|
||||
?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="enum_editor.php" method="get">
|
||||
<div id="enum_editor_no_js">
|
||||
<h3>Values for the column "<?php echo $_GET['field']; ?>"</h3>
|
||||
<p>Enter each value in a separate field.</p>
|
||||
<div id="values">
|
||||
<?php
|
||||
// Get the new values from the submitted form or the old ones from tbl_alter.php
|
||||
$values = '';
|
||||
for($i = 1; $i <= $_GET['num_fields']; $i++) {
|
||||
$input_name = "field" . $i;
|
||||
$values .= $_GET[$input_name] . ',';
|
||||
}
|
||||
if (isset($_GET['values'])) {
|
||||
$values = urldecode($_GET['values']);
|
||||
}
|
||||
// Display the input fields containing each of the values, removing the empty ones
|
||||
$field_counter = 0;
|
||||
$stripped_values = array();
|
||||
foreach(split(",", $values) as $value) {
|
||||
if(trim($value) != "") {
|
||||
$field_counter++;
|
||||
echo '<input type="text" size="30" value=' . $value . ' name="field' . $field_counter . '" />';
|
||||
$stripped_values[] = $value;
|
||||
}
|
||||
}
|
||||
// If extra fields are added, display them
|
||||
if($_GET['add_extra_fields']) {
|
||||
$extra_fields = $_GET['extra_fields'];
|
||||
$total_fields = $extra_fields + $field_counter;
|
||||
for($i = ($field_counter+1); $i <= $total_fields; $i++) {
|
||||
echo '<input type="text" size="30" name="field' . $i . '"/>';
|
||||
}
|
||||
} else {
|
||||
$total_fields = $field_counter;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<p>
|
||||
<input type="checkbox" name="add_extra_fields"> Add <input type="text" value="1" name="extra_fields" size="2"/> more values
|
||||
</p>
|
||||
<input type="hidden" name="token" value="<?php echo $_GET['token']; ?>" />
|
||||
<input type="hidden" name="num_fields" value="<?php echo $total_fields; ?>" />
|
||||
<input type="hidden" name="field" value="<?php echo $_GET['field']; ?>" />
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
|
||||
<div id="enum_editor_output">
|
||||
<h3>Output</h3>
|
||||
<p>Copy and paste the joined values into the "Length/Values" field</p>
|
||||
<textarea id="joined_values" cols="95" rows="5"><?php echo join(",", $stripped_values); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
25
export.php
25
export.php
@@ -42,6 +42,14 @@ $compression = false;
|
||||
$onserver = false;
|
||||
$save_on_server = false;
|
||||
$buffer_needed = false;
|
||||
|
||||
// Is it a quick or custom export?
|
||||
if($_REQUEST['quick_or_custom'] == 'quick') {
|
||||
$quick_export = true;
|
||||
} else {
|
||||
$quick_export = false;
|
||||
}
|
||||
|
||||
if ($_REQUEST['output_format'] == 'astext') {
|
||||
$asfile = false;
|
||||
} else {
|
||||
@@ -50,12 +58,17 @@ if ($_REQUEST['output_format'] == 'astext') {
|
||||
$compression = $_REQUEST['compression'];
|
||||
$buffer_needed = true;
|
||||
}
|
||||
if (!empty($_REQUEST['onserver'])) {
|
||||
$onserver = $_REQUEST['onserver'];
|
||||
if (($quick_export && !empty($_REQUEST['quick_export_onserver'])) || (!$quick_export && !empty($_REQUEST['onserver']))) {
|
||||
if($quick_export) {
|
||||
$onserver = $_REQUEST['quick_export_onserver'];
|
||||
} else {
|
||||
$onserver = $_REQUEST['onserver'];
|
||||
}
|
||||
// Will we save dump on server?
|
||||
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
|
||||
}
|
||||
}
|
||||
|
||||
// Does export require to be into file?
|
||||
if (isset($export_list[$type]['force_file']) && ! $asfile) {
|
||||
$message = PMA_Message::error(__('Selected export type has to be saved in file!'));
|
||||
@@ -289,7 +302,7 @@ if ($asfile) {
|
||||
if ($save_on_server) {
|
||||
$save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename);
|
||||
unset($message);
|
||||
if (file_exists($save_filename) && empty($onserverover)) {
|
||||
if (file_exists($save_filename) && ((!$quick_export && empty($onserverover)) || ($quick_export && $_REQUEST['quick_export_onserverover'] != 'saveitover'))) {
|
||||
$message = PMA_Message::error(__('File %s already exists on server, change filename or check overwrite option.'));
|
||||
$message->addParam($save_filename);
|
||||
} else {
|
||||
@@ -528,7 +541,7 @@ if ($export_type == 'server') {
|
||||
}
|
||||
|
||||
$is_view = PMA_Table::isView($db, $table);
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
|
||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) {
|
||||
break;
|
||||
}
|
||||
@@ -536,7 +549,7 @@ if ($export_type == 'server') {
|
||||
// If this is an export of a single view, we have to export data;
|
||||
// for example, a PDF report
|
||||
// if it is a merge table, no data is exported
|
||||
if (isset($GLOBALS[$what . '_data']) && ! PMA_Table::isMerge($db, $table)) {
|
||||
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) {
|
||||
if (!empty($sql_query)) {
|
||||
// only preg_replace if needed
|
||||
if (!empty($add_query)) {
|
||||
@@ -554,7 +567,7 @@ if ($export_type == 'server') {
|
||||
}
|
||||
// now export the triggers (needs to be done after the data because
|
||||
// triggers can modify already imported tables)
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
|
||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
|
||||
break 2;
|
||||
}
|
||||
|
62
js/export.js
62
js/export.js
@@ -118,7 +118,7 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
/**
|
||||
* For SQL plugin, if "CREATE TABLE options" is checked/uncheck, check/uncheck each of its sub-options
|
||||
* For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("#checkbox_sql_create_table_statements").change(function() {
|
||||
@@ -148,3 +148,63 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggles display of options when quick and custom export are selected
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("input[type='radio'][name='quick_or_custom']").change(function() {
|
||||
if($("$(this):checked").attr("value") == "custom") {
|
||||
$("#databases_and_tables").show();
|
||||
$("#rows").show();
|
||||
$("#output").show();
|
||||
$("#format_specific_opts").show();
|
||||
$("#output_quick_export").hide();
|
||||
var selected_plugin_name = $("#plugins option:selected").attr("value");
|
||||
$("#" + selected_plugin_name + "_options").show();
|
||||
} else {
|
||||
$("#databases_and_tables").hide();
|
||||
$("#rows").hide();
|
||||
$("#output").hide();
|
||||
$("#format_specific_opts").hide();
|
||||
$("#output_quick_export").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Sets up the interface for Javascript-enabled browsers since the default is for
|
||||
* Javascript-disabled browsers
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("#quick_or_custom").show();
|
||||
$("#databases_and_tables").hide();
|
||||
$("#rows").hide();
|
||||
$("#output_quick_export").show();
|
||||
$("#output").hide();
|
||||
$("#format_specific_opts").hide();
|
||||
$("#scroll_to_options_msg").hide();
|
||||
$(".format_specific_options").hide();
|
||||
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0});
|
||||
$(".format_specific_options h3").remove();
|
||||
});
|
||||
|
||||
/**
|
||||
* Disables the "Dump some row(s)" sub-options when it is not selected
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("input[type='radio'][name='allrows']").change(function() {
|
||||
// alert(("$(this):checked").attr("name"));
|
||||
if($("input[type='radio'][name='allrows']:checked").attr("value") == "1") {
|
||||
$("label[for='limit_to']").fadeTo('fast', 0.4);
|
||||
$("label[for='limit_from']").fadeTo('fast', 0.4);
|
||||
$("input[type='text'][name='limit_to']").attr('disabled', 'disabled');
|
||||
$("input[type='text'][name='limit_from']").attr('disabled', 'disabled');
|
||||
} else {
|
||||
$("label[for='limit_to']").fadeTo('fast', 1);
|
||||
$("label[for='limit_from']").fadeTo('fast', 1);
|
||||
$("input[type='text'][name='limit_to']").removeAttr('disabled');
|
||||
$("input[type='text'][name='limit_from']").removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
});
|
@@ -1727,3 +1727,102 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected
|
||||
*/
|
||||
function toggle_enum_notice(selectElement) {
|
||||
var enum_notice_id = selectElement.attr("id").split("_")[1];
|
||||
enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1);
|
||||
var selectedType = selectElement.attr("value");
|
||||
if(selectedType == "ENUM" || selectedType == "SET") {
|
||||
$("p[id='enum_notice_" + enum_notice_id + "']").show();
|
||||
} else {
|
||||
$("p[id='enum_notice_" + enum_notice_id + "']").hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the hiding/showing of the "Open in ENUM/SET editor" message when
|
||||
* the page loads and when the selected data type changes
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$.each($("select[class='column_type']"), function() {
|
||||
toggle_enum_notice($(this));
|
||||
});
|
||||
$("select[class='column_type']").change(function() {
|
||||
toggle_enum_notice($(this));
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Closes the ENUM/SET editor and removes the data in it
|
||||
*/
|
||||
function disable_popup() {
|
||||
$("#popup_background").fadeOut("fast");
|
||||
$("#enum_editor").fadeOut("fast");
|
||||
// clear the data from the text boxes
|
||||
$("#enum_editor #values input").remove();
|
||||
$("#enum_editor input[type='hidden']").remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the ENUM/SET editor and controls its functions
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("a[class='open_enum_editor']").click(function() {
|
||||
// Center the popup
|
||||
var windowWidth = document.documentElement.clientWidth;
|
||||
var windowHeight = document.documentElement.clientHeight;
|
||||
var popupWidth = $("#enum_editor").width();
|
||||
var popupHeight = $("#enum_editor").height();
|
||||
var top = windowHeight/2 - popupHeight/2;
|
||||
var left = windowWidth/2 - popupWidth/2;
|
||||
$("#enum_editor").css({"position":"absolute", "top": top, "left": left});
|
||||
// Make it appear
|
||||
$("#popup_background").css({"opacity":"0.7"});
|
||||
$("#popup_background").fadeIn("fast");
|
||||
$("#enum_editor").fadeIn("fast");
|
||||
// Get the values
|
||||
var values = $(this).parent().prev("input").attr("value").split(",");
|
||||
$.each(values, function(index, val) {
|
||||
$("#enum_editor #values").append("<input type='text' value=" + val + " />");
|
||||
});
|
||||
// So we know which column's data is being edited
|
||||
$("#enum_editor").append("<input type='hidden' value='" + $(this).parent().prev("input").attr("id") + "' />");
|
||||
return false;
|
||||
});
|
||||
|
||||
// If the "close" link is clicked, close the enum editor
|
||||
$("a[class='close_enum_editor']").click(function() {
|
||||
disable_popup();
|
||||
});
|
||||
|
||||
// If the "cancel" link is clicked, close the enum editor
|
||||
$("a[class='cancel_enum_editor']").click(function() {
|
||||
disable_popup();
|
||||
});
|
||||
|
||||
// When the submit button is clicked, put the data back into the original form if
|
||||
// the "add x more values" checkbox is not checked. Otherwise, just insert x more
|
||||
// textboxes
|
||||
$("#enum_editor input[type='submit']").click(function() {
|
||||
if($("input[type='checkbox'][name='add_extra_fields']").attr("checked")) {
|
||||
for(i = 0; i < $("input[type='text'][name='extra_fields']").attr("value"); i++) {
|
||||
$("#enum_editor #values").append("<input type='text' />");
|
||||
}
|
||||
// Uncheck it
|
||||
$("input[type='checkbox'][name='add_extra_fields']").removeAttr("checked");
|
||||
} else {
|
||||
var value_array = new Array();
|
||||
$.each($("#enum_editor #values input"), function(index, input_element) {
|
||||
val = jQuery.trim(input_element.value);
|
||||
if(val != "") {
|
||||
value_array.push("'" + val + "'");
|
||||
}
|
||||
});
|
||||
var values_id = $("#enum_editor input[type='hidden']").attr("value");
|
||||
$("input[id='" + values_id + "']").attr("value", value_array.join(","));
|
||||
disable_popup();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
118
js/import.js
118
js/import.js
@@ -5,53 +5,56 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of each plugin's options
|
||||
* according to the currently selected plugin from the dropdown list
|
||||
*/
|
||||
function changePluginOpts() {
|
||||
$(".format_specific_options").each(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
var selected_plugin_name = $("#plugins option:selected").attr("value");
|
||||
$("#" + selected_plugin_name + "_options").fadeIn('slow');
|
||||
if(selected_plugin_name == "csv") {
|
||||
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
|
||||
} else {
|
||||
$("#import_notification").text("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of each plugin's options and sets the selected value
|
||||
* in the plugin dropdown list according to the format of the selected file
|
||||
*/
|
||||
function matchFile(fname) {
|
||||
fname_array = fname.toLowerCase().split(".");
|
||||
len = fname_array.length;
|
||||
if(len != 0) {
|
||||
extension = fname_array[len - 1];
|
||||
if (extension == "gz" || extension == "bz2" || extension == "zip") {
|
||||
len--;
|
||||
}
|
||||
$("#plugins option:selected").removeAttr("selected");
|
||||
switch (fname_array[len - 1]) {
|
||||
case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break;
|
||||
case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break;
|
||||
case "ldi" : $("select[name='format'] option[value='ldi']").attr('selected', 'selected'); break;
|
||||
case "ods" : $("select[name='format'] option[value='ods']").attr('selected', 'selected'); break;
|
||||
case "sql" : $("select[name='format'] option[value='sql']").attr('selected', 'selected'); break;
|
||||
case "xls" : $("select[name='format'] option[value='xls']").attr('selected', 'selected'); break;
|
||||
case "xlsx" : $("select[name='format'] option[value='xlsx']").attr('selected', 'selected'); break;
|
||||
case "xml" : $("select[name='format'] option[value='xml']").attr('selected', 'selected'); break;
|
||||
}
|
||||
changePluginOpts();
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
// Initially display the options for the selected plugin
|
||||
changePluginOpts();
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of each plugin's options
|
||||
* according to the currently selected plugin from the dropdown list
|
||||
*/
|
||||
function changePluginOpts() {
|
||||
$(".format_specific_options").each(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
var selected_plugin_name = $("#plugins option:selected").attr("value");
|
||||
$("#" + selected_plugin_name + "_options").fadeIn('slow');
|
||||
if(selected_plugin_name == "csv") {
|
||||
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
|
||||
} else {
|
||||
$("#import_notification").text("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of each plugin's options and sets the selected value
|
||||
* in the plugin dropdown list according to the format of the selected file
|
||||
*/
|
||||
function matchFile(fname) {
|
||||
fname_array = fname.toLowerCase().split(".");
|
||||
len = fname_array.length;
|
||||
if(len != 0) {
|
||||
extension = fname_array[len - 1];
|
||||
if (extension == "gz" || extension == "bz2" || extension == "zip") {
|
||||
len--;
|
||||
}
|
||||
$("option:selected").removeAttr("selected");
|
||||
switch (fname_array[len - 1]) {
|
||||
case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break;
|
||||
case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break;
|
||||
case "ldi" : $("select[name='format'] option[value='ldi']").attr('selected', 'selected'); break;
|
||||
case "ods" : $("select[name='format'] option[value='ods']").attr('selected', 'selected'); break;
|
||||
case "sql" : $("select[name='format'] option[value='sql']").attr('selected', 'selected'); break;
|
||||
case "xls" : $("select[name='format'] option[value='xls']").attr('selected', 'selected'); break;
|
||||
case "xlsx" : $("select[name='format'] option[value='xlsx']").attr('selected', 'selected'); break;
|
||||
case "xml" : $("select[name='format'] option[value='xml']").attr('selected', 'selected'); break;
|
||||
}
|
||||
changePluginOpts();
|
||||
}
|
||||
}
|
||||
|
||||
$("#plugins").change(function() {
|
||||
// Whenever the selected plugin changes, change the options displayed
|
||||
$("#plugins").change(function() {
|
||||
changePluginOpts();
|
||||
});
|
||||
|
||||
@@ -61,5 +64,26 @@ $(document).ready(function() {
|
||||
|
||||
$("#select_local_import_file").change(function() {
|
||||
matchFile($(this).attr("value"));
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* When the "Browse the server" form is clicked or the "Select from the web server upload directory"
|
||||
* form is clicked, the radio button beside it becomes selected and the other form becomes disabled.
|
||||
*/
|
||||
$("#input_import_file").focus(function() {
|
||||
$("#radio_import_file").attr('checked', 'checked');
|
||||
$("#radio_local_import_file").removeAttr('checked');
|
||||
});
|
||||
$("#select_local_import_file").focus(function() {
|
||||
$("#radio_local_import_file").attr('checked', 'checked');
|
||||
$("#radio_import_file").removeAttr('checked');
|
||||
});
|
||||
|
||||
/**
|
||||
* Set up the interface for Javascript-enabled browsers since the default is for
|
||||
* Javascript-disabled browsers
|
||||
*/
|
||||
$("#scroll_to_options_msg").hide();
|
||||
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 });
|
||||
$(".format_specific_options h3").remove();
|
||||
});
|
@@ -2856,4 +2856,46 @@ function PMA_js($code, $print=true)
|
||||
|
||||
return $out;
|
||||
}
|
||||
?>
|
||||
|
||||
/**
|
||||
* Display the form used to browse anywhere on the local server for the file to import
|
||||
*/
|
||||
function PMA_browseUploadFile($max_upload_size) {
|
||||
$uid = uniqid("");
|
||||
echo '<label for="radio_import_file">' . __("Browse your computer:") . '</label>';
|
||||
echo '<div id="upload_form_status" style="display: none;"></div>';
|
||||
echo '<div id="upload_form_status_info" style="display: none;"></div>';
|
||||
echo '<input type="file" name="import_file" id="input_import_file" />';
|
||||
echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
|
||||
// some browsers should respect this :)
|
||||
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the form used to select a file to import from the server upload directory
|
||||
*/
|
||||
function PMA_selectUploadFile($import_list, $uploaddir) {
|
||||
echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
|
||||
$extensions = '';
|
||||
foreach ($import_list as $key => $val) {
|
||||
if (!empty($extensions)) {
|
||||
$extensions .= '|';
|
||||
}
|
||||
$extensions .= $val['extension'];
|
||||
}
|
||||
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
|
||||
|
||||
$files = PMA_getFileSelectOptions(PMA_userDir($uploaddir), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
|
||||
if ($files === FALSE) {
|
||||
PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
|
||||
} elseif (!empty($files)) {
|
||||
echo "\n";
|
||||
echo ' <select style="margin: 5px" size="1" name="local_import_file" id="select_local_import_file">' . "\n";
|
||||
echo ' <option value=""> </option>' . "\n";
|
||||
echo $files;
|
||||
echo ' </select>' . "\n";
|
||||
} elseif (empty ($files)) {
|
||||
echo '<i>There are no files to upload</i>';
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1306,7 +1306,7 @@ $cfg['Export']['csv_null'] = 'NULL';
|
||||
*
|
||||
* @global string $cfg['Export']['csv_separator']
|
||||
*/
|
||||
$cfg['Export']['csv_separator'] = ';';
|
||||
$cfg['Export']['csv_separator'] = ',';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1539,7 +1539,7 @@ $cfg['Export']['sql_if_not_exists'] = true;
|
||||
*
|
||||
* @global boolean $cfg['Export']['sql_procedure_function']
|
||||
*/
|
||||
$cfg['Export']['sql_procedure_function'] = false;
|
||||
$cfg['Export']['sql_procedure_function'] = true;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -67,6 +67,34 @@ if (! empty($sql_query)) {
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="exportoptions" id="header">
|
||||
<h2>
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_export.png" />
|
||||
<?php
|
||||
if($export_type == 'server') {
|
||||
echo __('Exporting databases in the current server');
|
||||
} elseif($export_type == 'database') {
|
||||
echo __('Exporting tables in the database "' . $db . '"');
|
||||
} else {
|
||||
echo __('Exporting rows in the table "' . $table . '"');
|
||||
}?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="exportoptions" id="quick_or_custom">
|
||||
<h3><?php echo __('Export Method:'); ?></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<?php echo '<input type="radio" name="quick_or_custom" value="quick" id="radio_quick_export" checked="checked" />';
|
||||
echo '<label for ="radio_quick_export">' . __('Quick - display only the minimal options to configure') . '</label>'; ?>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo '<input type="radio" name="quick_or_custom" value="custom" id="radio_custom_export" />';
|
||||
echo '<label for="radio_custom_export">' . __('Custom - display all possible options to configure') . '</label>';?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="exportoptions" id="databases_and_tables">
|
||||
<?php
|
||||
if($export_type == 'server') {
|
||||
@@ -88,10 +116,10 @@ if (! empty($sql_query)) {
|
||||
<?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="'
|
||||
<li><label for="limit_to"><?php echo __('Number of rows:') . '</label> <input type="text" id="limit_to" 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"'
|
||||
<li><label for="limit_from"><?php echo __('Row to begin at:') . '</label> <input type="text" id="limit_from" name="limit_from" value="0" size="5"'
|
||||
.' onfocus="this.select()" />'; ?></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -103,9 +131,32 @@ if (! empty($sql_query)) {
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
|
||||
<div class="exportoptions" id="output_quick_export">
|
||||
<h3><?php echo __('Output:'); ?></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<input type="checkbox" name="quick_export_onserver" value="saveit"
|
||||
id="checkbox_quick_dump_onserver"
|
||||
<?php PMA_exportCheckboxCheck('onserver'); ?> />
|
||||
<label for="checkbox_quick_dump_onserver">
|
||||
<?php echo sprintf(__('Save on server in the directory <b>%s</b>'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<input type="checkbox" name="quick_export_onserverover" value="saveitover"
|
||||
id="checkbox_quick_dump_onserverover"
|
||||
<?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
|
||||
<label for="checkbox_quick_dump_onserverover"><?php echo __('Overwrite existing file(s)'); ?></label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="exportoptions" id="output">
|
||||
<h3><?php echo __('Output:'); ?></h3>
|
||||
<ul id="output">
|
||||
<ul id="ul_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>
|
||||
@@ -116,7 +167,7 @@ if (! empty($sql_query)) {
|
||||
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']))); ?>
|
||||
<?php echo sprintf(__('Save on server in the directory <b>%s</b>'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
@@ -131,13 +182,13 @@ if (! empty($sql_query)) {
|
||||
<?php
|
||||
echo __('File name template:');
|
||||
$trans = new PMA_Message;
|
||||
$trans->addMessage('__SERVER__/');
|
||||
$trans->addMessage('__SERVER__ will become the');
|
||||
$trans->addString(__('server name'));
|
||||
if ($export_type == 'database' || $export_type == 'table') {
|
||||
$trans->addMessage('__DB__/');
|
||||
$trans->addMessage(', __DB__ will become the');
|
||||
$trans->addString(__('database name'));
|
||||
if ($export_type == 'table') {
|
||||
$trans->addMessage('__TABLE__/');
|
||||
$trans->addMessage(', __TABLE__ will become the');
|
||||
$trans->addString(__('table name'));
|
||||
}
|
||||
}
|
||||
@@ -182,68 +233,70 @@ if (! empty($sql_query)) {
|
||||
<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>
|
||||
<?php
|
||||
// charset of file
|
||||
if ($cfg['AllowAnywhereRecoding']) {
|
||||
echo ' <li><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></li>';
|
||||
} // end if
|
||||
?>
|
||||
<?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) { ?>
|
||||
<li>
|
||||
<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>
|
||||
</li>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="compression" value="none" />
|
||||
<?php } ?>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<div class="exportoptions" id="format">
|
||||
<h3>Format:</h3>
|
||||
<h3><?php echo __('Format:'); ?></h3>
|
||||
<?php echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?>
|
||||
</div>
|
||||
|
||||
<div class="exportoptions" id="format_specific_opts">
|
||||
<h3><?php echo __('Format-Specific Options:'); ?></h3>
|
||||
<p class="no_js_msg" id="scroll_to_options_msg">Scroll down to fill in the options for the selected format and ignore the options for other formats.</p>
|
||||
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
|
||||
</div>
|
||||
|
||||
<?php if (function_exists('PMA_set_enc_form')) { ?>
|
||||
<!-- Encoding setting form appended by Y.Kawada -->
|
||||
<!-- Japanese encoding setting -->
|
||||
<?php echo PMA_set_enc_form(' '); ?>
|
||||
<div class="exportoptions" id="kanji_encoding">
|
||||
<h3><?php echo __('Encoding Conversion:'); ?></h3>
|
||||
<?php echo PMA_set_enc_form(' '); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="exportoptions" id="submit">
|
||||
|
@@ -25,7 +25,7 @@ if (empty($import_list)) {
|
||||
}
|
||||
?>
|
||||
|
||||
<iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" style="display: none"></iframe>
|
||||
<iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" style="display: none;"></iframe>
|
||||
<div id="import_form_status" style="display: none;"></div>
|
||||
<div id="importmain">
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
|
||||
@@ -120,6 +120,21 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
||||
}
|
||||
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
|
||||
?>
|
||||
|
||||
<div class="exportoptions" id="header">
|
||||
<h2>
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_import.png" />
|
||||
<?php
|
||||
if($import_type == 'server') {
|
||||
echo __('Importing into the current server');
|
||||
} elseif($import_type == 'database') {
|
||||
echo __('Importing into the database "' . $db . '"');
|
||||
} else {
|
||||
echo __('Importing into the table "' . $table . '"');
|
||||
}?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="importoptions">
|
||||
<h3><?php echo __('File to Import:'); ?></h3>
|
||||
<?php
|
||||
@@ -137,56 +152,34 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
||||
}
|
||||
// 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));
|
||||
}
|
||||
printf(__('<div class="formelementrow" id="compression_info">File may be compressed (%s) or uncompressed.<br />A compressed file\'s name must end in <b>.[format].[compression]</b>. Example: <b>.sql.zip</b></div>'), implode(", ", $compressions));
|
||||
}?>
|
||||
|
||||
if ($GLOBALS['is_upload']) {
|
||||
$uid = uniqid("");
|
||||
?>
|
||||
<div class="formelementrow" id="upload_form">
|
||||
<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 file:'); ?></label>
|
||||
<input style="margin: 5px" type="file" name="import_file" id="input_import_file" onchange="match_file(this.value);" />
|
||||
<?php
|
||||
echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
|
||||
// some browsers should respect this :)
|
||||
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
<?php if($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) { ?>
|
||||
<ul>
|
||||
<li>
|
||||
<input type="radio" name="file_location" id="radio_import_file" />
|
||||
<?php PMA_browseUploadFile($max_upload_size); ?>
|
||||
</li>
|
||||
<li>
|
||||
<input type="radio" name="file_location" id="radio_local_import_file" />
|
||||
<?php PMA_selectUploadFile($import_list, $cfg['UploadDir']); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } else if ($GLOBALS['is_upload']) {
|
||||
$uid = uniqid("");
|
||||
PMA_browseUploadFile($max_upload_size);
|
||||
} else if (!$GLOBALS['is_upload']) {
|
||||
PMA_Message::warning(__('File uploads are not allowed on this server.'))->display();
|
||||
}
|
||||
if (!empty($cfg['UploadDir'])) {
|
||||
$extensions = '';
|
||||
foreach ($import_list as $key => $val) {
|
||||
if (!empty($extensions)) {
|
||||
$extensions .= '|';
|
||||
}
|
||||
$extensions .= $val['extension'];
|
||||
}
|
||||
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
|
||||
|
||||
$files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
|
||||
echo '<div class="formelementrow">' . "\n";
|
||||
if ($files === FALSE) {
|
||||
PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
|
||||
} elseif (!empty($files)) {
|
||||
echo "\n";
|
||||
echo ' <i>' . __('Or') . '</i><br/><label for="select_local_import_file">' . __('web server upload directory') . '</label> : ' . "\n";
|
||||
echo ' <select style="margin: 5px" size="1" name="local_import_file" onchange="match_file(this.value)" id="select_local_import_file">' . "\n";
|
||||
echo ' <option value=""> </option>' . "\n";
|
||||
echo $files;
|
||||
echo ' </select>' . "\n";
|
||||
}
|
||||
echo '</div>' . "\n";
|
||||
} else if (!empty($cfg['UploadDir'])) {
|
||||
PMA_selectUploadFile($import_list, $cfg['UploadDir']);
|
||||
} // end if (web-server upload directory)
|
||||
?>
|
||||
</div>
|
||||
|
||||
// charset of file
|
||||
echo '<div class="formelementrow">' . "\n";
|
||||
<div class="formelementrow" id="charaset_of_file">
|
||||
<?php // charset of file
|
||||
if ($cfg['AllowAnywhereRecoding']) {
|
||||
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
|
||||
reset($cfg['AvailableCharsets']);
|
||||
@@ -204,8 +197,8 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
||||
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>' . "\n";
|
||||
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
|
||||
} // end if (recoding)
|
||||
echo '</div>' . "\n";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="importoptions">
|
||||
<h3><?php echo __('Partial Import:'); ?></h3>
|
||||
@@ -251,15 +244,19 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
||||
|
||||
<div class="importoptions" id="format_specific_opts">
|
||||
<h3><?php echo __('Format-Specific Options:'); ?></h3>
|
||||
<p class="no_js_msg" id="scroll_to_options_msg">Scroll down to fill in the options for the selected format and ignore the options for other formats.</p>
|
||||
<?php echo PMA_pluginGetOptions('Import', $import_list); ?>
|
||||
</div>
|
||||
<div class="clearfloat"></div>
|
||||
</div>
|
||||
<?php
|
||||
// Encoding setting form appended by Y.Kawada
|
||||
if (function_exists('PMA_set_enc_form')) {
|
||||
echo PMA_set_enc_form(' ');
|
||||
}
|
||||
// Encoding setting form appended by Y.Kawada
|
||||
if (function_exists('PMA_set_enc_form')) { ?>
|
||||
<div class="importoptions" id="kanji_encoding">
|
||||
<h3><?php echo __('Encoding Conversion:'); ?></h3>
|
||||
<?php echo PMA_set_enc_form(' '); ?>
|
||||
</div>
|
||||
<?php }
|
||||
echo "\n";
|
||||
?>
|
||||
<div class="importoptions" id="submit">
|
||||
|
@@ -33,8 +33,10 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'cs',
|
||||
'mime_type' => 'text/cs',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -18,7 +18,8 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'csv',
|
||||
'mime_type' => 'text/comma-separated-values',
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated with:')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns separated with:')),
|
||||
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:')),
|
||||
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated with:')),
|
||||
@@ -26,6 +27,7 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line field characters within columns')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -19,6 +19,7 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'csv',
|
||||
'mime_type' => 'text/comma-separated-values',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
@@ -31,6 +32,7 @@ if (isset($plugin_list)) {
|
||||
'mac_excel2008' => 'Excel 2008 / Macintosh'),
|
||||
'text' => __('Excel edition:')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -21,9 +21,9 @@ if (isset($plugin_list)) {
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
/* what to dump (structure/data/both) */
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))),
|
||||
array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')),
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
|
||||
array('type' => 'end_subgroup'),
|
||||
array('type' => 'end_group'),
|
||||
/* data options */
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
|
@@ -23,17 +23,19 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'tex',
|
||||
'mime_type' => 'application/x-tex',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'caption', 'text' => __('Include table caption')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
||||
/* what to dump (structure/data/both) */
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table')));
|
||||
array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table'));
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
|
||||
$plugin_list['latex']['options'][] = array('type' => 'end_subgroup');
|
||||
$plugin_list['latex']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* Structure options */
|
||||
if (!$hide_structure) {
|
||||
|
@@ -16,7 +16,9 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'txt',
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -20,9 +20,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -29,10 +29,10 @@ if (isset($plugin_list)) {
|
||||
|
||||
/* what to dump (structure/data/both) */
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table')));
|
||||
array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts');
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
|
||||
$plugin_list['odt']['options'][] = array('type' => 'end_subgroup');
|
||||
$plugin_list['odt']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* Structure options */
|
||||
if (!$hide_structure) {
|
||||
|
@@ -20,9 +20,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/pdf',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'message_only', 'name' => 'explanation', 'text' => __('(Generates a report containing the data of a single table)')),
|
||||
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title:')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -17,10 +17,12 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'php',
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'structure_or_data',
|
||||
),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -27,6 +27,8 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'text/x-sql',
|
||||
'options' => array());
|
||||
|
||||
$plugin_list['sql']['options'][] = array('type' => 'begin_group', 'name' => 'general_opts');
|
||||
|
||||
/* comments */
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Display comments <i>(includes info such as export timestamp, PHP version, and server version)</i>')));
|
||||
@@ -36,20 +38,20 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'bool', 'name' => 'dates', 'text' => __('Include a timestamp of when databases were created, last updated, and last checked'));
|
||||
if (!empty($GLOBALS['cfgRelation']['relation'])) {
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'relation', 'text' => __('Foreign key relationships'));
|
||||
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
|
||||
}
|
||||
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME types'));
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
|
||||
}
|
||||
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
|
||||
/* end comments */
|
||||
|
||||
/* enclose in a transaction */
|
||||
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'));
|
||||
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_single-transaction'));
|
||||
|
||||
/* disable foreign key checks */
|
||||
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'));
|
||||
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'), 'doc' => array('manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks'));
|
||||
|
||||
$plugin_list['sql']['options_text'] = __('Options');
|
||||
|
||||
@@ -78,6 +80,8 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
|
||||
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
|
||||
|
||||
$plugin_list['sql']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* begin Structure options */
|
||||
if (!$hide_structure) {
|
||||
$plugin_list['sql']['options'][] =
|
||||
@@ -130,11 +134,11 @@ if (isset($plugin_list)) {
|
||||
|
||||
/* begin SQL statements */
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Add statements:')));
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Instead of <code>INSERT</code> statements, use:')));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'delayed', 'text' => __('<code>INSERT DELAYED</code>'));
|
||||
array('type' => 'bool', 'name' => 'delayed', 'text' => __('<code>INSERT DELAYED</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert_delayed'));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('<code>INSERT IGNORE</code>'));
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('<code>INSERT IGNORE</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert'));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'end_subgroup');
|
||||
/* end SQL statements */
|
||||
@@ -148,10 +152,10 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Syntax to use when inserting data:')));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'radio', 'name' => 'insert_syntax', 'values' => array(
|
||||
'complete' => __('include column names in every <code>INSERT</code> statement <br> 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> Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
|
||||
'both' => __('both of the above<br> 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> Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code>')));
|
||||
'complete' => __('include column names in every <code>INSERT</code> statement <br /> 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 /> Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
|
||||
'both' => __('both of the above<br /> 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 /> Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code>')));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'end_subgroup');
|
||||
|
||||
|
@@ -19,9 +19,9 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
/* what to dump (structure/data/both) */
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))),
|
||||
array('type' => 'begin_group', 'text' => __('Dump table'), 'name' => 'general_opts'),
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
|
||||
array('type' => 'end_subgroup'),
|
||||
array('type' => 'end_group'),
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
|
@@ -20,9 +20,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.ms-excel',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -20,9 +20,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -19,14 +19,16 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'xml',
|
||||
'mime_type' => 'text/xml',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options')
|
||||
);
|
||||
|
||||
/* Export structure */
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):')));
|
||||
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options (all are recommended)'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
@@ -37,12 +39,15 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'end_subgroup');
|
||||
$plugin_list['xml']['options'][] = array('type' => 'end_subgroup');
|
||||
$plugin_list['xml']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* Data */
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_contents', 'text' => __('Export contents'));
|
||||
$plugin_list['xml']['options'][] = array('type' => 'end_group');
|
||||
} else {
|
||||
|
||||
/**
|
||||
|
@@ -20,10 +20,12 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'text/yaml',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'structure_or_data',
|
||||
),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -22,9 +22,10 @@ if (isset($plugin_list)) {
|
||||
'text' => __('CSV'),
|
||||
'extension' => 'csv',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns separated with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated with:'), 'size' => 2),
|
||||
@@ -36,9 +37,11 @@ if (isset($plugin_list)) {
|
||||
$plugin_list['csv']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>'));
|
||||
} else {
|
||||
$hint = new PMA_Message(__('If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.'));
|
||||
$plugin_list['csv']['options'][] =
|
||||
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names'));
|
||||
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ' . PMA_showHint($hint)));
|
||||
}
|
||||
$plugin_list['csv']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* We do not define function when plugin is just queried for information above */
|
||||
return;
|
||||
@@ -116,7 +119,7 @@ if (!$analyze) {
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$message = PMA_Message::error(__('Invalid column (%s) specified!'));
|
||||
$message = PMA_Message::error(__('Invalid column (%s) specified! Ensure that columns names are spelled correctly, separated by commas, and not enclosed in quotes.' ));
|
||||
$message->addParam($val);
|
||||
$error = TRUE;
|
||||
break;
|
||||
|
@@ -29,7 +29,9 @@ if (isset($plugin_list)) {
|
||||
'text' => __('DocSQL'), // text to be displayed as choice
|
||||
'extension' => '', // extension this plugin can handle
|
||||
'options' => array( // array of options for your plugin (optional)
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'table', 'text' => __('Table name')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'), // text to describe plugin options (must be set if options are used)
|
||||
);
|
||||
|
@@ -35,6 +35,7 @@ if (isset($plugin_list)) {
|
||||
'text' => __('CSV using LOAD DATA'),
|
||||
'extension' => 'ldi', // This is nonsense, however we want to default to our parser for csv
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2),
|
||||
@@ -43,6 +44,7 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2),
|
||||
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')),
|
||||
array('type' => 'bool', 'name' => 'local_option', 'text' => __('Use LOCAL keyword')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -22,10 +22,12 @@ if (isset($plugin_list)) {
|
||||
'text' => __('Open Document Spreadsheet'),
|
||||
'extension' => 'ods',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <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 <i>(ex. 12.00% to .12)</i>')),
|
||||
array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies <i>(ex. $5.00 to 5.00)</i>')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -26,6 +26,7 @@ if (isset($plugin_list)) {
|
||||
$values[$val] = $val;
|
||||
}
|
||||
$plugin_list['sql']['options'] = array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'select',
|
||||
'name' => 'compatibility',
|
||||
@@ -47,6 +48,7 @@ if (isset($plugin_list)) {
|
||||
),
|
||||
|
||||
),
|
||||
array('type' => 'end_group'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,9 @@ if (isset($plugin_list)) {
|
||||
'text' => __('Excel 97-2003 XLS Workbook'),
|
||||
'extension' => 'xls',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -21,7 +21,9 @@ if (isset($plugin_list)) {
|
||||
'text' => __('Excel 2007 XLSX Workbook'),
|
||||
'extension' => 'xlsx',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -138,18 +138,16 @@ function PMA_kanji_file_conv($file, $enc, $kana) {
|
||||
*/
|
||||
function PMA_set_enc_form($spaces) {
|
||||
return "\n"
|
||||
. "<fieldset>\n"
|
||||
/* l10n: This is currently used only in Japanese locales */
|
||||
. $spaces . '<legend>' . __('Encoding conversion') . '</legend>' . "\n"
|
||||
/* l10n: This is currently used only in Japanese locales */
|
||||
/* l10n: This is currently used only in Japanese locales */
|
||||
. $spaces . '<ul>' . "\n" . '<li>'
|
||||
. $spaces . '<input type="radio" name="knjenc" value="" checked="checked" id="kj-none" /><label for="kj-none">' . _pgettext('None encoding conversion', 'None') . "</label>\n"
|
||||
. $spaces . '<input type="radio" name="knjenc" value="EUC-JP" id="kj-euc" /><label for="kj-euc">EUC</label>' . "\n"
|
||||
. $spaces . '<input type="radio" name="knjenc" value="SJIS" id="kj-sjis" /><label for="kj-sjis">SJIS</label>' . "\n"
|
||||
. $spaces . '<br />'
|
||||
. $spaces . '</li>' . "\n" . '<li>'
|
||||
. $spaces . '<input type="checkbox" name="xkana" value="kana" id="kj-kana" />' . "\n"
|
||||
/* l10n: This is currently used only in Japanese locales */
|
||||
. $spaces . '<label for="kj-kana">' . __('Convert to Kana') . '</label><br />' . "\n"
|
||||
. "</fieldset>\n"
|
||||
. $spaces . '</li>' . "\n" . '</ul>'
|
||||
;
|
||||
} // end of the 'PMA_set_enc_form' function
|
||||
|
||||
|
@@ -162,12 +162,11 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
|
||||
$ret = '<select id="plugins" name="' . $name . '">';
|
||||
$default = PMA_pluginGetDefault($section, $cfgname);
|
||||
foreach ($list as $plugin_name => $val) {
|
||||
$ret .= '<!-- ' . $plugin_name . ' -->' . "\n";
|
||||
$ret .= '<option';
|
||||
if($plugin_name == $default) {
|
||||
$ret .= ' selected="selected"';
|
||||
}
|
||||
$ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . '</option> \n';
|
||||
$ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . '</option>' . "\n";
|
||||
}
|
||||
$ret .= '</select>' . "\n";
|
||||
|
||||
@@ -179,7 +178,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
|
||||
} else {
|
||||
$ret .= 'false';
|
||||
}
|
||||
$ret .= '">'. "\n";
|
||||
$ret .= '" />'. "\n";
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
@@ -252,21 +251,30 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
if($key == $default) {
|
||||
$ret .= 'checked="checked"';
|
||||
}
|
||||
$ret .= '>' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">'
|
||||
. PMA_getString($val) . '</label>';
|
||||
$ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">'
|
||||
. PMA_getString($val) . '</label></li>';
|
||||
}
|
||||
} elseif ($opt['type'] == 'hidden') {
|
||||
$ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
|
||||
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />';
|
||||
$ret .= '<li><input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
|
||||
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' /></li>';
|
||||
} elseif ($opt['type'] == 'begin_group') {
|
||||
$ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $opt['name'] . '"><h4>' . PMA_getString($opt['text']) . '</h4><ul>';
|
||||
$ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $opt['name'] . '">';
|
||||
if (isset($opt['text'])) {
|
||||
$ret .= '<h4>' . PMA_getString($opt['text']) . '</h4>';
|
||||
}
|
||||
$ret .= '<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'] . '">';
|
||||
$ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . '<li><ul';
|
||||
if(isset($opt['subgroup_header']['name'])) {
|
||||
$ret .= ' id="ul_' . $opt['subgroup_header']['name'] . '">';
|
||||
} else {
|
||||
$ret .= '>';
|
||||
}
|
||||
} elseif ($opt['type'] == 'end_subgroup') {
|
||||
$ret .= '</ul>';
|
||||
$ret .= '</ul></li>';
|
||||
} else {
|
||||
/* This should be seen only by plugin writers, so I do not thing this
|
||||
* needs translation. */
|
||||
@@ -280,6 +288,10 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
}
|
||||
}
|
||||
|
||||
// Close the list element after $opt['doc'] link is displayed
|
||||
if($opt['type'] == 'bool' || $opt['type'] == 'text' || $opt['type'] == 'message_only' || $opt['type'] == 'select') {
|
||||
$ret .= '</li>';
|
||||
}
|
||||
$ret .= "\n";
|
||||
return $ret;
|
||||
}
|
||||
@@ -302,22 +314,21 @@ function PMA_pluginGetOptions($section, &$list)
|
||||
$default = PMA_pluginGetDefault('Export', 'format');
|
||||
// Options for plugins that support them
|
||||
foreach ($list as $plugin_name => $val) {
|
||||
$ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options"';
|
||||
if($plugin_name != $default) {
|
||||
$ret .= ' style="display: none;">';
|
||||
}
|
||||
$ret .= '<ul>';
|
||||
$ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options">';
|
||||
$count = 0;
|
||||
$ret .= '<h3>' . PMA_getString($val['text']) . '</h3>';
|
||||
if (isset($val['options']) && count($val['options']) > 0) {
|
||||
foreach ($val['options'] as $id => $opt) {
|
||||
if ($opt['type'] != 'hidden') $count++;
|
||||
if ($opt['type'] != 'hidden' && $opt['type'] != 'begin_group' && $opt['type'] != 'end_group' && $opt['type'] != 'begin_subgroup' && $opt['type'] != 'end_subgroup') {
|
||||
$count++;
|
||||
}
|
||||
$ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt);
|
||||
}
|
||||
}
|
||||
if ($count == 0) {
|
||||
$ret .= __('This format has no options');
|
||||
$ret .= __('<p>This format has no options</p>');
|
||||
}
|
||||
$ret .= '</ul></div>';
|
||||
$ret .= '</div>';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
@@ -279,8 +279,9 @@ for ($i = 0; $i < $num_fields; $i++) {
|
||||
$ci++;
|
||||
|
||||
// column type
|
||||
$content_cells[$i][$ci] = '<select name="field_type[' . $i . ']"'
|
||||
.' id="field_' . $i . '_' . ($ci - $ci_offset) . '" >';
|
||||
$select_id = 'field_' . $i . '_' . ($ci - $ci_offset);
|
||||
$content_cells[$i][$ci] = '<select class="column_type" name="field_type[' . $i . ']"'
|
||||
.' id="' . $select_id . '">';
|
||||
|
||||
if (empty($row['Type'])) {
|
||||
// creating a column
|
||||
@@ -367,7 +368,11 @@ for ($i = 0; $i < $num_fields; $i++) {
|
||||
$content_cells[$i][$ci] = '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '"'
|
||||
. ' type="text" name="field_length[' . $i . ']" size="' . $length_values_input_size . '"'
|
||||
. ' value="' . htmlspecialchars($length_to_display) . '"'
|
||||
. ' class="textfield" />';
|
||||
. ' class="textfield" />'
|
||||
. '<p class="enum_notice" id="enum_notice_' . $i . '_' . ($ci - $ci_offset) . '">';
|
||||
$content_cells[$i][$ci] .= __('ENUM or SET data too long?')
|
||||
. '<a href="enum_editor.php?' . PMA_generate_common_url() . '&values=' . urlencode($length_to_display) . '&field=' . $field . '" class="open_enum_editor" target="blank"> '
|
||||
. __('Get more editing space') . '</a></p>';
|
||||
$ci++;
|
||||
|
||||
// column default
|
||||
@@ -789,3 +794,13 @@ if ($action == 'tbl_create.php') {
|
||||
</form>
|
||||
|
||||
<center><?php echo PMA_showMySQLDocu('SQL-Syntax', 'CREATE_TABLE'); ?></center>
|
||||
|
||||
<div id="enum_editor">
|
||||
<a class="close_enum_editor">Close</a>
|
||||
<p>Enter each value in a separate field.</p>
|
||||
<div id="values"></div>
|
||||
<p><input type="checkbox" name="add_extra_fields" /> Add <input type="text" value="1" name="extra_fields" size="2" /> more values</p>
|
||||
<input type="submit" value="Go" /> <a class="cancel_enum_editor">Cancel</a>
|
||||
</div>
|
||||
|
||||
<div id="popup_background"></div>
|
@@ -57,11 +57,12 @@ pre, tt, code {
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
a:link,
|
||||
a, a:link,
|
||||
a:visited,
|
||||
a:active {
|
||||
text-decoration: none;
|
||||
color: #333399;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
@@ -1202,6 +1203,10 @@ label.desc {
|
||||
float: <?php echo $left; ?>;
|
||||
}
|
||||
|
||||
label.desc sup {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
code.sql {
|
||||
display: block;
|
||||
padding: 0.3em;
|
||||
@@ -1296,3 +1301,152 @@ table#serverconnection_trg_local {
|
||||
*/
|
||||
.invalid_value
|
||||
{background:#F00;}
|
||||
|
||||
/**
|
||||
* Export and Import styles
|
||||
*/
|
||||
.exportoptions h3, .importoptions h3 {
|
||||
border-bottom: 1px #999999 solid;
|
||||
}
|
||||
|
||||
.exportoptions ul, .importoptions ul, .format_specific_options ul {
|
||||
list-style-type: none;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.exportoptions li, .importoptions li {
|
||||
margin: 7px;
|
||||
}
|
||||
.exportoptions label, .importoptions label, .exportoptions p, .importoptions p {
|
||||
margin: 5px;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{
|
||||
float: left;
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
.exportoptions, .importoptions {
|
||||
margin: 30px 30px 30px 10px
|
||||
}
|
||||
|
||||
.exportoptions #buttonGo, .importoptions #buttonGo {
|
||||
padding: 5px 30px;
|
||||
-moz-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
|
||||
background: -moz-linear-gradient(top, #ffffff, #cccccc);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc');
|
||||
border: 1px solid #444444;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.format_specific_options h3 {
|
||||
margin: 10px 0px 0px 10px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.format_specific_options {
|
||||
border: 1px solid #999999;
|
||||
margin: 7px 0px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
p.desc {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export styles only
|
||||
*/
|
||||
select#db_select, select#table_select {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.export_sub_options {
|
||||
margin: 20px 0px 0px 30px;
|
||||
}
|
||||
|
||||
.export_sub_options h4 {
|
||||
border-bottom: 1px #999999 solid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import styles only
|
||||
*/
|
||||
|
||||
.importoptions #import_notification {
|
||||
margin: 10px 0px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
input#input_import_file {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.formelementrow {
|
||||
margin: 5px 0px 5px 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* ENUM/SET editor styles
|
||||
*/
|
||||
p.enum_notice {
|
||||
margin: 5px 2px;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
#enum_editor {
|
||||
display: none;
|
||||
position: fixed;
|
||||
_position: absolute; /* hack for IE */
|
||||
z-index: 101;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#enum_editor_no_js {
|
||||
margin: auto auto;
|
||||
}
|
||||
|
||||
#enum_editor, #enum_editor_no_js {
|
||||
width: 50%;
|
||||
height: 80%;
|
||||
background: #D0DCE0;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#popup_background {
|
||||
display: none;
|
||||
position: fixed;
|
||||
_position: absolute; /* hack for IE */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #000;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
a.close_enum_editor {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#enum_editor #values, #enum_editor_no_js #values {
|
||||
margin: 15px 0px;
|
||||
}
|
||||
|
||||
#enum_editor #values input, #enum_editor_no_js #values input {
|
||||
margin: 5px 0px;
|
||||
float: top;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#enum_editor input, #enum_editor_no_js input {
|
||||
float: bottom;
|
||||
}
|
||||
|
||||
#enum_editor_output {
|
||||
margin-top: 50px;
|
||||
}
|
@@ -53,11 +53,12 @@ h3 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a:link,
|
||||
a, a:link,
|
||||
a:visited,
|
||||
a:active {
|
||||
text-decoration: none;
|
||||
color: #0000FF;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
@@ -1153,6 +1154,10 @@ label.desc {
|
||||
float: <?php echo $left; ?>;
|
||||
}
|
||||
|
||||
label.desc sup {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
code.sql {
|
||||
display: block;
|
||||
padding: 0.3em;
|
||||
@@ -1230,14 +1235,12 @@ table#serverconnection_trg_local {
|
||||
{background:#F00;}
|
||||
|
||||
/**
|
||||
* Export styles
|
||||
* Export and Import styles
|
||||
*/
|
||||
select#db_select, select#table_select {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.exportoptions h3, .importoptions h3 {
|
||||
border-bottom: 1px #999999 solid;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
.exportoptions ul, .importoptions ul, .format_specific_options ul {
|
||||
@@ -1248,50 +1251,139 @@ select#db_select, select#table_select {
|
||||
.exportoptions li, .importoptions li {
|
||||
margin: 7px;
|
||||
}
|
||||
|
||||
.exportoptions label, .importoptions label, .exportoptions p, .importoptions p {
|
||||
.exportoptions label, .importoptions label, .exportoptions p, .importoptions p {
|
||||
margin: 5px;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#csv_options .desc, #latex_options .desc, #output .desc{
|
||||
#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{
|
||||
float: left;
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
.exportoptions, .importoptions {
|
||||
margin: 30px 30px 30px 10px
|
||||
margin: 20px 30px 30px 10px
|
||||
}
|
||||
|
||||
.exportoptions #buttonGo, .importoptions #buttonGo {
|
||||
padding: 5px 30px;
|
||||
-moz-border-radius: 11px;
|
||||
-webkit-border-radius:
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
|
||||
background: -moz-linear-gradient(top, #ffffff, #cccccc);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc');
|
||||
border: 1px solid #444444;
|
||||
background-color: #ffffff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.export_sub_options {
|
||||
margin: 30px 0px 0px 0px;
|
||||
.format_specific_options h3 {
|
||||
margin: 10px 0px 0px 10px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.export_sub_options h4 {
|
||||
border-bottom: 1px #999999 solid;
|
||||
}
|
||||
|
||||
.importoptions #import_notification {
|
||||
margin: 10px 0px;
|
||||
font-style: italic;
|
||||
.format_specific_options {
|
||||
border: 1px solid #999999;
|
||||
margin: 7px 0px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
p.desc {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export styles only
|
||||
*/
|
||||
select#db_select, select#table_select {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.export_sub_options {
|
||||
margin: 20px 0px 0px 30px;
|
||||
}
|
||||
|
||||
.export_sub_options h4 {
|
||||
border-bottom: 1px #999999 solid;
|
||||
}
|
||||
|
||||
#quick_or_custom, #output_quick_export {
|
||||
display: none;
|
||||
}
|
||||
/**
|
||||
* Import styles only
|
||||
*/
|
||||
|
||||
.importoptions #import_notification {
|
||||
margin: 10px 0px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
input#input_import_file {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.formelementrow {
|
||||
margin: 5px 0px 5px 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* ENUM/SET editor styles
|
||||
*/
|
||||
p.enum_notice {
|
||||
margin: 5px 2px;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
#enum_editor {
|
||||
display: none;
|
||||
position: fixed;
|
||||
_position: absolute; /* hack for IE */
|
||||
z-index: 101;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#enum_editor_no_js {
|
||||
margin: auto auto;
|
||||
}
|
||||
|
||||
#enum_editor, #enum_editor_no_js {
|
||||
width: 50%;
|
||||
height: 80%;
|
||||
background: #D0DCE0;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#popup_background {
|
||||
display: none;
|
||||
position: fixed;
|
||||
_position: absolute; /* hack for IE */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #000;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
a.close_enum_editor {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#enum_editor #values, #enum_editor_no_js #values {
|
||||
margin: 15px 0px;
|
||||
}
|
||||
|
||||
#enum_editor #values input, #enum_editor_no_js #values input {
|
||||
margin: 5px 0px;
|
||||
float: top;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#enum_editor input, #enum_editor_no_js input {
|
||||
float: bottom;
|
||||
}
|
||||
|
||||
#enum_editor_output {
|
||||
margin-top: 50px;
|
||||
}
|
Reference in New Issue
Block a user