'; $multi_values .= ''; $multi_values .= __('Select All'); $multi_values .= ''; $multi_values .= ' / '; $multi_values .= ''; $multi_values .= __('Unselect All') . '
'; $multi_values .= ''; return $multi_values; } /** * Prints Html For Export Hidden Input * * @param String $export_type Selected Export Type * @param String $db Selected DB * @param String $table Selected Table * @param String $single_table Single Table * @param String $sql_query Sql Query * * @return string */ function PMA_getHtmlForHiddenInput( $export_type, $db, $table, $single_table, $sql_query ) { global $cfg; $html = ""; if ($export_type == 'server') { $html .= PMA_URL_getHiddenInputs('', '', 1); } elseif ($export_type == 'database') { $html .= PMA_URL_getHiddenInputs($db, '', 1); } else { $html .= PMA_URL_getHiddenInputs($db, $table, 1); } // just to keep this value for possible next display of this form after saving // on server if (!empty($single_table)) { $html .= '' . "\n"; } $html .= ''; $html .= "\n"; // 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) $html .= ''; if (! empty($sql_query)) { $html .= '' . "\n"; } elseif (isset($_GET['sql_query'])) { $html .= '' . "\n"; } return $html; } /** * Prints Html For Export Options Header * * @param String $export_type Selected Export Type * @param String $db Selected DB * @param String $table Selected Table * * @return string */ function PMA_getHtmlForExportOptionHeader($export_type, $db, $table) { $html = ''; return $html; } /** * Prints Html For Export Options Method * * @return string */ function PMA_getHtmlForExportOptionsMethod() { global $cfg; if (isset($_GET['quick_or_custom'])) { $export_method = $_GET['quick_or_custom']; } else { $export_method = $cfg['Export']['method']; } if ($export_method == 'custom-no-form') { return ''; } $html = '
'; $html .= '

' . __('Export Method:') . '

'; $html .= '
'; return $html; } /** * Prints Html For Export Options Format dropdown * * @param ExportPlugin[] $export_list Export List * * @return string */ function PMA_getHtmlForExportOptionsFormatDropdown($export_list) { $html = '
'; $html .= '

' . __('Format:') . '

'; $html .= PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); $html .= '
'; return $html; } /** * Prints Html For Export Options Format-specific options * * @param ExportPlugin[] $export_list Export List * * @return string */ function PMA_getHtmlForExportOptionsFormat($export_list) { $html = '
'; $html .= '

' . __('Format-specific options:') . '

'; $html .= '

'; $html .= __( 'Scroll down to fill in the options for the selected format ' . 'and ignore the options for other formats.' ); $html .= '

'; $html .= PMA_pluginGetOptions('Export', $export_list); $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 .= '
'; $html .= PMA_Util::getExternalBug( __('SQL compatibility mode'), 'mysql', '50027', '14515' ); global $cfg; if ($cfg['ExecTimeLimit'] > 0) { $html .= ''; } else { // if the time limit set is zero, then time out won't occur // So no need to check for time out. $html .= ''; } $html .= '
'; return $html; } /** * Prints Html For Export Options Rows * * @param String $db Selected DB * @param String $table Selected Table * @param String $unlim_num_rows Num of Rows * * @return string */ function PMA_getHtmlForExportOptionsRows($db, $table, $unlim_num_rows) { $html = '
'; $html .= '

' . __('Rows:') . '

'; $html .= ''; $html .= '
'; return $html; } /** * Prints Html For Export Options Quick Export * * @return string */ function PMA_getHtmlForExportOptionsQuickExport() { global $cfg; $html = '
'; $html .= '

' . __('Output:') . '

'; $html .= '
'; return $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 ExportPlugin[] $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_getHtmlForExportOptionsFormatDropdown($export_list); $html .= PMA_getHtmlForExportOptionsSelection($export_type, $multi_values); $tableLength = /*overload*/mb_strlen($table); if ($tableLength && 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_getHtmlForAliasModalDialog($db, $table); $html .= PMA_getHtmlForExportOptionsOutput($export_type); $html .= PMA_getHtmlForExportOptionsFormat($export_list); return $html; } /** * Prints Html For Alias Modal Dialog * * @param String $db Selected DB * @param String $table Selected Table * * @return string */ function PMA_getHtmlForAliasModalDialog($db = '', $table = '') { if (isset($_SESSION['tmpval']['aliases'])) { $aliases = $_SESSION['tmpval']['aliases']; } // In case of server export, the following list of // databases are not shown in the list. $dbs_not_allowed = array( 'information_schema', 'performance_schema', 'mysql' ); // Fetch Columns info // Server export does not have db set. $title = __('Rename exported databases/tables/columns'); if (empty($db)) { $databases = $GLOBALS['dbi']->getColumnsFull( null, null, null, $GLOBALS['userlink'] ); foreach ($dbs_not_allowed as $db) { unset($databases[$db]); } // Database export does not have table set. } elseif (empty($table)) { $tables = $GLOBALS['dbi']->getColumnsFull( $db, null, null, $GLOBALS['userlink'] ); $databases = array($db => $tables); // Table export } else { $columns = $GLOBALS['dbi']->getColumnsFull( $db, $table, null, $GLOBALS['userlink'] ); $databases = array( $db => array( $table => $columns ) ); } $html = '
'; $db_html = ''; $db_html .= ''; $table_html .= ''; $table_html .= ''; $table_html .= ''; $col_html .= ''; $col_html .= '' . ''; $class = 'odd'; foreach ($columns as $column => $col_def) { $val = ''; if (!empty($aliases[$db]['tables'][$table]['columns'][$column])) { $val = htmlspecialchars( $aliases[$db]['tables'][$table]['columns'][$column] ); } $column = htmlspecialchars($column); $name_attr = 'aliases[' . $db . '][tables][' . $table . '][columns][' . $column . ']'; $id_attr = substr(md5($name_attr), 0, 12); $col_html .= ''; $col_html .= ''; $col_html .= ''; $col_html .= ''; $class = $class === 'odd' ? 'even' : 'odd'; } $col_html .= '
' . __('Old column name') . '' . __('New column name') . '
'; } $table_html .= ''; $table_html .= $table_input_html . '
' . $col_html . '
'; } $db_html .= ''; $html .= $db_html; $html .= $db_input_html . '
'; $html .= $table_html; $html .= '
'; return $html; } ?>