📄 display_export.lib.php
字号:
<?php/* $Id: display_export.lib.php,v 2.22 2004/09/16 10:59:26 garvinhicking Exp $ */// vim: expandtab sw=4 ts=4 sts=4:// Get relations & co. statusrequire_once('./libraries/relation.lib.php');$cfgRelation = PMA_getRelationsParam();// Check if we have native MS Excel export using PEAR class Spreadsheet_Excel_Writerif (!empty($GLOBALS['cfg']['TempDir'])) { @include_once('Spreadsheet/Excel/Writer.php'); if (class_exists('Spreadsheet_Excel_Writer')) { $xls = TRUE; } else { $xls = FALSE; }} else { $xls = FALSE;}function PMA_exportCheckboxCheck($str) { if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) { echo ' checked="checked"'; }}function PMA_exportIsActive($what, $val) { if (isset($GLOBALS['cfg']['Export'][$what]) && $GLOBALS['cfg']['Export'][$what] == $val) { echo ' checked="checked"'; }}?><form method="post" action="export.php" name="dump"><?php$hide_structure = false;$hide_sql = false;$hide_xml = empty($db);if ($export_type == 'server') { echo PMA_generate_common_hidden_inputs('', '', 1);} elseif ($export_type == 'database') { echo PMA_generate_common_hidden_inputs($db, '', 1);} else { echo PMA_generate_common_hidden_inputs($db, $table, 1); if (!isset($single_table)) { $hide_structure = true; $hide_sql = true; } else { // just to keep this value for possible next display of this form after saving on server echo ' <input type="hidden" name="single_table" value="TRUE" />'; }}echo ' <input type="hidden" name="export_type" value="' . $export_type . '" />';if (isset($sql_query)) { echo ' <input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />';}?> <script type="text/javascript"> <!-- function hide_them_all() { getElement("csv_options").style.display = 'none'; getElement("excel_options").style.display = 'none'; getElement("latex_options").style.display = 'none';<?php if ($xls) { ?> getElement("xls_options").style.display = 'none';<?php } ?><?php if (!$hide_sql) { ?> getElement("sql_options").style.display = 'none';<?php } ?> getElement("none_options").style.display = 'none'; } function show_checked_option() { hide_them_all(); if (getElement('radio_dump_latex').checked) { getElement('latex_options').style.display = 'block';<?php if ($xls) { ?> } else if (getElement('radio_dump_xls').checked) { getElement('xls_options').style.display = 'block';<?php } ?><?php if (!$hide_sql) { ?> } else if (getElement('radio_dump_sql').checked) { getElement('sql_options').style.display = 'block';<?php } ?><?php if (!$hide_xml) { ?> } else if (getElement('radio_dump_xml').checked) { getElement('none_options').style.display = 'block';<?php } ?> } else if (getElement('radio_dump_csv').checked) { getElement('csv_options').style.display = 'block'; } else if (getElement('radio_dump_excel').checked) { getElement('excel_options').style.display = 'block'; } else { if (getElement('radio_dump_sql')) { getElement('radio_dump_sql').checked = true; getElement('sql_options').style.display = 'block'; } else if (getElement('radio_dump_csv')) { getElement('radio_dump_csv').checked = true; getElement('csv_options').style.display = 'block'; } else { getElement('none_options').style.display = 'block'; } } } //--> </script> <table cellpadding="3" border="0" cellspacing="0"> <tr> <th colspan="3" valign="top" nowrap="nowrap" class="tblHeaders"><?php echo $export_page_title; ?></th> </tr> <tr> <!-- Formats to export to --> <td nowrap="nowrap" valign="top" onclick="if (typeof(window.opera) != 'undefined')setTimeout('show_checked_option()', 1); return true"> <table border="0" cellpadding="3" cellspacing="1"> <tr><th align="left"><?php echo $strExport; ?></th></tr> <?php if (isset($multi_values) && $multi_values != '') { echo ' <tr><td bgcolor="' . $cfg['BgcolorOne'] . '">'; echo $multi_values; echo ' </td></tr>'; } ?><?php if (!$hide_sql) { ?> <!-- SQL --> <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="radio" name="what" value="sql" id="radio_dump_sql" onclick="if (this.checked) { hide_them_all(); getElement('sql_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'sql'); ?> style="vertical-align: middle" /><label for="radio_dump_sql"><?php echo $strSQL; ?> </label> </td></tr><?php } ?> <!-- LaTeX table --> <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="radio" name="what" value="latex" id="radio_dump_latex" onclick="if (this.checked) { hide_them_all(); getElement('latex_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'latex'); ?> style="vertical-align: middle" /><label for="radio_dump_latex"><?php echo $strLaTeX; ?> </label> </td></tr><?php if ($xls) { ?> <!-- Native Excel --> <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="radio" name="what" value="xls" id="radio_dump_xls" onclick="if (this.checked) { hide_them_all(); getElement('xls_options').style.display = 'block'; getElement('checkbox_dump_asfile').checked = true;}; return true" <?php PMA_exportIsActive('format', 'xls'); ?> /><label for="radio_dump_xls"><?php echo $strStrucNativeExcel; ?></label> </td></tr><?php } ?> <!-- Excel CSV --> <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="radio" name="what" value="excel" id="radio_dump_excel" onclick="if (this.checked) { hide_them_all(); getElement('excel_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'excel'); ?> style="vertical-align: middle" /><label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?> </label> </td></tr> <!-- General CSV --> <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="radio" name="what" value="csv" id="radio_dump_csv" onclick="if (this.checked) { hide_them_all(); getElement('csv_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'csv'); ?> style="vertical-align: middle" /><label for="radio_dump_csv"><?php echo $strStrucCSV;?> </label> </td></tr><?php if (!$hide_xml) { ?> <!-- XML --> <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="radio" name="what" value="xml" id="radio_dump_xml" onclick="if (this.checked) { hide_them_all(); getElement('none_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'xml'); ?> style="vertical-align: middle" /><label for="radio_dump_xml"><?php echo $strXML; ?> </label> </td></tr><?php } ?> </table> </td> <!-- ltr item --> <td valign="top"><img src="<?php echo $pmaThemeImage . 'item_ltr.png'; ?>" border="0" hspace="2" vspace="5" /></td> <!-- Options --> <td valign="top" id="options_td" width="400"><?php if (!$hide_sql) { ?> <!-- SQL options --> <div id="sql_options"> <table width="400" border="0" cellpadding="3" cellspacing="1"> <tr> <th align="left"> <?php echo $strSQLOptions; $goto_documentation = '<a href="./Documentation.html#faqexport" target="documentation">'; echo ($cfg['ReplaceHelpImg'] ? '' : '(') . $goto_documentation . ($cfg['ReplaceHelpImg'] ? '<img src="' . $pmaThemeImage . 'b_help.png" border="0" alt="' .$strDocu . '" width="11" height="11" hspace="2" align="middle" />' : $strDocu) . '</a>' . ($cfg['ReplaceHelpImg'] ? '' : ')'); ?> </th> </tr> <tr> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <?php echo $strAddHeaderComment; ?>: <input type="text" name="header_comment" value="<?php echo $cfg['Export']['sql_header_comment']; ?>" class="textfield" size="30" style="vertical-align: middle" /><br /> <input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" <?php PMA_exportCheckboxCheck('sql_use_transaction'); ?> style="vertical-align: middle" /> <label for="checkbox_use_transaction"><?php echo $strEncloseInTransaction; ?></label><br /> <input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" <?php PMA_exportCheckboxCheck('sql_disable_fk'); ?> style="vertical-align: middle" /> <label for="checkbox_disable_fk"><?php echo $strDisableForeignChecks; ?></label><br /> </td> </tr><?phpif ($export_type == 'server') {?> <!-- For databases --> <tr> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <b><?php echo $strDatabaseExportOptions; ?>:</b><br /> <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" <?php PMA_exportCheckboxCheck('sql_drop_database'); ?> style="vertical-align: middle" /> <label for="checkbox_drop_database"><?php echo $strAddDropDatabase; ?></label> </td> </tr><?php}if (!$hide_structure) { ?> <!-- For structure --> <tr> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" <?php PMA_exportCheckboxCheck('sql_structure'); ?> onclick="if (!this.checked && !getElement('checkbox_sql_data').checked) return false; else return true;" /> <label for="checkbox_sql_structure"><b><?php echo $strStructure; ?>:</b></label><br /> <input type="checkbox" name="drop" value="1" id="checkbox_dump_drop" <?php PMA_exportCheckboxCheck('sql_drop_table'); ?> style="vertical-align: middle" /> <label for="checkbox_dump_drop"><?php echo $strStrucDrop; ?></label><br /> <input type="checkbox" name="if_not_exists" value="1" id="checkbox_dump_if_not_exists" <?php PMA_exportCheckboxCheck('sql_if_not_exists'); ?> style="vertical-align: middle" /> <label for="checkbox_dump_if_not_exists"><?php echo $strAddIfNotExists; ?></label><br /> <input type="checkbox" name="auto_increment" value="1" id="checkbox_auto_increment" <?php PMA_exportCheckboxCheck('sql_auto_increment'); ?> style="vertical-align: middle" /> <label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br /> <input type="checkbox" name="use_backquotes" value="1" id="checkbox_dump_use_backquotes" <?php PMA_exportCheckboxCheck('sql_backquotes'); ?> style="vertical-align: middle" /> <label for="checkbox_dump_use_backquotes"><?php echo $strUseBackquotes; ?></label><br /> <b><?php echo $strAddIntoComments; ?></b><br /> <input type="checkbox" name="sql_dates" value="yes" id="checkbox_sql_dates" <?php PMA_exportCheckboxCheck('sql_dates'); ?> style="vertical-align: middle" /> <label for="checkbox_sql_dates"><?php echo $strCreationDates; ?></label><br /><?php if (!empty($cfgRelation['relation'])) {?> <input type="checkbox" name="sql_relation" value="yes" id="checkbox_sql_use_relation" <?php PMA_exportCheckboxCheck('sql_relation'); ?> style="vertical-align: middle" />
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -