Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f5a717e93f
42
export.php
42
export.php
@ -334,43 +334,11 @@ if (!defined('TESTSUITE')) {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
$backup_cfgServer = $cfg['Server'];
|
||||
$cfg['Server'] = $backup_cfgServer;
|
||||
unset($backup_cfgServer);
|
||||
echo "\n" . '<div style="text-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_URL_getCommon();
|
||||
} elseif ($export_type == 'database') {
|
||||
$back_button .= 'db_export.php?' . PMA_URL_getCommon($db);
|
||||
} else {
|
||||
$back_button .= 'tbl_export.php?' . PMA_URL_getCommon($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";
|
||||
echo '<textarea name="sqldump" cols="50" rows="30" '
|
||||
. 'id="textSQLDUMP" wrap="OFF">' . "\n";
|
||||
list($html, $back_button) = PMA_getHtmlForDisplayedExportHeader(
|
||||
$export_type, $db, $table
|
||||
);
|
||||
echo $html;
|
||||
unset($html);
|
||||
} // end download
|
||||
}
|
||||
|
||||
|
||||
@ -397,4 +397,52 @@ function PMA_compressExport($dump_buffer, $compression)
|
||||
}
|
||||
return $dump_buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTML containing the header for a displayed export
|
||||
*
|
||||
* @param string $export_type the export type
|
||||
* @param string $db the database name
|
||||
* @param string $table the table name
|
||||
*
|
||||
* @return array the generated HTML and back button
|
||||
*/
|
||||
function PMA_getHtmlForDisplayedExportHeader($export_type, $db, $table)
|
||||
{
|
||||
$html = '<div style="text-align: ' . $GLOBALS['cell_align_left'] . '">';
|
||||
|
||||
/**
|
||||
* 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_URL_getCommon();
|
||||
} elseif ($export_type == 'database') {
|
||||
$back_button .= 'db_export.php?' . PMA_URL_getCommon($db);
|
||||
} else {
|
||||
$back_button .= 'tbl_export.php?' . PMA_URL_getCommon($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>';
|
||||
|
||||
$html .= $back_button
|
||||
. '<form name="nofunction">'
|
||||
. '<textarea name="sqldump" cols="50" rows="30" '
|
||||
. 'id="textSQLDUMP" wrap="OFF">';
|
||||
|
||||
return array($html, $back_button);
|
||||
}
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user