Merge remote branch 'origin/master' into export_branch
This commit is contained in:
@@ -489,7 +489,9 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
|
||||
}
|
||||
|
||||
// footnotemarker used in js/tooltip.js
|
||||
return '<sup class="footnotemarker" id="footnote_sup_' . $nr . '_' . $instance . '">' . $nr . '</sup>';
|
||||
return '<sup class="footnotemarker">' . $nr . '</sup>' .
|
||||
'<img class="footnotemarker" id="footnote_' . $nr . '_' . $instance . '" src="' .
|
||||
$GLOBALS['pmaThemeImage'] . 'b_help.png" alt="" />';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2912,4 +2914,46 @@ function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
|
||||
/* Do the replacement */
|
||||
return str_replace(array_keys($replace), array_values($replace), strftime($string));
|
||||
}
|
||||
?>
|
||||
|
||||
/**
|
||||
* 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>';
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1004,7 +1004,7 @@ $cfg['LightTabs'] = false;
|
||||
*
|
||||
* @global boolean $cfg['PropertiesIconic']
|
||||
*/
|
||||
$cfg['PropertiesIconic'] = true;
|
||||
$cfg['PropertiesIconic'] = 'both';
|
||||
|
||||
/**
|
||||
* How many columns should be used for table display of a database?
|
||||
@@ -1098,6 +1098,20 @@ $cfg['Export']['onserver'] = false;
|
||||
*/
|
||||
$cfg['Export']['onserver_overwrite'] = false;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global boolean $cfg['Export']['quick_export_onserver']
|
||||
*/
|
||||
$cfg['Export']['quick_export_onserver'] = false;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global boolean $cfg['Export']['quick_export_onserver_overwrite']
|
||||
*/
|
||||
$cfg['Export']['quick_export_onserver_overwrite'] = false;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1126,6 +1140,13 @@ $cfg['Export']['file_template_database'] = '@DATABASE@';
|
||||
*/
|
||||
$cfg['Export']['file_template_server'] = '@SERVER@';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global string $cfg['Export']['codegen_structure_or_data']
|
||||
*/
|
||||
$cfg['Export']['codegen_structure_or_data'] = 'data';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1143,16 +1164,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';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1192,16 +1206,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';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1220,16 +1227,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';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1252,6 +1252,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';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1266,6 +1273,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';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1280,6 +1294,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';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1292,7 +1313,7 @@ $cfg['Export']['csv_null'] = 'NULL';
|
||||
*
|
||||
* @global string $cfg['Export']['csv_separator']
|
||||
*/
|
||||
$cfg['Export']['csv_separator'] = ';';
|
||||
$cfg['Export']['csv_separator'] = ',';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1339,16 +1360,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';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1437,16 +1458,44 @@ $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']['json_structure_or_data']
|
||||
*/
|
||||
$cfg['Export']['json_structure_or_data'] = 'data';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global string $cfg['Export']['sql_structure_or_data']
|
||||
*/
|
||||
$cfg['Export']['sql_structure_or_data'] = 'structure_and_data';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1504,7 +1553,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;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1534,13 +1583,6 @@ $cfg['Export']['sql_dates'] = false;
|
||||
*/
|
||||
$cfg['Export']['sql_relation'] = false;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global boolean $cfg['Export']['sql_columns']
|
||||
*/
|
||||
$cfg['Export']['sql_columns'] = true;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1576,13 +1618,6 @@ $cfg['Export']['sql_hex_for_blob'] = true;
|
||||
*/
|
||||
$cfg['Export']['sql_type'] = 'insert';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global boolean $cfg['Export']['sql_extended']
|
||||
*/
|
||||
$cfg['Export']['sql_extended'] = true;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -1614,16 +1649,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';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1632,6 +1667,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
|
||||
*
|
||||
@@ -1681,7 +1722,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
|
||||
*/
|
||||
@@ -1741,7 +1787,7 @@ $cfg['Import']['csv_replace'] = false;
|
||||
*
|
||||
* @global string $cfg['Import']['csv_terminated']
|
||||
*/
|
||||
$cfg['Import']['csv_terminated'] = ';';
|
||||
$cfg['Import']['csv_terminated'] = ',';
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -35,6 +35,13 @@ if (empty($export_list)) {
|
||||
PMA_Message::error( __('Could not load export plugins, please check your installation!'))->display();
|
||||
require './libraries/footer.inc.php';
|
||||
}
|
||||
|
||||
// If the form data is being loaded from GET data, decode it
|
||||
foreach($_GET as $name => $value) {
|
||||
if(is_string($value)) {
|
||||
$_GET[urldecode($name)] = urldecode($value);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form method="post" action="export.php" name="dump">
|
||||
@@ -55,217 +62,302 @@ if (isset($single_table)) {
|
||||
|
||||
echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' . "\n";
|
||||
|
||||
if (! empty($sql_query)) {
|
||||
// If the export method was not set, the default is quick
|
||||
if(isset($_GET['export_method'])) {
|
||||
$cfg['Export']['method'] = $_GET['export_method'];
|
||||
} elseif(!isset($cfg['Export']['method'])) {
|
||||
$cfg['Export']['method'] = 'quick';
|
||||
}
|
||||
// The export method (quick, custom or custom-no-form)
|
||||
echo '<input type="hidden" name="export_method" value="' . $cfg['Export']['method'] . '" />';
|
||||
|
||||
|
||||
if(isset($_GET['sql_query'])) {
|
||||
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars(urldecode($_GET['sql_query'])) . '" />' . "\n";
|
||||
} elseif (! 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="header">
|
||||
<h2>
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_export.png" alt="export" />
|
||||
<?php
|
||||
if($export_type == 'server') {
|
||||
echo __('Exporting databases in the current server');
|
||||
} elseif($export_type == 'database') {
|
||||
printf(__('Exporting tables in the database "%s"'), htmlspecialchars($db));
|
||||
} else {
|
||||
printf(__('Exporting rows in the table "%s"'), htmlspecialchars($table));
|
||||
}?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
</td><td>
|
||||
|
||||
<div id="div_container_sub_exportoptions">
|
||||
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
|
||||
<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"';
|
||||
if(isset($_GET['quick_or_custom'])) {
|
||||
$export_method = $_GET['quick_or_custom'];
|
||||
if($export_method == 'custom' || $export_method == 'custom_no_form') {
|
||||
echo ' />';
|
||||
} else {
|
||||
echo ' checked="checked" />';
|
||||
}
|
||||
} elseif($cfg['Export']['method'] == 'custom' || $cfg['Export']['method'] == 'custom-no-form') {
|
||||
echo ' />';
|
||||
} else {
|
||||
echo ' 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"';
|
||||
if(isset($_GET['quick_or_custom'])) {
|
||||
$export_method = $_GET['quick_or_custom'];
|
||||
if($export_method == 'custom' || $export_method == 'custom_no_form') {
|
||||
echo ' checked="checked" />';
|
||||
} else {
|
||||
echo ' />';
|
||||
}
|
||||
} elseif($cfg['Export']['method'] == 'custom' || $cfg['Export']['method'] == 'custom-no-form') {
|
||||
echo ' checked="checked" />';
|
||||
} else {
|
||||
echo ' />';
|
||||
}
|
||||
echo '<label for="radio_custom_export">' . __('Custom - display all possible options to configure') . '</label>';?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
|
||||
<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>
|
||||
|
||||
<?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" />';
|
||||
<div class="exportoptions" id="rows">
|
||||
<h3><?php echo __('Rows:'); ?></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<?php if(isset($_GET['allrows']) && $_GET['allrows'] == 1) {
|
||||
echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" />';
|
||||
} else {
|
||||
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><label for="limit_to"><?php echo __('Number of rows:') . '</label> <input type="text" id="limit_to" name="limit_to" size="5" value="'
|
||||
. ((isset($_GET['limit_to'])) ? $_GET['limit_to'] : ((isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table))))
|
||||
. '" onfocus="this.select()" />' ?></li>
|
||||
<li><label for="limit_from"><?php echo __('Row to begin at:') . '</label> <input type="text" id="limit_from" name="limit_from" value="'
|
||||
. ((isset($_GET['limit_from'])) ? $_GET['limit_from'] : '0')
|
||||
. '" size="5" onfocus="this.select()" />'; ?></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<?php if(isset($_GET['allrows']) && $_GET['allrows'] == 0) {
|
||||
echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
|
||||
} else {
|
||||
echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" checked="checked" />';
|
||||
}
|
||||
echo ' <label for="radio_allrows_1">' . __('Dump all rows') . '</label>';?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
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>';
|
||||
?>
|
||||
<?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('quick_export_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('quick_export_onserver_overwrite'); ?> />
|
||||
<label for="checkbox_quick_dump_onserverover"><?php echo __('Overwrite existing file(s)'); ?></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="ul_output">
|
||||
<li>
|
||||
<input type="radio" name="output_format" value="sendit" id="radio_dump_asfile" <?php isset($_GET['repopulate']) ? '' : 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 the directory <b>%s</b>'), 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@ will become the');
|
||||
$trans->addString(__('server name'));
|
||||
if ($export_type == 'database' || $export_type == 'table') {
|
||||
$trans->addMessage(', @DB@ will become the');
|
||||
$trans->addString(__('database name'));
|
||||
if ($export_type == 'table') {
|
||||
$trans->addMessage(', @TABLE@ will become the');
|
||||
$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. See the %4$sFAQ%5$s for details.'));
|
||||
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
|
||||
. __('Documentation') . '">', false);
|
||||
$message->addParam('</a>', false);
|
||||
$message->addParam($trans);
|
||||
$message->addParam('<a href="Documentation.html#faq6_27" target="documentation">', false);
|
||||
$message->addParam('</a>', false);
|
||||
|
||||
<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(isset($_GET['filename_template'])) {
|
||||
echo $_GET['filename_template'];
|
||||
} else {
|
||||
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>
|
||||
<?php
|
||||
// charset of file
|
||||
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
|
||||
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(isset($_GET['charset_of_file']) && ($_GET['charset_of_file'] != $temp_charset)) {
|
||||
echo '';
|
||||
} elseif ((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
|
||||
if(isset($_GET['compression'])) {
|
||||
$selected_compression = $_GET['compression'];
|
||||
} else {
|
||||
$selected_compression = "none";
|
||||
}
|
||||
// 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 ($selected_compression == "zip") ? 'selected="selected"' : ''; ?>><?php echo __('zipped'); ?></option>
|
||||
<?php } if ($is_gzip) { ?>
|
||||
<option value="gzip" <?php echo ($selected_compression == "gzip") ? 'selected="selected"' : ''; ?>><?php echo __('gzipped'); ?></option>
|
||||
<?php } if ($is_bzip) { ?>
|
||||
<option value="bzip" <?php echo ($selected_compression == "bzip") ? 'selected="selected"' : ''; ?>><?php echo __('bzipped'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</li>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="compression" value="<?php echo $selected_compression; ?>" />
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<li><input type="radio" id="radio_view_as_text" name="output_format" value="astext" <?php echo isset($_GET['repopulate']) ? 'checked="checked"' : '' ?>/><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('@DATABASE@/');
|
||||
$trans->addString(__('database name'));
|
||||
if ($export_type == 'table') {
|
||||
$trans->addMessage('@TABLE@/');
|
||||
$trans->addString(__('table name'));
|
||||
}
|
||||
}
|
||||
<div class="exportoptions" id="format">
|
||||
<h3><?php echo __('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 '"';
|
||||
?>
|
||||
/>
|
||||
|
||||
<?php echo PMA_showDocu('faq6_27'); ?>
|
||||
(
|
||||
<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 ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
|
||||
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>
|
||||
<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 } ?>
|
||||
|
||||
<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>
|
||||
|
@@ -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;" />
|
||||
@@ -119,60 +119,71 @@ 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>
|
||||
|
||||
<?php
|
||||
|
||||
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 text 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>
|
||||
<div class="exportoptions" id="header">
|
||||
<h2>
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_import.png" alt="import" />
|
||||
<?php
|
||||
} else {
|
||||
PMA_Message::warning(__('File uploads are not allowed on this server.'))->display();
|
||||
if($import_type == 'server') {
|
||||
echo __('Importing into the current server');
|
||||
} elseif($import_type == 'database') {
|
||||
printf(__('Importing into the database "%s"'), htmlspecialchars($db));
|
||||
} else {
|
||||
printf(__('Importing into the table "%s"'), htmlspecialchars($table));
|
||||
}?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<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 (!empty($cfg['UploadDir'])) {
|
||||
$extensions = '';
|
||||
foreach ($import_list as $key => $val) {
|
||||
if (!empty($extensions)) {
|
||||
$extensions .= '|';
|
||||
}
|
||||
$extensions .= $val['extension'];
|
||||
}
|
||||
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
|
||||
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
|
||||
$compressions[] = 'bzip2';
|
||||
}
|
||||
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
|
||||
$compressions[] = 'zip';
|
||||
}
|
||||
// We don't have show anything about compression, when no supported
|
||||
if ($compressions != array()) {
|
||||
echo '<div class="formelementrow" id="compression_info">';
|
||||
printf(__('File may be compressed (%s) or uncompressed.'), implode(", ", $compressions));
|
||||
echo '<br />';
|
||||
echo __('A compressed file\'s name must end in <b>.[format].[compression]</b>. Example: <b>.sql.zip</b>');
|
||||
echo '</div>';
|
||||
}?>
|
||||
|
||||
$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";
|
||||
<div class="formelementrow" id="upload_form">
|
||||
<?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();
|
||||
} 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 ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
|
||||
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
|
||||
reset($cfg['AvailableCharsets']);
|
||||
@@ -190,32 +201,11 @@ 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";
|
||||
|
||||
// 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>
|
||||
<div class="importoptions">
|
||||
<h3><?php echo __('Partial Import:'); ?></h3>
|
||||
|
||||
<?php
|
||||
if (isset($timeout_passed) && $timeout_passed) {
|
||||
@@ -228,14 +218,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
|
||||
@@ -248,31 +238,33 @@ 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>
|
||||
<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>
|
||||
</fieldset>
|
||||
</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";
|
||||
?>
|
||||
<fieldset class="tblFooters">
|
||||
<div class="importoptions" id="submit">
|
||||
<input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" />
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -31,9 +31,11 @@ if (isset($plugin_list)) {
|
||||
'text' => 'CodeGen',
|
||||
'extension' => 'cs',
|
||||
'mime_type' => 'text/cs',
|
||||
'options' => array(
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'select', 'name' => 'format', 'text' => __('Format'), 'values' => $CG_FORMATS),
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -17,14 +17,16 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'csv',
|
||||
'mime_type' => 'text/comma-separated-values',
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated by')),
|
||||
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by')),
|
||||
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated by')),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns separated with:')),
|
||||
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:')),
|
||||
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated with:')),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -18,8 +18,9 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'csv',
|
||||
'mime_type' => 'text/comma-separated-values',
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array(
|
||||
'type' => 'select',
|
||||
@@ -28,8 +29,9 @@ if (isset($plugin_list)) {
|
||||
'win' => 'Windows',
|
||||
'mac_excel2003' => 'Excel 2003 / Macintosh',
|
||||
'mac_excel2008' => 'Excel 2008 / Macintosh'),
|
||||
'text' => __('Excel edition')),
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
'text' => __('Excel edition:')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -19,11 +19,15 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.ms-word',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'bool', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'),
|
||||
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
/* what to dump (structure/data/both) */
|
||||
array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')),
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
|
||||
array('type' => 'end_group'),
|
||||
/* data options */
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'egroup'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -16,12 +16,14 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'json',
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'data',
|
||||
'name' => 'structure_or_data',
|
||||
),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => 'strOptions',
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
} else {
|
||||
|
||||
|
@@ -27,48 +27,58 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'tex',
|
||||
'mime_type' => 'application/x-tex',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'caption', 'text' => __('Include table caption')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
||||
/* what to dump (structure/data/both) */
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table'));
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
|
||||
$plugin_list['latex']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* Structure options */
|
||||
if (!$hide_structure) {
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
|
||||
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
|
||||
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
|
||||
if (!empty($GLOBALS['cfgRelation']['relation'])) {
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
|
||||
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
|
||||
}
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments'));
|
||||
array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments'));
|
||||
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
|
||||
}
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'egroup');
|
||||
array('type' => 'end_group');
|
||||
}
|
||||
/* Data */
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
|
||||
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:'));
|
||||
$plugin_list['latex']['options'][] =
|
||||
array('type' => 'egroup');
|
||||
array('type' => 'end_group');
|
||||
} else {
|
||||
|
||||
/**
|
||||
|
@@ -16,7 +16,9 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'txt',
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -25,32 +25,40 @@ if (isset($plugin_list)) {
|
||||
'options' => array(), /* Filled later */
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
||||
/* what to dump (structure/data/both) */
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts');
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
|
||||
$plugin_list['odt']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* Structure options */
|
||||
if (!$hide_structure) {
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
|
||||
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
|
||||
if (!empty($GLOBALS['cfgRelation']['relation'])) {
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
|
||||
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
|
||||
}
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments'));
|
||||
array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments'));
|
||||
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
|
||||
}
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'egroup');
|
||||
array('type' => 'end_group');
|
||||
}
|
||||
/* Data */
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:'));
|
||||
$plugin_list['odt']['options'][] =
|
||||
array('type' => 'egroup');
|
||||
array('type' => 'end_group');
|
||||
} else {
|
||||
|
||||
$GLOBALS['odt_buffer'] = '';
|
||||
|
@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/pdf',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'message_only', 'name' => 'explanation', 'text' => __('(Generates a report containing the data of a single table)')),
|
||||
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title')),
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title:')),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -17,10 +17,12 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'php',
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'data',
|
||||
'name' => 'structure_or_data',
|
||||
),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -24,14 +24,37 @@ if (isset($plugin_list)) {
|
||||
'text' => __('SQL'),
|
||||
'extension' => 'sql',
|
||||
'mime_type' => 'text/x-sql',
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'header_comment', 'text' => __('Add custom comment into header (\\n splits lines)')),
|
||||
array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Comments')),
|
||||
array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction')),
|
||||
array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
'options' => array());
|
||||
|
||||
$plugin_list['sql']['options'][] = array('type' => 'begin_group', 'name' => 'general_opts');
|
||||
|
||||
/* comments */
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Display comments <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' => __('Display foreign key relationships'));
|
||||
}
|
||||
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
|
||||
}
|
||||
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
|
||||
/* end comments */
|
||||
|
||||
/* enclose in a transaction */
|
||||
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_single-transaction'));
|
||||
|
||||
/* disable foreign key checks */
|
||||
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'), 'doc' => array('manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks'));
|
||||
|
||||
$plugin_list['sql']['options_text'] = __('Options');
|
||||
|
||||
/* compatibility maximization */
|
||||
$compats = PMA_DBI_getCompatibilities();
|
||||
if (count($compats) > 0) {
|
||||
$values = array();
|
||||
@@ -39,88 +62,116 @@ if (isset($plugin_list)) {
|
||||
$values[$val] = $val;
|
||||
}
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'select', 'name' => 'compatibility', 'text' => __('SQL compatibility mode'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
|
||||
array('type' => 'select', 'name' => 'compatibility', 'text' => __('Database system or older MySQL server to maximize output compatibility with:'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
|
||||
unset($values);
|
||||
}
|
||||
|
||||
/* Server export options */
|
||||
/* server export options */
|
||||
if ($plugin_param['export_type'] == 'server') {
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bgroup', 'text' => __('Database export options'));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s'), 'DROP DATABASE'));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'egroup');
|
||||
}
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s statement'), '<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');
|
||||
|
||||
$plugin_list['sql']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* begin Structure options */
|
||||
if (!$hide_structure) {
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
|
||||
if ($plugin_param['export_type'] == 'table') {
|
||||
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
|
||||
|
||||
/* begin SQL Statements */
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'add_statements', 'text' => __('Add statements:')));
|
||||
if ($plugin_param['export_type'] == 'table') {
|
||||
if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) {
|
||||
$drop_clause = 'DROP VIEW';
|
||||
$drop_clause = '<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(__('Add %s statement'), $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(__('Add %s statement'), '<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' => __('Instead of <code>INSERT</code> statements, use:')));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Complete inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_complete-insert-option'));
|
||||
array('type' => 'bool', 'name' => 'delayed', 'text' => __('<code>INSERT DELAYED</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert_delayed'));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'extended', 'text' => __('Extended inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_extended-insert-option'));
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('<code>INSERT IGNORE</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert'));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'end_subgroup');
|
||||
/* end SQL statements */
|
||||
|
||||
/* Function to use when dumping data */
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'select', 'name' => 'type', 'text' => __('Function to use when dumping data:'), 'values' => array('INSERT' => 'INSERT', 'UPDATE' => 'UPDATE', 'REPLACE' => 'REPLACE'));
|
||||
|
||||
/* Syntax to use when inserting data */
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Syntax to use when inserting data:')));
|
||||
$plugin_list['sql']['options'][] =
|
||||
array('type' => 'radio', 'name' => 'insert_syntax', 'values' => array(
|
||||
'complete' => __('include column names in every <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');
|
||||
|
||||
/* 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 {
|
||||
|
||||
@@ -386,7 +437,7 @@ function PMA_exportDBFooter($db)
|
||||
|
||||
foreach($procedure_names as $procedure_name) {
|
||||
if (! empty($GLOBALS['sql_drop_table'])) {
|
||||
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
|
||||
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
|
||||
}
|
||||
$text .= PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf;
|
||||
}
|
||||
@@ -400,7 +451,7 @@ function PMA_exportDBFooter($db)
|
||||
|
||||
foreach($function_names as $function_name) {
|
||||
if (! empty($GLOBALS['sql_drop_table'])) {
|
||||
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
|
||||
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
|
||||
}
|
||||
$text .= PMA_DBI_get_definition($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf;
|
||||
}
|
||||
@@ -414,7 +465,7 @@ function PMA_exportDBFooter($db)
|
||||
|
||||
foreach($event_names as $event_name) {
|
||||
if (! empty($GLOBALS['sql_drop_table'])) {
|
||||
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
|
||||
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
|
||||
}
|
||||
$text .= PMA_DBI_get_definition($db, 'EVENT', $event_name) . $delimiter . $crlf . $crlf;
|
||||
}
|
||||
@@ -950,7 +1001,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
}
|
||||
|
||||
// scheme for inserting fields
|
||||
if (isset($GLOBALS['sql_columns'])) {
|
||||
if ($GLOBALS['sql_insert_syntax'] == 'complete' || $GLOBALS['sql_insert_syntax'] == 'both') {
|
||||
$fields = implode(', ', $field_set);
|
||||
$schema_insert = $sql_command . $insert_delayed .' INTO ' . PMA_backquote($table, $sql_backquotes)
|
||||
// avoid EOL blank
|
||||
@@ -965,7 +1016,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
$replace = array('\0', '\n', '\r', '\Z');
|
||||
$current_row = 0;
|
||||
$query_size = 0;
|
||||
if (isset($GLOBALS['sql_extended']) && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
|
||||
if (($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
|
||||
$separator = ',';
|
||||
$schema_insert .= $crlf;
|
||||
} else {
|
||||
@@ -1029,7 +1080,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
} else {
|
||||
|
||||
// Extended inserts case
|
||||
if (isset($GLOBALS['sql_extended'])) {
|
||||
if ($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') {
|
||||
if ($current_row == 1) {
|
||||
$insert_line = $schema_insert . '(' . implode(', ', $values) . ')';
|
||||
} else {
|
||||
|
@@ -18,22 +18,15 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'txt',
|
||||
'mime_type' => 'text/plain',
|
||||
'options' => array(
|
||||
array('type' => 'bool',
|
||||
'name' => 'structure',
|
||||
'text' => __('Structure'),
|
||||
'force' => 'data'),
|
||||
array('type' => 'bgroup',
|
||||
'name' => 'data',
|
||||
'text' => __('Data'),
|
||||
'force' => 'structure'),
|
||||
array('type' => 'text',
|
||||
'name' => 'null',
|
||||
'text' => __('Replace NULL by')),
|
||||
array('type' => 'bool',
|
||||
'name' => 'columns',
|
||||
'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'egroup'),
|
||||
),
|
||||
/* what to dump (structure/data/both) */
|
||||
array('type' => 'begin_group', 'text' => __('Dump table'), 'name' => 'general_opts'),
|
||||
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
|
||||
array('type' => 'end_group'),
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'end_group'),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
} else {
|
||||
|
@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.ms-excel',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
|
||||
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -18,30 +18,34 @@ if (isset($plugin_list)) {
|
||||
'extension' => 'xml',
|
||||
'mime_type' => 'text/xml',
|
||||
'options' => array(
|
||||
array('type' => 'hidden', 'name' => 'data'),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'hidden', 'name' => 'structure_or_data'),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options')
|
||||
);
|
||||
|
||||
/* Export structure */
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bgroup', 'name' => 'export_struc', 'text' => __('Export Structure Schemas (recommended)'));
|
||||
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options (all are recommended)'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Export functions'));
|
||||
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Export procedures'));
|
||||
array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Procedures'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Export tables'));
|
||||
array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Tables'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Export triggers'));
|
||||
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Export views'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'egroup');
|
||||
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views'));
|
||||
$plugin_list['xml']['options'][] = array('type' => 'end_group');
|
||||
|
||||
/* Data */
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'));
|
||||
$plugin_list['xml']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'export_contents', 'text' => __('Export contents'));
|
||||
$plugin_list['xml']['options'][] = array('type' => 'end_group');
|
||||
} else {
|
||||
|
||||
/**
|
||||
|
@@ -19,10 +19,12 @@ if (isset($plugin_list)) {
|
||||
'mime_type' => 'text/yaml',
|
||||
'force_file' => true,
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'data',
|
||||
'name' => 'structure_or_data',
|
||||
),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -64,7 +64,7 @@ if ($GLOBALS['error_handler']->hasDisplayErrors()) {
|
||||
}
|
||||
|
||||
if (count($GLOBALS['footnotes'])) {
|
||||
echo '<div class="notice">';
|
||||
echo '<div class="footnotes">';
|
||||
foreach ($GLOBALS['footnotes'] as $footnote) {
|
||||
echo '<span id="footnote_' . $footnote['nr'] . '"><sup>'
|
||||
. $footnote['nr'] . '</sup> ' . $footnote['note'] . '</span><br />';
|
||||
|
@@ -31,18 +31,13 @@ $title = PMA_expandUserString(
|
||||
$is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
|
||||
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'tooltip.js';
|
||||
$GLOBALS['js_include'][] = 'jquery.qtip-1.0.0.min.js';
|
||||
$params = array('lang' => $GLOBALS['lang']);
|
||||
if (isset($GLOBALS['db'])) {
|
||||
$params['db'] = $GLOBALS['db'];
|
||||
}
|
||||
$GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
|
||||
|
||||
$GLOBALS['js_events'][] = array(
|
||||
'event' => 'load',
|
||||
'function' => 'PMA_TT_init',
|
||||
);
|
||||
|
||||
/**
|
||||
* Here we add a timestamp when loading the file, so that users who
|
||||
* upgrade phpMyAdmin are not stuck with older .js files in their
|
||||
|
@@ -21,23 +21,26 @@ if (isset($plugin_list)) {
|
||||
'text' => __('CSV'),
|
||||
'extension' => 'csv',
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns separated with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:'), 'size' => 2, 'len' => 2),
|
||||
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated with:'), 'size' => 2),
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
||||
if ($plugin_param !== 'table') {
|
||||
$plugin_list['csv']['options'][] =
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row'));
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <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;
|
||||
@@ -115,7 +118,7 @@ if (!$analyze) {
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$message = PMA_Message::error(__('Invalid column (%s) specified!'));
|
||||
$message = PMA_Message::error(__('Invalid column (%s) specified! Ensure that columns names are spelled correctly, separated by commas, and not enclosed in quotes.' ));
|
||||
$message->addParam($val);
|
||||
$error = TRUE;
|
||||
break;
|
||||
@@ -358,7 +361,7 @@ if ($analyze) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($_REQUEST['csv_col_names']) {
|
||||
if (isset($_REQUEST['csv_col_names'])) {
|
||||
$col_names = array_splice($rows, 0, 1);
|
||||
$col_names = $col_names[0];
|
||||
}
|
||||
|
@@ -27,7 +27,9 @@ if (isset($plugin_list)) {
|
||||
'text' => __('DocSQL'), // text to be displayed as choice
|
||||
'extension' => '', // extension this plugin can handle
|
||||
'options' => array( // array of options for your plugin (optional)
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'text', 'name' => 'table', 'text' => __('Table name')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'), // text to describe plugin options (must be set if options are used)
|
||||
);
|
||||
|
@@ -34,6 +34,7 @@ if (isset($plugin_list)) {
|
||||
'text' => __('CSV using LOAD DATA'),
|
||||
'extension' => 'ldi', // This is nonsense, however we want to default to our parser for csv
|
||||
'options' => array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
|
||||
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
|
||||
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2),
|
||||
@@ -42,6 +43,7 @@ if (isset($plugin_list)) {
|
||||
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2),
|
||||
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')),
|
||||
array('type' => 'bool', 'name' => 'local_option', 'text' => __('Use LOCAL keyword')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -22,10 +22,12 @@ if (isset($plugin_list)) {
|
||||
'text' => __('Open Document Spreadsheet'),
|
||||
'extension' => 'ods',
|
||||
'options' => array(
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <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>')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -25,10 +25,11 @@ if (isset($plugin_list)) {
|
||||
$values[$val] = $val;
|
||||
}
|
||||
$plugin_list['sql']['options'] = array(
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array(
|
||||
'type' => 'select',
|
||||
'name' => 'compatibility',
|
||||
'text' => __('SQL compatibility mode'),
|
||||
'text' => __('SQL compatibility mode:'),
|
||||
'values' => $values,
|
||||
'doc' => array(
|
||||
'manual_MySQL_Database_Administration',
|
||||
@@ -38,7 +39,7 @@ if (isset($plugin_list)) {
|
||||
array(
|
||||
'type' => 'bool',
|
||||
'name' => 'no_auto_value_on_zero',
|
||||
'text' => __('Do not use AUTO_INCREMENT for zero values'),
|
||||
'text' => __('Do not use <code>AUTO_INCREMENT</code> for zero values'),
|
||||
'doc' => array(
|
||||
'manual_MySQL_Database_Administration',
|
||||
'Server_SQL_mode',
|
||||
@@ -46,6 +47,7 @@ if (isset($plugin_list)) {
|
||||
),
|
||||
|
||||
),
|
||||
array('type' => 'end_group'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,9 @@ if (isset($plugin_list)) {
|
||||
'text' => __('Excel 97-2003 XLS Workbook'),
|
||||
'extension' => 'xls',
|
||||
'options' => array(
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -20,7 +20,9 @@ if (isset($plugin_list)) {
|
||||
'text' => __('Excel 2007 XLSX Workbook'),
|
||||
'extension' => 'xlsx',
|
||||
'options' => array(
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
|
||||
array('type' => 'begin_group', 'name' => 'general_opts'),
|
||||
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
|
||||
array('type' => 'end_group')
|
||||
),
|
||||
'options_text' => __('Options'),
|
||||
);
|
||||
|
@@ -137,18 +137,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
|
||||
|
||||
|
@@ -60,6 +60,7 @@ function PMA_getString($name)
|
||||
* returns html input tag option 'checked' if plugin $opt should be set by config or request
|
||||
*
|
||||
* @uses $_REQUEST
|
||||
* @uses $_GET
|
||||
* @uses $GLOBALS['cfg']
|
||||
* @uses $GLOBALS['timeout_passed']
|
||||
* @param string $section name of config section in
|
||||
@@ -69,8 +70,9 @@ function PMA_getString($name)
|
||||
*/
|
||||
function PMA_pluginCheckboxCheck($section, $opt)
|
||||
{
|
||||
if ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) ||
|
||||
(isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt])) {
|
||||
// If the form is being repopulated using $_GET data, that is priority
|
||||
if (isset($_GET[$opt]) || !isset($_GET['repopulate']) && ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) ||
|
||||
(isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt]))) {
|
||||
return ' checked="checked"';
|
||||
}
|
||||
return '';
|
||||
@@ -83,6 +85,7 @@ function PMA_pluginCheckboxCheck($section, $opt)
|
||||
*
|
||||
* @uses htmlspecialchars()
|
||||
* @uses $_REQUEST
|
||||
* @uses $_GET
|
||||
* @uses $GLOBALS['cfg']
|
||||
* @uses $GLOBALS['timeout_passed']
|
||||
* @param string $section name of config section in
|
||||
@@ -92,7 +95,9 @@ function PMA_pluginCheckboxCheck($section, $opt)
|
||||
*/
|
||||
function PMA_pluginGetDefault($section, $opt)
|
||||
{
|
||||
if (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) {
|
||||
if(isset($_GET[$opt])) { // If the form is being repopulated using $_GET data, that is priority
|
||||
return htmlspecialchars($_GET[$opt]);
|
||||
} elseif (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) {
|
||||
return htmlspecialchars($_REQUEST[$opt]);
|
||||
} elseif (isset($GLOBALS['cfg'][$section][$opt])) {
|
||||
$matches = array();
|
||||
@@ -141,37 +146,44 @@ function PMA_pluginIsActive($section, $opt, $val)
|
||||
/**
|
||||
* string PMA_pluginGetChoice(string $section, string $name, array &$list, string $cfgname)
|
||||
*
|
||||
* returns html radio form element for plugin choice
|
||||
* returns html select form element for plugin choice
|
||||
* and hidden fields denoting whether each plugin must be exported as a file
|
||||
*
|
||||
* @uses PMA_pluginIsActive()
|
||||
* @uses PMA_pluginGetDefault()
|
||||
* @uses PMA_getString()
|
||||
* @param string $section name of config section in
|
||||
* $GLOBALS['cfg'][$section] for plugin
|
||||
* @param string $name name of radio element
|
||||
* @param string $name name of select element
|
||||
* @param array &$list array with plugin configuration defined in plugin file
|
||||
* @param string $cfgname name of config value, if none same as $name
|
||||
* @return string html input radio tag
|
||||
* @return string html select tag
|
||||
*/
|
||||
function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
|
||||
{
|
||||
if (!isset($cfgname)) {
|
||||
$cfgname = $name;
|
||||
}
|
||||
$ret = '';
|
||||
$ret = '<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 the form is being repopulated using $_GET data, that is priority
|
||||
if(isset($_GET[$name]) && $plugin_name == $_GET[$name] || !isset($_GET[$name]) && $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;
|
||||
}
|
||||
@@ -179,7 +191,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
|
||||
/**
|
||||
* string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt)
|
||||
*
|
||||
* returns single option in a table row
|
||||
* returns single option in a list element
|
||||
*
|
||||
* @uses PMA_getString()
|
||||
* @uses PMA_pluginCheckboxCheck()
|
||||
@@ -195,7 +207,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
{
|
||||
$ret = "\n";
|
||||
if ($opt['type'] == 'bool') {
|
||||
$ret .= '<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']);
|
||||
@@ -209,9 +221,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'] . '"'
|
||||
@@ -219,13 +230,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'] . '"'
|
||||
@@ -239,33 +248,38 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
$ret .= '>' . PMA_getString($val) . '</option>';
|
||||
}
|
||||
$ret .= '</select>';
|
||||
$ret .= '</div>' . "\n";
|
||||
} 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 && '
|
||||
. '(!document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\') '
|
||||
. '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\').checked)) '
|
||||
. 'return false; else return true;"';
|
||||
} 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 .= ' />';
|
||||
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
|
||||
. PMA_getString($opt['text']) . '</label>';
|
||||
} else {
|
||||
$ret .= PMA_getString($opt['text']);
|
||||
$ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">'
|
||||
. PMA_getString($val) . '</label></li>';
|
||||
}
|
||||
$ret .= '</legend>';
|
||||
} elseif ($opt['type'] == 'egroup') {
|
||||
$ret .= '</fieldset>';
|
||||
} elseif ($opt['type'] == 'hidden') {
|
||||
$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'] . '">';
|
||||
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']) . '<li class="subgroup"><ul';
|
||||
if(isset($opt['subgroup_header']['name'])) {
|
||||
$ret .= ' id="ul_' . $opt['subgroup_header']['name'] . '">';
|
||||
} else {
|
||||
$ret .= '>';
|
||||
}
|
||||
} elseif ($opt['type'] == 'end_subgroup') {
|
||||
$ret .= '</ul></li>';
|
||||
} else {
|
||||
/* This should be seen only by plugin writers, so I do not thing this
|
||||
* needs translation. */
|
||||
@@ -280,6 +294,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
$ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Close the list element after $opt['doc'] link is displayed
|
||||
if($opt['type'] == 'bool' || $opt['type'] == 'text' || $opt['type'] == 'message_only' || $opt['type'] == 'select') {
|
||||
$ret .= '</li>';
|
||||
}
|
||||
$ret .= "\n";
|
||||
return $ret;
|
||||
}
|
||||
@@ -287,10 +306,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
/**
|
||||
* string PMA_pluginGetOptions(string $section, array &$list)
|
||||
*
|
||||
* return html fieldset with editable options for plugin
|
||||
* return html div with editable options for plugin
|
||||
*
|
||||
* @uses PMA_getString()
|
||||
* @uses PMA_pluginGetOneOption()
|
||||
* @uses PMA_pluginGetDefault();
|
||||
* @param string $section name of config section in $GLOBALS['cfg'][$section]
|
||||
* @param array &$list array with plugin configuration defined in plugin file
|
||||
* @return string html fieldset with plugin options
|
||||
@@ -298,84 +318,24 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
|
||||
function PMA_pluginGetOptions($section, &$list)
|
||||
{
|
||||
$ret = '';
|
||||
$default = PMA_pluginGetDefault('Export', 'format');
|
||||
// Options for plugins that support them
|
||||
foreach ($list as $plugin_name => $val) {
|
||||
$ret .= '<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">';
|
||||
$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 .= '</fieldset>';
|
||||
$ret .= '</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;
|
||||
}
|
||||
?>
|
||||
|
@@ -121,6 +121,9 @@ function PMA_langCheck()
|
||||
*/
|
||||
function PMA_langSet(&$lang)
|
||||
{
|
||||
/* Partial backward compatibility with 3.3 and older branches */
|
||||
$lang = str_replace('-utf-8', '', $lang);
|
||||
|
||||
if (!is_string($lang) || empty($lang) || empty($GLOBALS['available_languages'][$lang])) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -35,13 +35,13 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
|
||||
if (! $ommit_fieldset) {
|
||||
echo '<fieldset>';
|
||||
}
|
||||
echo '<label for="select_server">' . __('Server') . ':</label> ';
|
||||
echo '<label for="select_server">' . __('Current Server') . ':</label> ';
|
||||
|
||||
echo '<select name="server" id="select_server"'
|
||||
. ' onchange="if (this.value != \'\') this.form.submit();">';
|
||||
echo '<option value="">(' . __('Servers') . ') ...</option>' . "\n";
|
||||
} elseif ($list) {
|
||||
echo __('Server') . ':<br />';
|
||||
echo __('Current Server') . ':<br />';
|
||||
echo '<ul id="list_server">';
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
|
||||
} else {
|
||||
$selected = 0;
|
||||
}
|
||||
|
||||
if (!empty($server['verbose'])) {
|
||||
$label = $server['verbose'];
|
||||
} else {
|
||||
@@ -78,7 +77,7 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
|
||||
|
||||
if ($list) {
|
||||
echo '<li>';
|
||||
if ($selected && !$ommit_fieldset) {
|
||||
if ($selected) {
|
||||
echo '<strong>' . htmlspecialchars($label) . '</strong>';
|
||||
} else {
|
||||
|
||||
|
@@ -277,8 +277,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
|
||||
@@ -365,7 +366,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 onclick="return false;" href="enum_editor.php?' . PMA_generate_common_url() . '&values=' . urlencode($length_to_display) . '&field=' . (isset($row['Field']) ? urlencode($row['Field']) : "") . '" class="open_enum_editor" target="_blank"> '
|
||||
. __('Get more editing space') . '</a></p>';
|
||||
$ci++;
|
||||
|
||||
// column default
|
||||
@@ -787,3 +792,14 @@ 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>
|
||||
<h3><?php printf(__('Values for the column "%s"'), isset($row['Field']) ? htmlspecialchars($row['Field']) : ""); ?></h3>
|
||||
<p><?php echo __('Enter each value in a separate field. If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'); ?></p>
|
||||
<div id="values"></div>
|
||||
<p><a class="add_value">+ Add a new value</a></p>
|
||||
<input type="submit" value="Go" /> <a class="cancel_enum_editor">Cancel</a>
|
||||
</div>
|
||||
|
||||
<div id="popup_background"></div>
|
||||
|
Reference in New Issue
Block a user