prepared language files for XML exports (feature does not work yet!)
This commit is contained in:
@@ -16,6 +16,8 @@ $Source$
|
||||
|
||||
2002-04-28 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||
* header.inc.php3, lines 162-170: Improved patch #548696.
|
||||
* lang/*.php3, db_details.php3, tbl_dump.php3:
|
||||
prepared files for XML exports.
|
||||
|
||||
2002-04-28 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* tbl_properties.php3, line 395: replaced a "require" by an include.
|
||||
|
@@ -646,7 +646,7 @@ if ($num_tables > 0) {
|
||||
echo "\n";
|
||||
?>
|
||||
<td>
|
||||
<select name="table_select[]" size="5" multiple="multiple">
|
||||
<select name="table_select[]" size="6" multiple="multiple">
|
||||
<?php
|
||||
$i = 0;
|
||||
echo "\n";
|
||||
@@ -670,7 +670,9 @@ if ($num_tables > 0) {
|
||||
<input type="radio" name="what" id="radio_dump_data" value="data" />
|
||||
<label for="radio_dump_data"><?php echo $strStrucData; ?></label><br />
|
||||
<input type="radio" name="what" id="radio_dump_dataonly" value="dataonly" />
|
||||
<label for="radio_dump_dataonly"><?php echo $strDataOnly; ?></label>
|
||||
<label for="radio_dump_dataonly"><?php echo $strDataOnly; ?></label><br />
|
||||
<input type="radio" name="what" id="radio_dump_xml" value="xml" />
|
||||
<label for="radio_dump_xml"><?php echo $strExportToXML; ?></label>
|
||||
<?php
|
||||
if ($num_tables > 1) {
|
||||
echo "\n";
|
||||
|
@@ -146,6 +146,9 @@ else {
|
||||
} else if ($what == 'csv' || $what == 'excel') {
|
||||
$ext = 'csv';
|
||||
$mime_type = 'text/x-csv';
|
||||
} else if ($what == 'xml') {
|
||||
$ext = 'xml';
|
||||
$mime_type = 'text/xml';
|
||||
} else {
|
||||
$ext = 'sql';
|
||||
// loic1: 'application/octet-stream' is the registered IANA type but
|
||||
@@ -189,8 +192,8 @@ if ($num_tables == 0) {
|
||||
}
|
||||
// At least on table -> do the work
|
||||
else {
|
||||
// No csv format -> add some comments at the top
|
||||
if ($what != 'csv' && $what != 'excel') {
|
||||
// No csv or xml format -> add some comments at the top
|
||||
if ($what != 'csv' && $what != 'excel' && $what != 'xml') {
|
||||
$dump_buffer .= '# phpMyAdmin MySQL-Dump' . $crlf
|
||||
. '# version ' . PMA_VERSION . $crlf
|
||||
. '# http://phpwizard.net/phpMyAdmin/' . $crlf
|
||||
@@ -265,8 +268,35 @@ else {
|
||||
// staybyte: don't remove, it makes easier to select & copy from
|
||||
// browser
|
||||
$dump_buffer .= $crlf;
|
||||
} // end 'no csv' case
|
||||
} // end 'no csv or xml' case
|
||||
|
||||
// 'xml' case
|
||||
else if ($GLOBALS['what'] == 'xml') {
|
||||
// first add the xml tag
|
||||
$dump_buffer .= '<?xml version="1.0" encoding="' . $charset . '"?>' . $crlf;
|
||||
// some comments
|
||||
$dump_buffer .= '<!--' . $crlf
|
||||
. '-' . $crlf
|
||||
. '- phpMyAdmin XML-Dump' . $crlf
|
||||
. '- version ' . PMA_VERSION . $crlf
|
||||
. '- http://phpwizard.net/phpMyAdmin/' . $crlf
|
||||
. '- http://www.phpmyadmin.net/ (download page)' . $crlf
|
||||
. '-' . $crlf
|
||||
. '- ' . $strHost . ': ' . $cfg['Server']['host'];
|
||||
if (!empty($cfg['Server']['port'])) {
|
||||
$dump_buffer .= ':' . $cfg['Server']['port'];
|
||||
}
|
||||
$formatted_db_name = (isset($use_backquotes))
|
||||
? PMA_backquote($db)
|
||||
: '\'' . $db . '\'';
|
||||
$dump_buffer .= $crlf
|
||||
. '- ' . $strGenTime . ': ' . PMA_localisedDate() . $crlf
|
||||
. '- ' . $strServerVersion . ': ' . substr(PMA_MYSQL_INT_VERSION, 0, 1) . '.' . substr(PMA_MYSQL_INT_VERSION, 1, 2) . '.' . substr(PMA_MYSQL_INT_VERSION, 3) . $crlf
|
||||
. '- ' . $strPHPVersion . ': ' . phpversion() . $crlf
|
||||
. '- ' . $strDatabase . ': ' . $formatted_db_name . $crlf
|
||||
. '-' . $crlf
|
||||
. '-->' . $crlf;
|
||||
}
|
||||
// 'csv' case
|
||||
else {
|
||||
// Handles the EOL character
|
||||
@@ -319,11 +349,14 @@ else if (isset($gzip) && $gzip == 'gzip') {
|
||||
echo gzencode($dump_buffer);
|
||||
}
|
||||
}
|
||||
// 4. on screen or as a text file
|
||||
else {
|
||||
// 4. as a text file
|
||||
else if (!empty($asfile)) {
|
||||
echo $dump_buffer;
|
||||
}
|
||||
|
||||
// 5. on display
|
||||
else {
|
||||
echo htmlspecialchars($dump_buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the html tags and add the footers in dump is displayed on screen
|
||||
|
Reference in New Issue
Block a user