Merge remote branch 'lori/gsoc'

This commit is contained in:
Michal Čihař
2010-08-19 11:11:51 +02:00
61 changed files with 2144 additions and 1017 deletions

View File

@@ -2021,6 +2021,14 @@ setfacl -d -m "g:www-data:rwx" tmp
identify what they mean.
</dd>
<dt id="cfg_Export">$cfg['Export']['method'] string</dt>
<dd>
Defines how the export form is displayed when it loads. Valid values are:
<li><tt>quick</tt> to display the minimum number of options to configure</li>
<li><tt>custom</tt> to display every available option to configure</li>
<li><tt>custom-no-form</tt> same as <tt>custom</tt> but does not display the option of using quick export</li>
</dd>
<dt id="cfg_Import">$cfg['Import'] array</dt>
<dd>
In this array are defined default parameters for import, names of

View File

@@ -15,6 +15,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'export.js';
// $sub_part is also used in db_info.inc.php to see if we are coming from
// db_export.php, in which case we don't obey $cfg['MaxTableList']
$sub_part = '_export';
@@ -38,20 +40,32 @@ $checkall_url = 'db_export.php?'
. PMA_generate_common_url($db)
. '&amp;goto=db_export.php';
$multi_values = '<div align="center">';
$multi_values = '<div>';
$multi_values .= '<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'table_select[]\', true); return false;">' . __('Select All') . '</a>
/
<a href="' . $checkall_url . '&amp;unselectall=1" onclick="setSelectOptions(\'dump\', \'table_select[]\', false); return false;">' . __('Unselect All') . '</a><br />';
$multi_values .= '<select name="table_select[]" size="10" multiple="multiple">';
$multi_values .= '<select name="table_select[]" id="table_select" size="10" multiple="multiple">';
$multi_values .= "\n";
if (!empty($selected_tbl) && empty($table_select)) {
$table_select = $selected_tbl;
}
// Check if the selected tables are defined in $_GET (from clicking Back button on export.php)
if(isset($_GET['table_select'])) {
$_GET['table_select'] = urldecode($_GET['table_select']);
$_GET['table_select'] = explode(",", $_GET['table_select']);
}
foreach ($tables as $each_table) {
if (! empty($unselectall)
if(isset($_GET['table_select'])) {
if(in_array($each_table['Name'], $_GET['table_select'])) {
$is_selected = ' selected="selected"';
} else {
$is_selected = '';
}
} elseif (! empty($unselectall)
|| (! empty($table_select) && !in_array($each_table['Name'], $table_select))) {
$is_selected = '';
} else {
@@ -64,7 +78,7 @@ foreach ($tables as $each_table) {
} // end for
$multi_values .= "\n";
$multi_values .= '</select></div><br />';
$multi_values .= '</select></div>';
$export_type = 'database';
require_once './libraries/display_export.lib.php';

View File

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

75
enum_editor.php Normal file
View File

@@ -0,0 +1,75 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays a form for editing ENUM and SET values with more space (as an alternative to doing it in tbl_alter.php)
* This form is only for users with JavaScript disabled -- users with JavaScript enabled will see a different form
* defined in tbl_properties.inc.php
* @package phpMyAdmin
*/
require_once './libraries/common.inc.php';
require_once './libraries/header_http.inc.php';
require_once './libraries/header_meta_style.inc.php';
?>
</head>
<body>
<form action="enum_editor.php" method="get">
<div id="enum_editor_no_js">
<h3><?php echo __('Values for the column "' . urldecode($_GET['field']) . '"'); ?></h3>
<p><?php echo __('Enter each value in a separate field, enclosed in single quotes. 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">
<?php
$values = '';
if (isset($_GET['values'])) { // This page was displayed when the "add a new value" link or the link in tbl_alter.php was clicked
$values = urldecode($_GET['values']);
} elseif (isset($_GET['num_fields'])) { // This page was displayed from submitting this form
for($field_num = 1; $field_num <= $_GET['num_fields']; $field_num++) {
$values .= $_GET['field' . $field_num] . ",";
}
}
// Display the values in text fields, excluding empty strings
$field_counter = 0;
$stripped_values = array(); // The values to display in the output
foreach(split(",", $values) as $value) {
if(trim($value) != "") {
$field_counter++;
echo sprintf('<input type="text" size="30" value="%s" name="field' . $field_counter . '" />', htmlspecialchars($value));
$stripped_values[] = htmlspecialchars($value);
}
}
$total_fields = $field_counter;
// If extra empty fields are added, display them
if(isset($_GET['extra_fields'])) {
$total_fields += $_GET['extra_fields'];
for($i = $field_counter+1; $i <= $total_fields; $i++) {
echo '<input type="text" size="30" name="field' . $i . '"/>';
}
} else {
$_GET['extra_fields'] = 0;
}
?>
</div>
<p>
<a href="enum_editor.php?token=<?php echo urlencode($_GET['token']); ?>&field=<?php echo urlencode($_GET['field']); ?>&extra_fields=<?php echo $_GET['extra_fields'] + 1; ?>&values=<?php echo $values; ?>">
+ Restart insertion and add a new value
</a>
</p>
<input type="hidden" name="token" value="<?php echo $_GET['token']; ?>" />
<input type="hidden" name="field" value="<?php echo $_GET['field']; ?>" />
<input type="hidden" name="num_fields" value="<?php echo $total_fields; ?>" />
<input type="submit" value="Go" />
</form>
<div id="enum_editor_output">
<h3>Output</h3>
<p>Copy and paste the joined values into the "Length/Values" field</p>
<textarea id="joined_values" cols="95" rows="5"><?php echo join(",", $stripped_values); ?></textarea>
</div>
</div>
</body>
</html>

View File

@@ -41,7 +41,15 @@ $compression = false;
$onserver = false;
$save_on_server = false;
$buffer_needed = false;
if (empty($_REQUEST['asfile'])) {
// Is it a quick or custom export?
if($_REQUEST['quick_or_custom'] == 'quick') {
$quick_export = true;
} else {
$quick_export = false;
}
if ($_REQUEST['output_format'] == 'astext') {
$asfile = false;
} else {
$asfile = true;
@@ -49,8 +57,12 @@ if (empty($_REQUEST['asfile'])) {
$compression = $_REQUEST['compression'];
$buffer_needed = true;
}
if (!empty($_REQUEST['onserver'])) {
if (($quick_export && !empty($_REQUEST['quick_export_onserver'])) || (!$quick_export && !empty($_REQUEST['onserver']))) {
if($quick_export) {
$onserver = $_REQUEST['quick_export_onserver'];
} else {
$onserver = $_REQUEST['onserver'];
}
// Will we save dump on server?
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
}
@@ -261,7 +273,13 @@ if ($asfile) {
$filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
// Grab basic dump extension and mime type
$filename .= '.' . $export_list[$type]['extension'];
// Check if the user already added extension; get the substring where the extension would be if it was included
$extension_start_pos = strlen($filename) - strlen($export_list[$type]['extension']) - 1;
$user_extension = substr($filename, $extension_start_pos, strlen($filename));
$required_extension = "." . $export_list[$type]['extension'];
if(strtolower($user_extension) != $required_extension) {
$filename .= $required_extension;
}
$mime_type = $export_list[$type]['mime_type'];
// If dump is going to be compressed, set correct mime_type and add
@@ -282,7 +300,7 @@ if ($asfile) {
if ($save_on_server) {
$save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename);
unset($message);
if (file_exists($save_filename) && empty($onserverover)) {
if (file_exists($save_filename) && ((!$quick_export && empty($onserverover)) || ($quick_export && $_REQUEST['quick_export_onserverover'] != 'saveitover'))) {
$message = PMA_Message::error(__('File %s already exists on server, change filename or check overwrite option.'));
$message->addParam($save_filename);
} else {
@@ -360,6 +378,32 @@ if (!$save_on_server) {
unset($backup_cfgServer);
echo "\n" . '<div align="' . $cell_align_left . '">' . "\n";
//echo ' <pre>' . "\n";
/**
* Displays a back button with all the $_REQUEST data in the URL (store in a variable to also display after the textarea)
*/
$back_button = '<p>[ <a href="';
if ($export_type == 'server') {
$back_button .= 'server_export.php?' . PMA_generate_common_url();
} elseif ($export_type == 'database') {
$back_button .= 'db_export.php?' . PMA_generate_common_url($db);
} else {
$back_button .= 'tbl_export.php?' . PMA_generate_common_url($db, $table);
}
// Convert the multiple select elements from an array to a string
if($export_type == 'server' && isset($_REQUEST['db_select'])) {
$_REQUEST['db_select'] = implode(",", $_REQUEST['db_select']);
} elseif($export_type == 'database' && isset($_REQUEST['table_select'])) {
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
}
foreach($_REQUEST as $name => $value) {
$back_button .= '&' . urlencode($name) . '=' . urlencode($value);
}
$back_button .= '&repopulate=1">Back</a> ]</p>';
echo $back_button;
echo ' <form name="nofunction">' . "\n"
// remove auto-select for now: there is no way to select
// only a part of the text; anyway, it should obey
@@ -380,7 +424,7 @@ if (!PMA_exportHeader()) {
// Will we need relation & co. setup?
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']);
$do_comments = isset($GLOBALS[$what . '_include_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
$cfgRelation = PMA_getRelationsParam();
@@ -420,7 +464,7 @@ if ($export_type == 'server') {
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
@@ -428,7 +472,7 @@ if ($export_type == 'server') {
}
}
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($current_db, $table))) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($current_db, $table))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
break 3;
@@ -436,7 +480,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -444,7 +488,7 @@ if ($export_type == 'server') {
}
foreach($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
break 3;
}
@@ -469,7 +513,7 @@ if ($export_type == 'server') {
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
@@ -477,7 +521,7 @@ if ($export_type == 'server') {
}
}
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($db, $table))) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($db, $table))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
break 2;
@@ -485,7 +529,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -493,7 +537,7 @@ if ($export_type == 'server') {
}
foreach ($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
break 2;
}
@@ -518,7 +562,7 @@ if ($export_type == 'server') {
}
$is_view = PMA_Table::isView($db, $table);
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) {
break;
}
@@ -526,7 +570,7 @@ if ($export_type == 'server') {
// If this is an export of a single view, we have to export data;
// for example, a PDF report
// if it is a merge table, no data is exported
if (isset($GLOBALS[$what . '_data']) && ! PMA_Table::isMerge($db, $table)) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) {
if (!empty($sql_query)) {
// only preg_replace if needed
if (!empty($add_query)) {
@@ -544,7 +588,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -640,9 +684,11 @@ else {
/**
* Close the html tags and add the footers in dump is displayed on screen
*/
//echo ' </pre>' . "\n";
echo '</textarea>' . "\n"
. ' </form>' . "\n";
echo $back_button;
echo "\n";
echo '</div>' . "\n";
echo "\n";
?>

221
js/export.js Normal file
View File

@@ -0,0 +1,221 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the export tab
*
* @version $Id$
*/
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
$(document).ready(function() {
$("#plugins").change(function() {
$(".format_specific_options").each(function() {
$(this).hide();
});
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").show();
});
});
/**
* Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
*/
$(document).ready(function() {
$("input[type='radio'][name$='sql_structure_or_data']").change(function() {
var show = $("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value");
if(show == 'data') {
// disable the SQL comment options
$("#checkbox_sql_dates").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_dates").attr('disabled', 'disabled');
$("#checkbox_sql_relation").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_relation").attr('disabled', 'disabled');
$("#checkbox_sql_mime").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_mime").attr('disabled', 'disabled');
} else {
// enable the SQL comment options
$("#checkbox_sql_dates").parent().fadeTo('fast', 1);
$("#checkbox_sql_dates").removeAttr('disabled');
$("#checkbox_sql_relation").parent().fadeTo('fast', 1);
$("#checkbox_sql_relation").removeAttr('disabled');
$("#checkbox_sql_mime").parent().fadeTo('fast', 1);
$("#checkbox_sql_mime").removeAttr('disabled');
}
});
});
/**
* Toggles the hiding and showing of plugin structure-specific and data-specific
* options
*/
function toggle_structure_data_opts(pluginName) {
var radioFormName = pluginName + "_structure_or_data";
var dataDiv = "#" + pluginName + "_data";
var structureDiv = "#" + pluginName + "_structure";
var show = $("input[type='radio'][name='" + radioFormName + "']:checked").attr("value");
if(show == 'data') {
$(dataDiv).slideDown('slow');
$(structureDiv).slideUp('slow');
} else {
$(structureDiv).slideDown('slow');
if(show == 'structure') {
$(dataDiv).slideUp('slow');
} else {
$(dataDiv).slideDown('slow');
}
}
}
$(document).ready(function() {
$("input[type='radio'][name='latex_structure_or_data']").change(function() {
toggle_structure_data_opts("latex");
});
$("input[type='radio'][name='odt_structure_or_data']").change(function() {
toggle_structure_data_opts("odt");
});
$("input[type='radio'][name='texytext_structure_or_data']").change(function() {
toggle_structure_data_opts("texytext");
});
$("input[type='radio'][name='htmlword_structure_or_data']").change(function() {
toggle_structure_data_opts("htmlword");
});
$("input[type='radio'][name='sql_structure_or_data']").change(function() {
toggle_structure_data_opts("sql");
});
});
/**
* Toggles the disabling of the "save to file" options
*/
$(document).ready(function() {
$("input[type='radio'][name='output_format']").change(function() {
if($("#radio_dump_asfile:checked").length == 0) {
$("#ul_save_asfile > li").fadeTo('fast', 0.4);
$("#ul_save_asfile > li > input").attr('disabled', 'disabled');
$("#ul_save_asfile > li> select").attr('disabled', 'disabled');
} else {
$("#ul_save_asfile > li").fadeTo('fast', 1);
$("#ul_save_asfile > li > input").removeAttr('disabled');
$("#ul_save_asfile > li> select").removeAttr('disabled');
}
});
});
/**
* For SQL plugin, toggles the disabling of the "display comments" options
*/
function toggle_sql_include_comments() {
$("#checkbox_sql_include_comments").change(function() {
if($("#checkbox_sql_include_comments:checked").length == 0) {
$("#ul_include_comments > li").fadeTo('fast', 0.4);
$("#ul_include_comments > li > input").attr('disabled', 'disabled');
} else {
// If structure is not being exported, the comment options for structure should not be enabled
if($("#radio_sql_structure_or_data_data:checked").length == 1) {
$("#text_sql_header_comment").parent("li").fadeTo('fast', 1);
$("#text_sql_header_comment").removeAttr('disabled');
} else {
$("#ul_include_comments > li").fadeTo('fast', 1);
$("#ul_include_comments > li > input").removeAttr('disabled');
}
}
});
}
/**
* For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
*/
$(document).ready(function() {
$("#checkbox_sql_create_table_statements").change(function() {
if($("#checkbox_sql_create_table_statements:checked").length == 0) {
$("#checkbox_sql_if_not_exists").removeAttr('checked');
$("#checkbox_sql_auto_increment").removeAttr('checked');
} else {
$("#checkbox_sql_if_not_exists").attr('checked', 'checked');
$("#checkbox_sql_auto_increment").attr('checked', 'checked');
}
});
});
/**
* Disables the view output as text option if the output must be saved as a file
*/
$(document).ready(function() {
$("#plugins").change(function() {
var active_plugin = $("#plugins option:selected").attr("value");
var force_file = $("#force_file_" + active_plugin).attr("value");
if(force_file == "true") {
$("#radio_view_as_text").attr('disabled', 'disabled');
$("#radio_view_as_text").parent().fadeTo('fast', 0.4);
} else {
$("#radio_view_as_text").removeAttr('disabled');
$("#radio_view_as_text").parent().fadeTo('fast', 1);
}
});
});
/**
* Toggles display of options when quick and custom export are selected
*/
function toggle_quick_or_custom() {
if($("$(this):checked").attr("value") == "custom") {
$("#databases_and_tables").show();
$("#rows").show();
$("#output").show();
$("#format_specific_opts").show();
$("#output_quick_export").hide();
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").show();
} else {
$("#databases_and_tables").hide();
$("#rows").hide();
$("#output").hide();
$("#format_specific_opts").hide();
$("#output_quick_export").show();
}
}
$(document).ready(function() {
$("input[type='radio'][name='quick_or_custom']").change(function() {
toggle_quick_or_custom();
});
});
/**
* Sets up the interface for Javascript-enabled browsers since the default is for
* Javascript-disabled browsers
*/
$(document).ready(function() {
if($("input[type='hidden'][name='export_method']").attr("value") != "custom-no-form") {
$("#quick_or_custom").show();
}
$("#scroll_to_options_msg").hide();
$(".format_specific_options").hide();
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0});
$(".format_specific_options h3").remove();
toggle_quick_or_custom();
toggle_structure_data_opts($("select[id='plugins']").attr("value"));
toggle_sql_include_comments();
});
/**
* Disables the "Dump some row(s)" sub-options when it is not selected
*/
$(document).ready(function() {
$("input[type='radio'][name='allrows']").change(function() {
if($("input[type='radio'][name='allrows']:checked").attr("value") == "1") {
$("label[for='limit_to']").fadeTo('fast', 0.4);
$("label[for='limit_from']").fadeTo('fast', 0.4);
$("input[type='text'][name='limit_to']").attr('disabled', 'disabled');
$("input[type='text'][name='limit_from']").attr('disabled', 'disabled');
} else {
$("label[for='limit_to']").fadeTo('fast', 1);
$("label[for='limit_from']").fadeTo('fast', 1);
$("input[type='text'][name='limit_to']").removeAttr('disabled');
$("input[type='text'][name='limit_from']").removeAttr('disabled');
}
});
});

View File

@@ -1697,3 +1697,200 @@ $(document).ready(function(){
}
});
/**
* Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected
*/
function toggle_enum_notice(selectElement) {
var enum_notice_id = selectElement.attr("id").split("_")[1];
enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1);
var selectedType = selectElement.attr("value");
if(selectedType == "ENUM" || selectedType == "SET") {
$("p[id='enum_notice_" + enum_notice_id + "']").show();
} else {
$("p[id='enum_notice_" + enum_notice_id + "']").hide();
}
}
/**
* Toggle the hiding/showing of the "Open in ENUM/SET editor" message when
* the page loads and when the selected data type changes
*/
$(document).ready(function() {
$.each($("select[class='column_type']"), function() {
toggle_enum_notice($(this));
});
$("select[class='column_type']").change(function() {
toggle_enum_notice($(this));
});
});
/**
* Closes the ENUM/SET editor and removes the data in it
*/
function disable_popup() {
$("#popup_background").fadeOut("fast");
$("#enum_editor").fadeOut("fast");
// clear the data from the text boxes
$("#enum_editor #values input").remove();
$("#enum_editor input[type='hidden']").remove();
}
/**
* Opens the ENUM/SET editor and controls its functions
*/
$(document).ready(function() {
$("a[class='open_enum_editor']").click(function() {
// Center the popup
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupWidth = windowWidth/2;
var popupHeight = windowHeight*0.8;
var popupOffsetTop = windowHeight/2 - popupHeight/2;
var popupOffsetLeft = windowWidth/2 - popupWidth/2;
$("#enum_editor").css({"position":"absolute", "top": popupOffsetTop, "left": popupOffsetLeft, "width": popupWidth, "height": popupHeight});
// Make it appear
$("#popup_background").css({"opacity":"0.7"});
$("#popup_background").fadeIn("fast");
$("#enum_editor").fadeIn("fast");
// Get the values
var values = $(this).parent().prev("input").attr("value").split(",");
$.each(values, function(index, val) {
if(jQuery.trim(val) != "") {
// enclose the string in single quotes if it's not already
if(val.substr(0, 1) != "'") {
val = "'" + val;
}
if(val.substr(val.length-1, val.length) != "'") {
val = val + "'";
}
// escape the single quotes, except the mandatory ones enclosing the entire string
val = val.substr(1, val.length-2).replace(/'/g, "&#039;");
// escape the greater-than symbol
val = val.replace(/>/g, "&gt;");
$("#enum_editor #values").append("<input type='text' value=" + val + " />");
}
});
// So we know which column's data is being edited
$("#enum_editor").append("<input type='hidden' value='" + $(this).parent().prev("input").attr("id") + "' />");
return false;
});
// If the "close" link is clicked, close the enum editor
$("a[class='close_enum_editor']").click(function() {
disable_popup();
});
// If the "cancel" link is clicked, close the enum editor
$("a[class='cancel_enum_editor']").click(function() {
disable_popup();
});
// When "add a new value" is clicked, append an empty text field
$("a[class='add_value']").click(function() {
$("#enum_editor #values").append("<input type='text' />");
});
// When the submit button is clicked, put the data back into the original form
$("#enum_editor input[type='submit']").click(function() {
var value_array = new Array();
$.each($("#enum_editor #values input"), function(index, input_element) {
val = jQuery.trim(input_element.value);
if(val != "") {
value_array.push("'" + val + "'");
}
});
// get the Length/Values text field where this value belongs
var values_id = $("#enum_editor input[type='hidden']").attr("value");
$("input[id='" + values_id + "']").attr("value", value_array.join(","));
disable_popup();
});
/**
* Hides certain table structure actions, replacing them with the word "More". They are displayed
* in a dropdown menu when the user hovers over the word "More."
*/
// Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers)
// if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point)
if($("input[type='hidden'][name='table_type']").attr("value") == "table") {
$("table[id='tablestructure'] td[class='browse']").remove();
$("table[id='tablestructure'] td[class='primary']").remove();
$("table[id='tablestructure'] td[class='unique']").remove();
$("table[id='tablestructure'] td[class='index']").remove();
$("table[id='tablestructure'] td[class='fulltext']").remove();
$("table[id='tablestructure'] th[class='action']").attr("colspan", 3);
// Display the "more" text
$("table[id='tablestructure'] td[class='more_opts']").show()
// Position the dropdown
$.each($(".structure_actions_dropdown"), function() {
// The top offset must be set for IE even if it didn't change
var cell_right_edge_offset = $(this).parent().offset().left + $(this).parent().innerWidth();
var left_offset = cell_right_edge_offset - $(this).innerWidth();
var top_offset = $(this).parent().offset().top + $(this).parent().innerHeight();
$(this).offset({ top: top_offset, left: left_offset });
});
// A hack for IE6 to prevent the after_field select element from being displayed on top of the dropdown by
// positioning an iframe directly on top of it
$("iframe[class='IE_hack']").width($("select[name='after_field']").width());
$("iframe[class='IE_hack']").height($("select[name='after_field']").height());
$("iframe[class='IE_hack']").offset({ top: $("select[name='after_field']").offset().top, left: $("select[name='after_field']").offset().left });
// When "more" is hovered over, show the hidden actions
$("table[id='tablestructure'] td[class='more_opts']").mouseenter(
function() {
if($.browser.msie && $.browser.version == "6.0") {
$("iframe[class='IE_hack']").show();
$("iframe[class='IE_hack']").width($("select[name='after_field']").width()+4);
$("iframe[class='IE_hack']").height($("select[name='after_field']").height()+4);
$("iframe[class='IE_hack']").offset({ top: $("select[name='after_field']").offset().top, left: $("select[name='after_field']").offset().left});
}
$(".structure_actions_dropdown").hide(); // Hide all the other ones that may be open
$(this).children(".structure_actions_dropdown").show();
// Need to do this again for IE otherwise the offset is wrong
if($.browser.msie) {
var left_offset_IE = $(this).offset().left + $(this).innerWidth() - $(this).children(".structure_actions_dropdown").innerWidth();
var top_offset_IE = $(this).offset().top + $(this).innerHeight();
$(this).children(".structure_actions_dropdown").offset({ top: top_offset_IE, left: left_offset_IE });
}
});
$(".structure_actions_dropdown").mouseleave(function() {
$(this).hide();
if($.browser.msie && $.browser.version == "6.0") {
$("iframe[class='IE_hack']").hide();
}
});
}
});
/* Displays tooltips */
$(document).ready(function() {
// Hide the footnotes from the footer (which are displayed for
// JavaScript-disabled browsers) since the tooltip is sufficient
$(".footnotes").hide();
$(".footnotes span").each(function() {
$(this).children("sup").remove();
});
// The border and padding must be removed otherwise a thin yellow box remains visible
$(".footnotes").css("border", "none");
$(".footnotes").css("padding", "0px");
// Replace the superscripts with the help icon
$("sup[class='footnotemarker']").hide();
$("img[class='footnotemarker']").show();
$("img[class='footnotemarker']").each(function() {
var span_id = $(this).attr("id");
span_id = span_id.split("_")[1];
var tooltip_text = $(".footnotes span[id='footnote_" + span_id + "']").html();
$(this).qtip({
content: tooltip_text,
show: { delay: 0 },
hide: { when: 'unfocus', delay: 0 },
style: { background: '#ffffcc' }
});
});
});

83
js/import.js Normal file
View File

@@ -0,0 +1,83 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the import tab
*
* @version $Id$
*/
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
function changePluginOpts() {
$(".format_specific_options").each(function() {
$(this).hide();
});
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").fadeIn('slow');
if(selected_plugin_name == "csv") {
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
} else {
$("#import_notification").text("");
}
}
/**
* Toggles the hiding and showing of each plugin's options and sets the selected value
* in the plugin dropdown list according to the format of the selected file
*/
function matchFile(fname) {
var fname_array = fname.toLowerCase().split(".");
var len = fname_array.length;
if(len != 0) {
var extension = fname_array[len - 1];
if (extension == "gz" || extension == "bz2" || extension == "zip") {
len--;
}
// Only toggle if the format of the file can be imported
if($("select[name='format'] option[value='" + fname_array[len - 1] + "']").length == 1) {
$("#plugins option:selected").removeAttr("selected");
$("select[name='format'] option[value='" + fname_array[len - 1] + "']").attr('selected', 'selected');
changePluginOpts();
}
}
}
$(document).ready(function() {
// Initially display the options for the selected plugin
changePluginOpts();
// Whenever the selected plugin changes, change the options displayed
$("#plugins").change(function() {
changePluginOpts();
});
$("#input_import_file").change(function() {
matchFile($(this).attr("value"));
});
$("#select_local_import_file").change(function() {
matchFile($(this).attr("value"));
});
/*
* When the "Browse the server" form is clicked or the "Select from the web server upload directory"
* form is clicked, the radio button beside it becomes selected and the other form becomes disabled.
*/
$("#input_import_file").focus(function() {
$("#radio_import_file").attr('checked', 'checked');
$("#radio_local_import_file").removeAttr('checked');
});
$("#select_local_import_file").focus(function() {
$("#radio_local_import_file").attr('checked', 'checked');
$("#radio_import_file").removeAttr('checked');
});
/**
* Set up the interface for Javascript-enabled browsers since the default is for
* Javascript-disabled browsers
*/
$("#scroll_to_options_msg").hide();
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 });
$(".format_specific_options h3").remove();
});

15
js/jquery.qtip-1.0.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
$(document).ready(function() {
$('#li_custom_color').show();
// Choosing another id does not work!
$('#colorSelector').ColorPicker({
$("input[type='submit'][name='custom_color_choose']").ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);

View File

@@ -187,6 +187,11 @@ function clear_fast_filter() {
$(document).ready(function(){
/* Display filter */
$('#NavFilter').css('display', 'inline');
$('input[id="fast_filter"]').focus(function() {
if($(this).attr("value") === "filter tables by name") {
clear_fast_filter();
}
});
$('#clear_fast_filter').click(clear_fast_filter);
$('#fast_filter').focus(function (evt) {evt.target.select();});
$('#fast_filter').keyup(function (evt) {fast_filter(evt.target.value);});

View File

@@ -1,212 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays the Tooltips (hints), if we have some
* 2005-01-20 added by Michael Keck (mkkeck)
*
* @version $Id$
*/
/**
*
*/
var ttXpos = 0, ttYpos = 0;
var ttXadd = 10, ttYadd = -10;
var ttDisplay = 0, ttHoldIt = 0;
// Check if browser does support dynamic content and dhtml
if (document.getElementById) {
// DOM-compatible browsers
var ttDOM = 1;
} else {
// the old Netscape 4
var ttNS4 = (document.layers) ? 1 : 0;
// browser wich uses document.all
var ttIE4 = (document.all) ? 1 : 0;
}
var myTooltipContainer = null;
/**
* initialize tooltip
*/
function PMA_TT_init()
{
// get all 'light bubbles' on page
var tooltip_icons = window.parent.getElementsByClassName('footnotemarker', document, 'sup');
var tooltip_count = tooltip_icons.length;
if (tooltip_count < 1) {
// no 'bubbles' found
return;
}
// insert tooltip container
myTooltipContainer = document.createElement("div");
myTooltipContainer.id = 'TooltipContainer';
window.parent.addEvent(myTooltipContainer, 'mouseover', holdTooltip);
window.parent.addEvent(myTooltipContainer, 'mouseout', swapTooltip);
document.body.appendChild(myTooltipContainer);
// capture mouse-events
for (i = 0; i < tooltip_count; i++) {
window.parent.addEvent(tooltip_icons[i], 'mousemove', mouseMove);
window.parent.addEvent(tooltip_icons[i], 'mouseover', pmaTooltip);
window.parent.addEvent(tooltip_icons[i], 'mouseout', swapTooltip);
}
}
/**
* init the tooltip and write the text into it
*
* @param string theText tooltip content
*/
function PMA_TT_setText(theText)
{
if (ttDOM || ttIE4) { // document.getEelementById || document.all
myTooltipContainer.innerHTML = ""; // we should empty it first
myTooltipContainer.innerHTML = theText;
} else if (ttNS4) { // document.layers
var layerNS4 = myTooltipContainer.document;
layerNS4.write(theText);
layerNS4.close();
}
}
/**
* @var integer
*/
var ttTimerID = 0;
/**
* swap the Tooltip // show and hide
*
* @param boolean stat view status
*/
function swapTooltip(stat)
{
if (ttHoldIt != 1) {
if (stat == 'true') {
showTooltip(true);
} else if (ttDisplay) {
ttTimerID = setTimeout("showTooltip(false);", 500);
} else {
showTooltip(true);
}
} else {
if (ttTimerID) {
clearTimeout(ttTimerID);
ttTimerID = 0;
}
showTooltip(true);
}
}
/**
* show / hide the Tooltip
*
* @param boolean stat view status
*/
function showTooltip(stat)
{
if (stat == false) {
if (ttNS4)
myTooltipContainer.visibility = "hide";
else
myTooltipContainer.style.visibility = "hidden";
ttDisplay = 0;
} else {
if (ttNS4)
myTooltipContainer.visibility = "show";
else
myTooltipContainer.style.visibility = "visible";
ttDisplay = 1;
}
}
/**
* hold it, if we create or move the mouse over the tooltip
*/
function holdTooltip()
{
ttHoldIt = 1;
swapTooltip('true');
ttHoldIt = 0;
}
/**
* move the tooltip to mouse position
*
* @param integer posX horiz. position
* @param integer posY vert. position
*/
function moveTooltip(posX, posY)
{
if (ttDOM || ttIE4) {
myTooltipContainer.style.left = posX + "px";
myTooltipContainer.style.top = posY + "px";
} else if (ttNS4) {
myTooltipContainer.left = posX;
myTooltipContainer.top = posY;
}
}
/**
* build the tooltip
* usally called from eventhandler
*
* @param string theText tooltip content
*/
function pmaTooltip(e)
{
var theText = document.getElementById('footnote_' + this.innerHTML).innerHTML;
var plusX = 0, plusY = 0, docX = 0, docY = 0;
var divHeight = myTooltipContainer.clientHeight;
var divWidth = myTooltipContainer.clientWidth;
if (navigator.appName.indexOf("Explorer") != -1) {
// IE ...
if (document.documentElement && document.documentElement.scrollTop) {
plusX = document.documentElement.scrollLeft;
plusY = document.documentElement.scrollTop;
docX = document.documentElement.offsetWidth + plusX;
docY = document.documentElement.offsetHeight + plusY;
} else {
plusX = document.body.scrollLeft;
plusY = document.body.scrollTop;
docX = document.body.offsetWidth + plusX;
docY = document.body.offsetHeight + plusY;
}
} else {
docX = document.body.clientWidth;
docY = document.body.clientHeight;
}
ttXpos = ttXpos + plusX;
ttYpos = ttYpos + plusY;
if ((ttXpos + divWidth) > docX)
ttXpos = ttXpos - (divWidth + (ttXadd * 2));
if ((ttYpos + divHeight) > docY)
ttYpos = ttYpos - (divHeight + (ttYadd * 2));
PMA_TT_setText(theText);
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
holdTooltip();
}
/**
* register mouse moves
*
* @param event e
*/
function mouseMove(e) {
if ( typeof( event ) != 'undefined' ) {
ttXpos = event.x;
ttYpos = event.y;
} else {
ttXpos = e.pageX;
ttYpos = e.pageY;
}
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
}

View File

@@ -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="">&nbsp;</option>' . "\n";
echo $files;
echo ' </select>' . "\n";
} elseif (empty ($files)) {
echo '<i>There are no files to upload</i>';
}
}
?>

View File

@@ -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,37 @@ $cfg['Export']['latex_structure_label'] = 'tab:@TABLE@-structure';
/**
*
*
* @global boolean $cfg['Export']['sql_structure']
* @global string $cfg['Export']['mediawiki_structure_or_data']
*/
$cfg['Export']['sql_structure'] = true;
$cfg['Export']['mediawiki_structure_or_data'] = 'data';
/**
*
*
* @global boolean $cfg['Export']['sql_data']
* @global string $cfg['Export']['ods_structure_or_data']
*/
$cfg['Export']['sql_data'] = true;
$cfg['Export']['ods_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['pdf_structure_or_data']
*/
$cfg['Export']['pdf_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['php_array_structure_or_data']
*/
$cfg['Export']['php_array_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['sql_structure_or_data']
*/
$cfg['Export']['sql_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1504,7 +1546,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 +1576,6 @@ $cfg['Export']['sql_dates'] = false;
*/
$cfg['Export']['sql_relation'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_columns']
*/
$cfg['Export']['sql_columns'] = true;
/**
*
*
@@ -1576,13 +1611,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 +1642,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 +1660,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 +1715,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 +1780,7 @@ $cfg['Import']['csv_replace'] = false;
*
* @global string $cfg['Import']['csv_terminated']
*/
$cfg['Import']['csv_terminated'] = ';';
$cfg['Import']['csv_terminated'] = ',';
/**
*

View File

@@ -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,115 +62,198 @@ 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>
<div class="exportoptions" id="header">
<h2>
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_export.png" alt="export" />
<?php
/*
* this table is needed to fix rendering in Opera <= 9 and Safari <= 2
* normaly just the two fieldset would have float: left
*/
if($export_type == 'server') {
echo __('Exporting databases in the current server');
} elseif($export_type == 'database') {
echo __('Exporting tables in the database "' . $db . '"');
} else {
echo __('Exporting rows in the table "' . $table . '"');
}?>
</h2>
</div>
<div class="exportoptions" id="quick_or_custom">
<h3><?php echo __('Export Method:'); ?></h3>
<ul>
<li>
<?php echo '<input type="radio" name="quick_or_custom" value="quick" id="radio_quick_export"';
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>
<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;
}
?>
<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>
</td><td>
<div id="div_container_sub_exportoptions">
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
</div>
</td></tr></table>
<?php if (strlen($table) && ! isset($num_tables) && ! PMA_Table::isMerge($db, $table)) { ?>
<div class="formelementrow">
<?php
<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 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 '<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" />';
echo '<label for="radio_allrows_1">' . __('Dump all rows') . '</label>';
?>
} 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 } ?>
</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>
<?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 />
<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 } ?>
<label for="filename_template">
<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');
echo __('File name template:');
$trans = new PMA_Message;
$trans->addMessage('@SERVER@/');
$trans->addMessage('@SERVER@ will become the');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('@DATABASE@/');
$trans->addMessage(', @DB@ will become the');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage('@TABLE@/');
$trans->addMessage(', @TABLE@ will become the');
$trans->addString(__('table name'));
}
}
$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 = 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);
echo PMA_showHint($message);
?>
</label>:
</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']);
@@ -183,89 +273,91 @@ echo PMA_pluginGetJavascript($export_list);
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 echo __('use this for future exports'); ?></label>
</li>
<?php
// charset of file
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo ' <label for="select_charset_of_file">'
echo ' <li><label for="select_charset_of_file" class="desc">'
. __('Character set of the file:') . '</label>' . "\n";
reset($cfg['AvailableCharsets']);
echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
echo '<option value="' . $temp_charset . '"';
if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
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>';
echo '</select></li>';
} // end if
?>
</div>
<?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) { ?>
<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>
<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) { ?>
<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>
<option value="gzip" <?php echo ($selected_compression == "gzip") ? 'selected="selected"' : ''; ?>><?php echo __('gzipped'); ?></option>
<?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>
<option value="bzip" <?php echo ($selected_compression == "bzip") ? 'selected="selected"' : ''; ?>><?php echo __('bzipped'); ?></option>
<?php } ?>
</div>
</select>
</li>
<?php } else { ?>
<input type="hidden" name="compression" value="none" />
<input type="hidden" name="compression" value="<?php echo $selected_compression; ?>" />
<?php } ?>
</fieldset>
</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>
<div class="exportoptions" id="format">
<h3><?php echo __('Format:'); ?></h3>
<?php echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?>
</div>
<div class="exportoptions" id="format_specific_opts">
<h3><?php echo __('Format-Specific Options:'); ?></h3>
<p class="no_js_msg" id="scroll_to_options_msg">Scroll down to fill in the options for the selected format and ignore the options for other formats.</p>
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
</div>
<?php if (function_exists('PMA_set_enc_form')) { ?>
<!-- Encoding setting form appended by Y.Kawada -->
<!-- Japanese encoding setting -->
<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>

View File

@@ -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,67 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
echo PMA_generate_common_hidden_inputs($db, $table, 1);
}
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
echo PMA_pluginGetJavascript($import_list);
?>
<fieldset class="options">
<legend><?php echo __('File to import'); ?></legend>
<div class="exportoptions" id="header">
<h2>
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_import.png" alt="import" />
<?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>
<?php
if($import_type == 'server') {
echo __('Importing into the current server');
} elseif($import_type == 'database') {
echo __('Importing into the database "' . $db . '"');
} else {
echo __('Importing into the table "' . $table . '"');
}?>
</h2>
</div>
<div class="importoptions">
<h3><?php echo __('File to Import:'); ?></h3>
<?php
// zip, gzip and bzip2 encode features
$compressions = array();
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
$compressions[] = 'gzip';
}
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
$compressions[] = 'bzip2';
}
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
$compressions[] = 'zip';
}
// We don't have show anything about compression, when no supported
if ($compressions != array()) {
printf(__('<div class="formelementrow" id="compression_info">File may be compressed (%s) or uncompressed.<br />A compressed file\'s name must end in <b>.[format].[compression]</b>. Example: <b>.sql.zip</b></div>'), implode(", ", $compressions));
}?>
<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();
}
if (!empty($cfg['UploadDir'])) {
$extensions = '';
foreach ($import_list as $key => $val) {
if (!empty($extensions)) {
$extensions .= '|';
}
$extensions .= $val['extension'];
}
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
$files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
echo '<div class="formelementrow">' . "\n";
if ($files === FALSE) {
PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
} elseif (!empty($files)) {
echo "\n";
echo ' <i>' . __('Or') . '</i><br/><label for="select_local_import_file">' . __('web server upload directory') . '</label>&nbsp;: ' . "\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="">&nbsp;</option>' . "\n";
echo $files;
echo ' </select>' . "\n";
}
echo '</div>' . "\n";
} else if (!empty($cfg['UploadDir'])) {
PMA_selectUploadFile($import_list, $cfg['UploadDir']);
} // end if (web-server upload directory)
?>
</div>
// charset of file
echo '<div class="formelementrow">' . "\n";
<div class="formelementrow" id="charaset_of_file">
<?php // charset of file
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
reset($cfg['AvailableCharsets']);
@@ -190,32 +197,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 +214,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 +234,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(' ');
}
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>

View File

@@ -32,8 +32,10 @@ if (isset($plugin_list)) {
'extension' => 'cs',
'mime_type' => 'text/cs',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'select', 'name' => 'format', 'text' => __('Format'), 'values' => $CG_FORMATS),
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'),
);

View File

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

View File

@@ -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'),
);

View File

@@ -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'),
);

View File

@@ -16,10 +16,12 @@ if (isset($plugin_list)) {
'extension' => 'json',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array(
'type' => 'hidden',
'name' => 'data',
),
array('type' => 'end_group')
),
'options_text' => 'strOptions',
);

View File

@@ -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 {
/**

View File

@@ -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'),
);

View File

@@ -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'),
);

View File

@@ -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'] = '';

View File

@@ -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'),
);

View File

@@ -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'),
);

View File

@@ -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');
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>'));
}
/* Structure options */
/* 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');
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';
$drop_clause = '<code>DROP TABLE / VIEW / PROCEDURE / FUNCTION</code>';
if (PMA_MYSQL_INT_VERSION > 50100) {
$drop_clause .= ' / EVENT';
$drop_clause .= '<code> / EVENT</code>';
}
}
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf(__('Add %s'), $drop_clause));
array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf(__('%s'), $drop_clause));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'if_not_exists', 'text' => sprintf(__('Add %s'), 'IF NOT EXISTS'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'auto_increment', 'text' => __('Add AUTO_INCREMENT value'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'backquotes', 'text' => __('Enclose table and column names with backquotes'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'procedure_function', 'text' => sprintf(__('Add %s'), 'CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT' : '')));
array('type' => 'bool', 'name' => 'procedure_function', 'text' => sprintf(__('%s'), '<code>CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT</code>' : '</code>')));
/* MIME stuff etc. */
/* begin CREATE TABLE statements*/
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'text' => __('Add into comments'));
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' => 'dates', 'text' => __('Creation/Update/Check dates'));
if (!empty($GLOBALS['cfgRelation']['relation'])) {
array('type' => 'bool', 'name' => 'if_not_exists', 'text' => __('<code>IF NOT EXISTS</code>'));
$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'));
}
$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>'));
/* Data */
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'end_group');
}
/* end Structure options */
/* begin Data options */
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Complete inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_complete-insert-option'));
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
/* begin SQL statements */
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'extended', 'text' => __('Extended inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_extended-insert-option'));
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Instead of <code>INSERT</code> statements, use:')));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'delayed', 'text' => __('<code>INSERT DELAYED</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert_delayed'));
$plugin_list['sql']['options'][] =
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 /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)</code>'),
'extended' => __('insert multiple rows in every <code>INSERT</code> statement<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
'both' => __('both of the above<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
'none' => __('neither of the above<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code>')));
$plugin_list['sql']['options'][] =
array('type' => 'end_subgroup');
/* Max length of query */
$plugin_list['sql']['options'][] =
array('type' => 'text', 'name' => 'max_query_size', 'text' => __('Maximal length of created query'));
/* Dump binary columns in hexadecimal */
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'delayed', 'text' => __('Use delayed inserts'));
array('type' => 'bool', 'name' => 'hex_for_blob', 'text' => __('Dump binary columns in hexadecimal notation <i>(for example, "abc" becomes 0x616263)</i>'));
/* Dump time in UTC */
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Use ignore inserts'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'hex_for_blob', 'text' => __('Use hexadecimal for BLOB'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'utc_time', 'text' => __('Export time in UTC'));
$plugin_list['sql']['options'][] =
array('type' => 'select', 'name' => 'type', 'text' => __('Export type'), 'values' => array('INSERT' => 'INSERT', 'UPDATE' => 'UPDATE', 'REPLACE' => 'REPLACE'));
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
array('type' => 'bool', 'name' => 'utc_time', 'text' => __('Dump TIMESTAMP columns in UTC <i>(enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)</i>'));
$plugin_list['sql']['options'][] = array('type' => 'end_group');
/* end Data options */
}
} else {
@@ -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 {

View File

@@ -18,21 +18,14 @@ 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'),
);

View File

@@ -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'),
);

View File

@@ -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'),
);

View File

@@ -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 {
/**

View File

@@ -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'),
);

View File

@@ -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 />';

View File

@@ -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

View File

@@ -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];
}

View File

@@ -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)
);

View File

@@ -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'),
);

View File

@@ -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'),
);

View File

@@ -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'),
);
}

View File

@@ -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'),
);

View File

@@ -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'),
);

View File

@@ -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 */
. $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

View File

@@ -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'] == 'radio') {
$default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']);
foreach($opt['values'] as $key => $val) {
$ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $opt['name'] . '" value="' . $key
. '" id="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '"';
if($key == $default) {
$ret .= 'checked="checked"';
}
$ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">'
. PMA_getString($val) . '</label></li>';
}
} elseif ($opt['type'] == 'hidden') {
$ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />';
} elseif ($opt['type'] == 'bgroup') {
$ret .= '<fieldset><legend>';
/* No checkbox without name */
if (!empty($opt['name'])) {
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']);
if (isset($opt['force'])) {
/* Same code is also few lines higher, update both if needed */
$ret .= ' onclick="if (!this.checked &amp;&amp; '
. '(!document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\') '
. '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\').checked)) '
. 'return false; else return true;"';
$ret .= '<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 .= ' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>';
$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 .= PMA_getString($opt['text']);
$ret .= '>';
}
$ret .= '</legend>';
} elseif ($opt['type'] == 'egroup') {
$ret .= '</fieldset>';
} 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;
}
?>

View File

@@ -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 {

View File

@@ -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 echo __('Values for the column "' . (isset($row['Field']) ? urlencode($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>

View File

@@ -60,11 +60,10 @@ if ($server > 0) {
echo '<div id="maincontainer">' . "\n";
echo '<div id="main_pane_left">';
if ($server > 0
|| (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)) {
echo '<div class="group">';
echo '<h2>' . __('Actions') . '</h2>';
echo '<h2>' . __('General Settings') . '</h2>';
echo '<ul>';
/**
@@ -90,52 +89,27 @@ if ($server > 0
PMA_printListItem(__('Change password'), 'li_change_password',
'./user_password.php?' . $common_url_query);
}
$http_logout = ($cfg['Server']['auth_type'] == 'http')
? '<a href="./Documentation.html#login_bug" target="documentation">'
. ($cfg['ReplaceHelpImg'] ? '<img class="icon" src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" alt="Info" />' : '(*)') . '</a>'
: '';
PMA_printListItem('<strong>' . __('Log out') . '</strong> ' . $http_logout,
'li_log_out',
'./index.php?' . $common_url_query . '&amp;old_usr=' . urlencode($PHP_AUTH_USER), null, '_parent');
} // end if
} // end of if ($server > 0)
echo '</ul>';
echo '</div>';
}
if ($server > 0) {
echo '<div class="group">';
echo '<h2>MySQL ' . $short_server_info . '</h2>';
echo '<ul>' . "\n";
if ($cfg['ShowCreateDb']) {
echo '<li id="li_create_database">';
require './libraries/display_create_database.lib.php';
echo '</li>' . "\n";
}
echo ' <li id="li_select_mysql_collation">';
echo ' <form method="post" action="index.php" target="_parent">' . "\n"
. PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
. ' <label for="select_collation_connection">' . "\n"
. ' ' . __('MySQL connection collation') . ': ' . "\n"
. ' ' . __('MySQL connection collation') . "\n"
// put the doc link in the form so that it appears on the same line
. PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . ': ' . "\n"
. ' </label>' . "\n"
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
. ' <noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n"
// put the doc link in the form so that it appears on the same line
. PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n"
. ' </form>' . "\n"
. ' </li>' . "\n";
} // end of if ($server > 0)
echo '</ul>';
echo '</div>';
}
echo '<div class="group">';
echo '<h2>' . __('Interface') . '</h2>';
echo '<h2>' . __('Appearance Settings') . '</h2>';
echo ' <ul>';
// Displays language selection combo
@@ -155,14 +129,13 @@ if ($GLOBALS['cfg']['ThemeManager']) {
// see js/main_custom_color.js
echo '<li id="li_custom_color" class="hide">';
echo PMA_escapeJsString(__('Custom color')) . ': ';
echo PMA_escapeJsString(__('Background color')) . ': ';
echo '<input type="submit" name="custom_color_choose" value="' . __('Choose...') . '" />';
echo '<form name="colorform" id="colorform" method="post" action="index.php" target="_parent">';
echo PMA_generate_common_hidden_inputs();
echo '<input type="hidden" id="custom_color" name="custom_color" value="" />';
echo '<input type="submit" name="custom_color_reset" value="' . __('Reset') . '" />';
echo '</form>';
echo '<div id="colorSelector">';
echo '</div>';
echo '</li>';
}
echo '<li id="li_select_fontsize">';

View File

@@ -229,18 +229,13 @@ if (! $GLOBALS['server']) {
echo '<noscript>' . "\n"
.'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n"
.'</noscript>' . "\n"
.'</form>' . "\n";
.'</form>' . "\n"
. '</div>' . "\n";
} else {
if (! empty($db)) {
echo '<div id="databaseList">' . "\n";
}
echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
}
$_url_params = array('pos' => $pos);
PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
if (! empty($db)) {
echo '</div>' . "\n";
}
}
?>
@@ -294,7 +289,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
if ($table_count) {
?>
<span id="NavFilter">
<input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" />
<input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" value="filter tables by name" />
<span id="clear_fast_filter" title="<?php echo __('Clear'); ?>">X</span>
</span>
<?php

View File

@@ -10,6 +10,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'export.js';
/**
* Displays the links
*/
@@ -20,16 +22,28 @@ $checkall_url = 'server_export.php?'
. PMA_generate_common_url()
. '&amp;goto=db_export.php';
$multi_values = '<div align="center">';
$multi_values = '<div align="left">';
$multi_values .= '<a href="' . $checkall_url . '&amp;selectall=1" onclick="setSelectOptions(\'dump\', \'db_select[]\', true); return false;">' . __('Select All') . '</a>
/
<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'db_select[]\', false); return false;">' . __('Unselect All') . '</a><br />';
$multi_values .= '<select name="db_select[]" size="10" multiple="multiple">';
$multi_values .= '<select name="db_select[]" id="db_select" size="10" multiple="multiple">';
$multi_values .= "\n";
// Check if the selected databases are defined in $_GET (from clicking Back button on export.php)
if(isset($_GET['db_select'])) {
$_GET['db_select'] = urldecode($_GET['db_select']);
$_GET['db_select'] = explode(",", $_GET['db_select']);
}
foreach ($GLOBALS['pma']->databases as $current_db) {
if (!empty($selectall) || (isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))) {
if(isset($_GET['db_select'])) {
if(in_array($current_db, $_GET['db_select'])) {
$is_selected = ' selected="selected"';
} else {
$is_selected = '';
}
} elseif (!empty($selectall) || (isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))) {
$is_selected = ' selected="selected"';
} else {
$is_selected = '';
@@ -38,7 +52,7 @@ foreach ($GLOBALS['pma']->databases as $current_db) {
$multi_values .= ' <option value="' . $current_db . '"' . $is_selected . '>' . $current_db . '</option>' . "\n";
} // end while
$multi_values .= "\n";
$multi_values .= '</select></div><br />';
$multi_values .= '</select></div>';
$export_type = 'server';
require_once './libraries/display_export.lib.php';

View File

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

View File

@@ -91,6 +91,7 @@ $cfg_db['Export']['format'] = array('codegen', 'csv', 'excel', 'htmlexcel',
'yaml');
$cfg_db['Export']['compression'] = array('none', 'zip', 'gzip', 'bzip2');
$cfg_db['Export']['charset'] = array_merge(array(''), $GLOBALS['cfg']['AvailableCharsets']);
$cfg_db['Export']['method'] = array('quick', 'custom', 'custom-no-form');
/**
* Config options which will be placed in config file even if they are set

View File

@@ -170,6 +170,7 @@ $forms['Import_defaults'] = array('Import' => array(
'skip_queries'));
$forms['Export_defaults'] = array('Export' => array(
'format',
'method',
'compression',
'asfile',
'charset',

View File

@@ -83,6 +83,7 @@ $strSetupExport_file_template_database_name = __('Database name template');
$strSetupExport_file_template_server_name = __('Server name template');
$strSetupExport_file_template_table_name = __('Table name template');
$strSetupExport_format_name = __('Format');
$strSetupExport_method_name = __('Method');
$strSetupExport_onserver_name = __('Save on server');
$strSetupExport_onserver_overwrite_name = __('Overwrite existing file(s)');
$strSetupExport_remember_file_template_name = __('Remember file name template');

View File

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

View File

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

View File

@@ -158,6 +158,18 @@ $titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), tru
$titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), true);
$titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true);
// hidden action titles (image and string)
$hidden_titles = array();
$hidden_titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), false, true);
$hidden_titles['Primary'] = PMA_getIcon('b_primary.png', __('Primary'), false, true);
$hidden_titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Primary'), false, true);
$hidden_titles['Index'] = PMA_getIcon('b_index.png', __('Index'), false, true);
$hidden_titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Index'), false, true);
$hidden_titles['Unique'] = PMA_getIcon('b_unique.png', __('Unique'), false, true);
$hidden_titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), false, true);
$hidden_titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Fulltext'), false, true);
$hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), false, true);
/**
* Displays the table structure ('show table' works correct since 3.23.03)
*/
@@ -166,31 +178,40 @@ $titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinc
$i = 0;
?>
<form method="post" action="tbl_structure.php" name="fieldsForm" id="fieldsForm">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<?php echo PMA_generate_common_hidden_inputs($db, $table);
echo '<input type="hidden" name="table_type" value=';
if($db_is_information_schema) {
echo '"information_schema" />';
} else if ($tbl_is_view) {
echo '"view" />';
} else {
echo '"table" />';
} ?>
<table id="tablestructure" class="data">
<thead>
<tr>
<th id="th<?php echo ++$i; ?>"></th>
<th id="th<?php echo ++$i; ?>">#</th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Column'); ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Type'); ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Collation'); ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Attributes'); ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Null'); ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Default'); ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo __('Extra'); ?></th>
<th id="th<?php echo ++$i; ?>" class="column"><?php echo __('Column'); ?></th>
<th id="th<?php echo ++$i; ?>" class="type"><?php echo __('Type'); ?></th>
<th id="th<?php echo ++$i; ?>" class="collation"><?php echo __('Collation'); ?></th>
<th id="th<?php echo ++$i; ?>" class="attributes"><?php echo __('Attributes'); ?></th>
<th id="th<?php echo ++$i; ?>" class="null"><?php echo __('Null'); ?></th>
<th id="th<?php echo ++$i; ?>" class="default"><?php echo __('Default'); ?></th>
<th id="th<?php echo ++$i; ?>" class="extra"><?php echo __('Extra'); ?></th>
<?php if ($db_is_information_schema || $tbl_is_view) { ?>
<th id="th<?php echo ++$i; ?>"><?php echo __('View'); ?></th>
<th id="th<?php echo ++$i; ?>" class="view"><?php echo __('View'); ?></th>
<?php } else { ?>
<th colspan="7" id="th<?php echo ++$i; ?>"><?php echo __('Action'); ?></th>
<th colspan="7" id="th<?php echo ++$i; ?>" class="action"><?php echo __('Action'); ?></th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
unset($i);
// table body
// prepare comments
@@ -227,6 +248,9 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
// for the case ENUM('&#8211;','&ldquo;')
$type = htmlspecialchars($type);
if(strlen($type) > $GLOBALS['cfg']['LimitChars']) {
$type = '<abbr title="full text">' . substr($type, 0, $GLOBALS['cfg']['LimitChars']) . '</abbr>';
}
$type_nowrap = '';
@@ -358,59 +382,63 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
echo '<i>' . _pgettext('None for default','None') . '</i>';
} ?></td>
<td nowrap="nowrap"><?php echo strtoupper($row['Extra']); ?></td>
<td align="center">
<td align="center" class="browse">
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('SELECT COUNT(*) AS ' . PMA_backquote(__('Rows')) . ', ' . PMA_backquote($row['Field']) . ' FROM ' . PMA_backquote($table) . ' GROUP BY ' . PMA_backquote($row['Field']) . ' ORDER BY ' . PMA_backquote($row['Field'])); ?>">
<?php echo $titles['BrowseDistinctValues']; ?></a>
</td>
<?php if (! $tbl_is_view && ! $db_is_information_schema) { ?>
<td align="center">
<td align="center" class="edit">
<a href="tbl_alter.php?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
<?php echo $titles['Change']; ?></a>
</td>
<td align="center">
<td align="center" class="drop">
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&amp;cpurge=1&amp;purgekey=<?php echo urlencode($row['Field']); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('Column %s has been dropped'), htmlspecialchars($row['Field']))); ?>"
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
<?php echo $titles['Drop']; ?></a>
</td>
<td align="center">
<td align="center" class="primary">
<?php
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type || ($primary && $primary->hasColumn($field_name))) {
echo $titles['NoPrimary'] . "\n";
$primary_enabled = false;
} else {
echo "\n";
?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ($primary ? ' DROP PRIMARY KEY,' : '') . ' ADD PRIMARY KEY(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('A primary key has been added on %s'), htmlspecialchars($row['Field']))); ?>"
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table) . ($primary ? ' DROP PRIMARY KEY,' : ''); ?> ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
<?php echo $titles['Primary']; ?></a>
<?php
<?php $primary_enabled = true;
}
echo "\n";
?>
</td>
<td align="center">
<td align="center" class="unique">
<?php
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type || isset($columns_with_unique_index[$field_name])) {
echo $titles['NoUnique'] . "\n";
$unique_enabled = false;
} else {
echo "\n";
?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('An index has been added on %s'), htmlspecialchars($row['Field']))); ?>">
<?php echo $titles['Unique']; ?></a>
<?php
<?php $unique_enabled = true;
}
echo "\n";
?>
</td>
<td align="center">
<td align="center" class="index">
<?php
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type) {
echo $titles['NoIndex'] . "\n";
$index_enabled = false;
} else {
echo "\n";
?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('An index has been added on %s'), htmlspecialchars($row['Field']))); ?>">
<?php echo $titles['Index']; ?></a>
<?php
$index_enabled = true;
}
echo "\n";
?>
@@ -421,22 +449,88 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
&& (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char'))) {
echo "\n";
?>
<td align="center" nowrap="nowrap">
<td align="center" nowrap="nowrap" class="fulltext">
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('An index has been added on %s'), htmlspecialchars($row['Field']))); ?>">
<?php echo $titles['IdxFulltext']; ?></a>
<?php $fulltext_enabled = true; ?>
</td>
<?php
} else {
echo "\n";
?>
<td align="center" nowrap="nowrap">
<td align="center" nowrap="nowrap" class="fulltext">
<?php echo $titles['NoIdxFulltext'] . "\n"; ?>
<?php $fulltext_enabled = false; ?>
</td>
<?php
} // end if... else...
echo "\n";
} // end if (! $tbl_is_view && ! $db_is_information_schema)
?>
<td class="more_opts" id="more_opts<?php echo $rownum; ?>">
More <img src="<?php echo $pmaThemeImage . 'more.png'; ?>" alt="show more actions" />
<div class="structure_actions_dropdown" id="row_<?php echo $rownum; ?>">
<div class="action_browse">
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('SELECT COUNT(*) AS ' . PMA_backquote(__('Rows')) . ', ' . PMA_backquote($row['Field']) . ' FROM ' . PMA_backquote($table) . ' GROUP BY ' . PMA_backquote($row['Field']) . ' ORDER BY ' . PMA_backquote($row['Field'])); ?>">
<?php echo $hidden_titles['BrowseDistinctValues']; ?>
</a>
</div>
<div class="action_primary">
<?php
if(isset($primary_enabled)) {
if($primary_enabled) { ?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ($primary ? ' DROP PRIMARY KEY,' : '') . ' ADD PRIMARY KEY(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('A primary key has been added on %s'), htmlspecialchars($row['Field']))); ?>"
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table) . ($primary ? ' DROP PRIMARY KEY,' : ''); ?> ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
<?php echo $hidden_titles['Primary']; ?>
</a>
<?php
} else {
echo $hidden_titles['NoPrimary'];
}
} ?>
</div>
<div class="action_unique">
<?php
if(isset($unique_enabled)) {
if($unique_enabled) { ?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('An index has been added on %s'), htmlspecialchars($row['Field']))); ?>">
<?php echo $hidden_titles['Unique']; ?>
</a>
<?php
} else {
echo $hidden_titles['NoUnique'];
}
} ?>
</div>
<div class="action_index">
<?php
if(isset($index_enabled)) {
if($index_enabled) { ?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('An index has been added on %s'), htmlspecialchars($row['Field']))); ?>">
<?php echo $hidden_titles['Index']; ?>
</a>
<?php
} else {
echo $hidden_titles['NoIndex'];
}
} ?>
</div>
<div class="action_fulltext">
<?php
if(isset($fulltext_enabled)) {
if($fulltext_enabled) { ?>
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf(__('An index has been added on %s'), htmlspecialchars($row['Field']))); ?>">
<?php echo $hidden_titles['IdxFulltext']; ?>
</a>
<?php
} else {
echo $hidden_titles['NoIdxFulltext'];
}
} ?>
</div>
</div>
</td>
</tr>
<?php
unset($field_charset);
@@ -558,6 +652,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
?>
<input type="submit" value="<?php echo __('Go'); ?>" />
</form>
<iframe class="IE_hack" scrolling="no"></iframe>
<hr />
<?php
}

View File

@@ -56,11 +56,12 @@ pre, tt, code {
font-size: 110%;
}
a:link,
a, a:link,
a:visited,
a:active {
text-decoration: none;
color: #333399;
cursor: pointer;
}
a:hover {
@@ -232,7 +233,8 @@ table tr.marked {
/* hovered items */
.odd:hover,
.even:hover,
.hover {
.hover,
.structure_actions_dropdown {
background: <?php echo $GLOBALS['cfg']['BrowsePointerBackground']; ?>;
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
@@ -373,11 +375,16 @@ img.lightbulb {
}
/* leave some space between icons and text */
.icon {
.icon, img.footnotemarker {
vertical-align: middle;
margin-right: 0.3em;
margin-left: 0.3em;
}
img.footnotemarker {
display: none;
}
/* no extra space in table cells */
td .icon {
margin: 0;
@@ -402,7 +409,8 @@ div.error h1 {
div.success,
div.notice,
div.warning,
div.error {
div.error,
div.footnotes {
margin: 0.3em 0 0 0;
border: 2px solid;
width: 90%;
@@ -443,12 +451,13 @@ div.success {
border-color: #00FF00;
}
.notice {
.notice, .footnotes {
color: #000000;
background-color: #FFFFDD;
}
h1.notice,
div.notice {
div.notice,
div.footnotes {
border-color: #FFD700;
<?php if ($GLOBALS['cfg']['ErrorIconic']) { ?>
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_notice.png);
@@ -1050,7 +1059,7 @@ div#queryboxcontainer div#bookmarkoptions {
}
#maincontainer ul {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>item_<?php echo $GLOBALS['text_dir']; ?>.png);
list-style-type: disc;
vertical-align: middle;
}
@@ -1070,8 +1079,7 @@ li#li_select_lang {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_lang.png);
}
li#li_select_mysql_collation,
li#li_select_mysql_charset {
li#li_select_mysql_collation {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_asci.png);
}
@@ -1079,11 +1087,6 @@ li#li_select_theme{
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_theme.png);
}
li#li_server_info,
li#li_server_version{
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_host.png);
}
li#li_user_info{
/* list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_rights.png); */
}
@@ -1132,19 +1135,6 @@ li#li_log_out {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_loggoff.png);
}
li#li_pma_docs,
li#li_pma_wiki {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>b_docs.png);
}
li#li_phpinfo {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>php_sym.png);
}
li#li_pma_homepage {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>b_home.png);
}
li#li_mysql_privilegs{
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_rights.png);
}
@@ -1240,6 +1230,10 @@ label.desc {
float: <?php echo $left; ?>;
}
label.desc sup {
position: absolute;
}
code.sql, div.sqlvalidate {
display: block;
padding: 0.3em;
@@ -1271,7 +1265,7 @@ code.sql, div.sqlvalidate {
}
.group h2 {
background-color: <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
background: <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
padding: 0.1em 0.3em;
margin-top: 0;
}
@@ -1282,9 +1276,11 @@ code.sql, div.sqlvalidate {
}
#li_select_server {
padding-bottom: 0.3em;
border-bottom: 0.3em solid <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
margin-bottom: 0.3em;
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_host.png);
}
#list_server {
list-style-image: none;
}
/**
@@ -1334,3 +1330,170 @@ table#serverconnection_trg_local {
*/
.invalid_value
{background:#F00;}
/**
* Export and Import styles
*/
.exportoptions h3, .importoptions h3 {
border-bottom: 1px #999999 solid;
}
.exportoptions ul, .importoptions ul, .format_specific_options ul {
list-style-type: none;
margin-bottom: 15px;
}
.exportoptions li, .importoptions li {
margin: 7px;
}
.exportoptions label, .importoptions label, .exportoptions p, .importoptions p {
margin: 5px;
float: none;
}
#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{
float: left;
width: 15em;
}
.exportoptions, .importoptions {
margin: 20px 30px 30px 10px
}
.exportoptions #buttonGo, .importoptions #buttonGo {
padding: 5px 30px;
-moz-border-radius: 11px;
-webkit-border-radius: 11px;
border-radius: 11px;
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
background: -moz-linear-gradient(top, #ffffff, #cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc');
border: 1px solid #444444;
cursor: pointer;
}
.format_specific_options h3 {
margin: 10px 0px 0px 10px;
border: 0px;
}
.format_specific_options {
border: 1px solid #999999;
margin: 7px 0px;
padding: 3px;
}
p.desc {
margin: 5px;
}
/**
* Export styles only
*/
select#db_select, select#table_select {
width: 400px;
}
.export_sub_options {
margin: 20px 0px 0px 30px;
}
.export_sub_options h4 {
border-bottom: 1px #999999 solid;
}
#quick_or_custom, #output_quick_export {
display: none;
}
/**
* Import styles only
*/
.importoptions #import_notification {
margin: 10px 0px;
font-style: italic;
}
input#input_import_file {
margin: 5px;
}
.formelementrow {
margin: 5px 0px 5px 0px;
}
/**
* ENUM/SET editor styles
*/
p.enum_notice {
margin: 5px 2px;
font-size: 80%;
}
#enum_editor {
display: none;
position: fixed;
_position: absolute; /* hack for IE */
z-index: 101;
overflow: auto;
}
#enum_editor_no_js {
margin: auto auto;
}
#enum_editor, #enum_editor_no_js {
width: 50%;
height: 80%;
background: #D0DCE0;
padding: 15px;
}
#popup_background {
display: none;
position: fixed;
_position: absolute; /* hack for IE */
width: 100%;
height: 100%;
top: 0;
left: 0;
background: #000;
z-index: 100;
}
a.close_enum_editor {
float: right;
}
#enum_editor #values, #enum_editor_no_js #values {
margin: 15px 0px;
}
#enum_editor #values input, #enum_editor_no_js #values input {
margin: 5px 0px;
float: top;
width: 100%;
}
#enum_editor input, #enum_editor_no_js input {
float: bottom;
}
#enum_editor_output {
margin-top: 50px;
}
/**
* Table structure styles
*/
.structure_actions_dropdown {
position: absolute;
padding: 3px;
display: none;
}
td.more_opts {
display: none;
white-space: nowrap;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

View File

@@ -76,7 +76,7 @@ $GLOBALS['cfg']['FontFamilyFixed'] = 'monospace';
// border
$GLOBALS['cfg']['Border'] = 0;
// table header and footer color
$GLOBALS['cfg']['ThBackground'] = '#ff9900 url(' . $_SESSION['PMA_Theme']->getImgPath() . 'tbl_th.png) repeat-x top';
$GLOBALS['cfg']['ThBackground'] = '#ff9900 url("' . $_SESSION['PMA_Theme']->getImgPath() . 'tbl_th.png") repeat-x top';
// table header and footer background
$GLOBALS['cfg']['ThColor'] = '#000000';
// table data row background

View File

@@ -31,6 +31,8 @@ body {
margin: 0.5em;
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
background: <?php echo (isset($_SESSION['tmp_user_values']['custom_color']) ? $_SESSION['tmp_user_values']['custom_color'] : $GLOBALS['cfg']['MainBackground']); ?>;
width: 100%;
height: 100%;
}
<?php if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>
@@ -52,11 +54,12 @@ h3 {
font-weight: bold;
}
a:link,
a, a:link,
a:visited,
a:active {
text-decoration: none;
color: #0000FF;
cursor: pointer;
}
a:hover {
@@ -208,7 +211,8 @@ table tr.marked {
/* hovered items */
.odd:hover,
.even:hover,
.hover {
.hover,
.structure_actions_dropdown {
background: <?php echo $GLOBALS['cfg']['BrowsePointerBackground']; ?>;
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
@@ -350,11 +354,16 @@ img.lightbulb {
}
/* leave some space between icons and text */
.icon {
.icon, img.footnotemarker {
vertical-align: middle;
margin-right: 0.3em;
margin-left: 0.3em;
}
img.footnotemarker {
display: none;
}
/* no extra space in table cells */
td .icon {
margin: 0;
@@ -379,7 +388,8 @@ div.error h1 {
div.success,
div.notice,
div.warning,
div.error {
div.error,
div.footnotes {
margin: 0.3em 0 0 0;
border: 2px solid;
<?php if ($GLOBALS['cfg']['ErrorIconic']) { ?>
@@ -419,12 +429,13 @@ div.success {
border-color: #00FF00;
}
.notice {
.notice, .footnotes {
color: #000000;
background-color: #FFFFDD;
}
h1.notice,
div.notice {
div.notice,
div.footnotes {
border-color: #FFD700;
<?php if ($GLOBALS['cfg']['ErrorIconic']) { ?>
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_notice.png);
@@ -512,6 +523,7 @@ fieldset.confirmation legend {
<?php } ?>
<?php } ?>
}
/* end messageboxes */
@@ -998,12 +1010,12 @@ div#queryboxcontainer div#bookmarkoptions {
}
#maincontainer ul {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>item_<?php echo $GLOBALS['text_dir']; ?>.png);
list-style-type: disc;
vertical-align: middle;
}
#maincontainer li {
margin-bottom: 0.3em;
margin: 0.2em 0em;
}
/* END main page */
@@ -1018,8 +1030,7 @@ li#li_select_lang {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_lang.png);
}
li#li_select_mysql_collation,
li#li_select_mysql_charset {
li#li_select_mysql_collation {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_asci.png);
}
@@ -1027,11 +1038,6 @@ li#li_select_theme{
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_theme.png);
}
li#li_server_info,
li#li_server_version{
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_host.png);
}
li#li_user_info{
/* list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_rights.png); */
}
@@ -1080,19 +1086,6 @@ li#li_log_out {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_loggoff.png);
}
li#li_pma_docs,
li#li_pma_wiki {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>b_docs.png);
}
li#li_phpinfo {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>php_sym.png);
}
li#li_pma_homepage {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>b_home.png);
}
li#li_mysql_privilegs{
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_rights.png);
}
@@ -1192,6 +1185,10 @@ label.desc {
float: <?php echo $left; ?>;
}
label.desc sup {
position: absolute;
}
code.sql, div.sqlvalidate {
display: block;
padding: 0.3em;
@@ -1223,7 +1220,7 @@ code.sql, div.sqlvalidate {
}
.group h2 {
background-color: <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
background: <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
padding: 0.1em 0.3em;
margin-top: 0;
}
@@ -1234,9 +1231,11 @@ code.sql, div.sqlvalidate {
}
#li_select_server {
padding-bottom: 0.3em;
border-bottom: 0.3em solid <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
margin-bottom: 0.3em;
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_host.png);
}
#list_server {
list-style-image: none;
}
/**
@@ -1267,3 +1266,190 @@ table#serverconnection_trg_local {
*/
.invalid_value
{background:#F00;}
/**
* Export and Import styles
*/
.exportoptions h3, .importoptions h3 {
border-bottom: 1px #999999 solid;
font-size: 110%;
}
.exportoptions ul, .importoptions ul, .format_specific_options ul {
list-style-type: none;
margin-bottom: 15px;
}
.exportoptions li, .importoptions li {
margin: 7px;
}
.exportoptions label, .importoptions label, .exportoptions p, .importoptions p {
margin: 5px;
float: none;
}
#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{
float: left;
width: 15em;
}
.exportoptions, .importoptions {
margin: 20px 30px 30px 10px
}
.exportoptions #buttonGo, .importoptions #buttonGo {
padding: 5px 30px;
-moz-border-radius: 11px;
-webkit-border-radius: 11px;
border-radius: 11px;
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
background: -moz-linear-gradient(top, #ffffff, #cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc');
border: 1px solid #444444;
cursor: pointer;
}
.format_specific_options h3 {
margin: 10px 0px 0px 10px;
border: 0px;
}
.format_specific_options {
border: 1px solid #999999;
margin: 7px 0px;
padding: 3px;
}
p.desc {
margin: 5px;
}
/**
* Export styles only
*/
select#db_select, select#table_select {
width: 400px;
}
.export_sub_options {
margin: 20px 0px 0px 30px;
}
.export_sub_options h4 {
border-bottom: 1px #999999 solid;
}
.export_sub_options li.subgroup {
display: inline-block;
margin-top: 0;
}
.export_sub_options li {
margin-bottom: 0;
}
#quick_or_custom, #output_quick_export {
display: none;
}
/**
* Import styles only
*/
.importoptions #import_notification {
margin: 10px 0px;
font-style: italic;
}
input#input_import_file {
margin: 5px;
}
.formelementrow {
margin: 5px 0px 5px 0px;
}
/**
* ENUM/SET editor styles
*/
p.enum_notice {
margin: 5px 2px;
font-size: 80%;
}
#enum_editor {
display: none;
position: fixed;
_position: absolute; /* hack for IE */
z-index: 101;
overflow-y: auto;
overflow-x: hidden;
}
#enum_editor_no_js {
margin: auto auto;
}
#enum_editor, #enum_editor_no_js {
background: #D0DCE0;
padding: 15px;
}
#popup_background {
display: none;
position: fixed;
_position: absolute; /* hack for IE6 */
width: 100%;
height: 100%;
top: 0;
left: 0;
background: #000;
z-index: 100;
overflow: hidden;
}
a.close_enum_editor {
float: right;
}
#enum_editor #values, #enum_editor_no_js #values {
margin: 15px 0px;
width: 100%;
}
#enum_editor #values input, #enum_editor_no_js #values input {
margin: 5px 0px;
float: top;
width: 100%;
}
#enum_editor input, #enum_editor_no_js input {
float: bottom;
}
#enum_editor_output {
margin-top: 50px;
}
/**
* Table structure styles
*/
.structure_actions_dropdown {
position: absolute;
padding: 3px;
display: none;
z-index: 100;
}
td.more_opts {
display: none;
white-space: nowrap;
}
iframe.IE_hack {
z-index: 1;
position: absolute;
display: none;
border: 0;
filter: alpha(opacity=0);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B