';
-$html .= '';
-$html .= ' ';
-$html .= '';
-if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) {
- $html .= '';
+/**
+ * Prints Html For Export Options Save Dir
+ *
+ * @return string
+ */
+function PMA_getHtmlForExportOptionsOutputSaveDir()
+{
+ global $cfg;
+ $html = ' ';
$html .= ' addMessage(__('@SERVER@ will become the server name'));
-if ($export_type == 'database' || $export_type == 'table') {
- $trans->addMessage(__(', @DATABASE@ will become the database name'));
- if ($export_type == 'table') {
- $trans->addMessage(__(', @TABLE@ will become the table name'));
+
+
+/**
+ * Prints Html For Export Options
+ *
+ * @param String $export_type Selected Export Type
+ *
+ * @return string
+ */
+function PMA_getHtmlForExportOptionsOutputFormat($export_type)
+{
+ $html = ' ';
+ $html .= '';
+ $html .= __('File name template:');
+ $trans = new PMA_Message;
+ $trans->addMessage(__('@SERVER@ will become the server name'));
+ if ($export_type == 'database' || $export_type == 'table') {
+ $trans->addMessage(__(', @DATABASE@ will become the database name'));
+ if ($export_type == 'table') {
+ $trans->addMessage(__(', @TABLE@ will become the table name'));
+ }
}
-}
-
-$msg = 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.')
-);
-$msg->addParam(
- '',
- false
-);
-$msg->addParam(' ', false);
-$msg->addParam($trans);
-$doc_url = PMA_Util::getDocuLink('faq', 'faq6-27');
-$msg->addParam(
- '',
- false
-);
-$msg->addParam(' ', false);
-
-$html .= PMA_Util::showHint($msg);
-$html .= ' ';
-$html .= ' getUserValue(
- 'pma_db_filename_template',
- $GLOBALS['cfg']['Export']['file_template_database']
- )
- );
- } elseif ($export_type == 'table') {
- $html .= htmlspecialchars(
- $GLOBALS['PMA_Config']->getUserValue(
- 'pma_table_filename_template',
- $GLOBALS['cfg']['Export']['file_template_table']
- )
- );
+
+ $msg = 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.'
+ )
+ );
+ $msg->addParam(
+ '',
+ false
+ );
+ $msg->addParam(' ', false);
+ $msg->addParam($trans);
+ $doc_url = PMA_Util::getDocuLink('faq', 'faq6-27');
+ $msg->addParam(
+ '',
+ false
+ );
+ $msg->addParam(' ', false);
+
+ $html .= PMA_Util::showHint($msg);
+ $html .= '';
+ $html .= ' getUserValue(
- 'pma_server_filename_template',
- $GLOBALS['cfg']['Export']['file_template_server']
- )
- );
+ if ($export_type == 'database') {
+ $html .= htmlspecialchars(
+ $GLOBALS['PMA_Config']->getUserValue(
+ 'pma_db_filename_template',
+ $GLOBALS['cfg']['Export']['file_template_database']
+ )
+ );
+ } elseif ($export_type == 'table') {
+ $html .= htmlspecialchars(
+ $GLOBALS['PMA_Config']->getUserValue(
+ 'pma_table_filename_template',
+ $GLOBALS['cfg']['Export']['file_template_table']
+ )
+ );
+ } else {
+ $html .= htmlspecialchars(
+ $GLOBALS['PMA_Config']->getUserValue(
+ 'pma_server_filename_template',
+ $GLOBALS['cfg']['Export']['file_template_server']
+ )
+ );
+ }
}
+ $html .= '"';
+ $html .= '/>';
+ $html .= ''
. __('Character set of the file:') . ' ' . "\n";
reset($cfg['AvailableCharsets']);
$html .= '';
@@ -360,99 +538,168 @@ if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
}
$html .= '>' . $temp_charset . '';
} // end foreach
- $html .= ' ';
-} // end if
+ $html .= ' ';
+
+ return $html;
+}
-if (isset($_GET['compression'])) {
- $selected_compression = $_GET['compression'];
-} elseif (isset($cfg['Export']['compression'])) {
- $selected_compression = $cfg['Export']['compression'];
-} else {
- $selected_compression = "none";
+/**
+ * Prints Html For Export Options Compression
+ *
+ * @return string
+ */
+function PMA_getHtmlForExportOptionsOutputCompression()
+{
+ global $cfg;
+ if (isset($_GET['compression'])) {
+ $selected_compression = $_GET['compression'];
+ } elseif (isset($cfg['Export']['compression'])) {
+ $selected_compression = $cfg['Export']['compression'];
+ } else {
+ $selected_compression = "none";
+ }
+
+ $html = "";
+ // zip, gzip and bzip2 encode features
+ $is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress'));
+ $is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode'));
+ $is_bzip2 = ($cfg['BZipDump'] && @function_exists('bzcompress'));
+ if ($is_zip || $is_gzip || $is_bzip2) {
+ $html .= '';
+ $html .= ''
+ . __('Compression:') . ' ';
+ $html .= '';
+ $html .= '' . __('None') . ' ';
+ if ($is_zip) {
+ $html .= '';
+ }
+ if ($is_gzip) {
+ $html .= ' ';
+ }
+ if ($is_bzip2) {
+ $html .= ' ';
+ }
+ $html .= ' ';
+ $html .= ' ';
+ } else {
+ $html .= ' ';
+ }
+
+ return $html;
}
-// zip, gzip and bzip2 encode features
-$is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress'));
-$is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode'));
-$is_bzip2 = ($cfg['BZipDump'] && @function_exists('bzcompress'));
-if ($is_zip || $is_gzip || $is_bzip2) {
+/**
+ * Prints Html For Export Options Radio
+ *
+ * @return string
+ */
+function PMA_getHtmlForExportOptionsOutputRadio()
+{
+ $html = '';
+ $html .= ' ';
+ return $html;
+}
+
+/**
+ * Prints Html For Export Options
+ *
+ * @param String $export_type Selected Export Type
+ *
+ * @return string
+ */
+function PMA_getHtmlForExportOptionsOutput($export_type)
+{
+ global $cfg;
+ $html = '';
+ $html .= '
' . __('Output:') . ' ';
+ $html .= '
';
$html .= '';
-} else {
- $html .= '
';
-}
-$html .= '';
-$html .= '';
-$html .= '
';
-$html .= ' ';
-$html .= '';
-$html .= '
';
+
+ $html .= PMA_getHtmlForExportOptionsOutputRadio();
-$html .= '';
-$html .= '
' . __('Format:') . ' ';
-$html .= PMA_pluginGetChoice('Export', 'what', $export_list, 'format');
-$html .= '';
-
-$html .= '';
-
-if (function_exists('PMA_Kanji_encodingForm')) {
- // Encoding setting form appended by Y.Kawada
- // Japanese encoding setting
- $html .= '';
- $html .= '
' . __('Encoding Conversion:') . ' ';
- $html .= PMA_Kanji_encodingForm();
+ $html .= '';
$html .= '';
+
+ return $html;
}
-$html .= '';
+/**
+ * Prints Html For Export Options
+ *
+ * @param String $export_type Selected Export Type
+ * @param String $db Selected DB
+ * @param String $table Selected Table
+ * @param String $multi_values Export selection
+ * @param String $num_tables number of tables
+ * @param String $export_list Export List
+ * @param String $unlim_num_rows Number of Rows
+ *
+ * @return string
+ */
+function PMA_getHtmlForExportOptions(
+ $export_type, $db, $table, $multi_values,
+ $num_tables, $export_list, $unlim_num_rows
+) {
+ global $cfg;
+ $html = PMA_getHtmlForExportOptionHeader($export_type, $db, $table);
+ $html .= PMA_getHtmlForExportOptionsMethod();
+ $html .= PMA_getHtmlForExportOptionsSelection($export_type, $multi_values);
+
+ if (strlen($table) && empty($num_tables) && ! PMA_Table::isMerge($db, $table)) {
+ $html .= PMA_getHtmlForExportOptionsRows($db, $table, $unlim_num_rows);
+ }
+
+ if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) {
+ $html .= PMA_getHtmlForExportOptionsQuickExport();
+ }
-$html .= PMA_Util::getExternalBug(
- __('SQL compatibility mode'), 'mysql', '50027', '14515'
-);
-
-$html .= ' ';
-$html .= '
';
-$html .= '';
-
-$response = PMA_Response::getInstance();
-$response->addHTML($html);
+ $html .= PMA_getHtmlForExportOptionsOutput($export_type);
+
+ $html .= PMA_getHtmlForExportOptionsFormat($export_list);
+ return $html;
+}
+?>
diff --git a/server_export.php b/server_export.php
index 001abf2a93..c0bffdb3e1 100644
--- a/server_export.php
+++ b/server_export.php
@@ -1,6 +1,7 @@
getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export.js');
-require 'libraries/server_common.inc.php';
-
$export_page_title = __('View dump (schema) of databases') . "\n";
-$multi_values = '';
-$multi_values .= '
';
-$multi_values .= __('Select All');
-$multi_values .= ' ';
-$multi_values .= ' / ';
-$multi_values .= '
';
-$multi_values .= __('Unselect All') . ' ';
-
-$multi_values .= '
';
-$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 ($current_db == 'information_schema'
- || $current_db == 'performance_schema'
- || $current_db == 'mysql'
- ) {
- continue;
- }
- if (isset($_GET['db_select'])) {
- if (in_array($current_db, $_GET['db_select'])) {
- $is_selected = ' selected="selected"';
- } else {
- $is_selected = '';
- }
- } elseif (isset($tmp_select)) {
- if (strpos(' ' . $tmp_select, '|' . $current_db . '|')) {
- $is_selected = ' selected="selected"';
- } else {
- $is_selected = '';
- }
- } else {
- $is_selected = ' selected="selected"';
- }
- $current_db = htmlspecialchars($current_db);
- $multi_values .= ' ' . $current_db . ' ' . "\n";
-} // end while
-$multi_values .= "\n";
-$multi_values .= ' ';
+$select_item = isset($tmp_select)? $tmp_select : '';
+$multi_values = PMA_getHtmlForExportSelectOptions($select_item);
$export_type = 'server';
-require_once 'libraries/display_export.lib.php';
+require_once 'libraries/display_export.inc.php';
?>
diff --git a/server_plugins.php b/server_plugins.php
index cde4878f7b..2a77f0dcd1 100644
--- a/server_plugins.php
+++ b/server_plugins.php
@@ -1,6 +1,7 @@