2 /* vim: set expandtab sw=4 ts=4 sts=4: */
8 if (! defined('PHPMYADMIN')) {
15 require_once './libraries/Table.class.php';
17 // Get relations & co. status
18 require_once './libraries/relation.lib.php';
19 $cfgRelation = PMA_getRelationsParam();
22 require_once './libraries/file_listing.php';
23 require_once './libraries/plugin_interface.lib.php';
25 function PMA_exportCheckboxCheck($str) {
26 if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
27 echo ' checked="checked"';
31 function PMA_exportIsActive($what, $val) {
32 if (isset($GLOBALS['cfg']['Export'][$what]) && $GLOBALS['cfg']['Export'][$what] == $val) {
33 echo ' checked="checked"';
37 /* Scan for plugins */
38 $export_list = PMA_getPlugins('./libraries/export/', array('export_type' => $export_type, 'single_table' => isset($single_table)));
40 /* Fail if we didn't find any plugin */
41 if (empty($export_list)) {
42 PMA_Message
::error('strCanNotLoadExportPlugins')->display();
43 require './libraries/footer.inc.php';
47 <form method
="post" action
="export.php" name
="dump">
50 if ($export_type == 'server') {
51 echo PMA_generate_common_hidden_inputs('', '', 1);
52 } elseif ($export_type == 'database') {
53 echo PMA_generate_common_hidden_inputs($db, '', 1);
55 echo PMA_generate_common_hidden_inputs($db, $table, 1);
58 // just to keep this value for possible next display of this form after saving on server
59 if (isset($single_table)) {
60 echo '<input type="hidden" name="single_table" value="TRUE" />' . "\n";
63 echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' . "\n";
65 if (! empty($sql_query)) {
66 echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";
68 echo PMA_pluginGetJavascript($export_list);
70 <fieldset id
="fieldsetexport">
71 <legend
><?php
echo $export_page_title; ?
></legend
>
75 * this table is needed to fix rendering in Opera <= 9 and Safari <= 2
76 * normaly just the two fieldset would have float: left
81 <div id
="div_container_exportoptions">
82 <fieldset id
="exportoptions">
83 <legend
><?php
echo $strExport; ?
></legend
>
85 <?php
if (! empty($multi_values)) { ?
>
86 <div
class="formelementrow">
87 <?php
echo $multi_values; ?
>
90 <?php
echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?
>
96 <div id
="div_container_sub_exportoptions">
97 <?php
echo PMA_pluginGetOptions('Export', $export_list); ?
>
101 <script type
="text/javascript">
108 $is_merge = ! PMA_Table
::isView($db, $table) && (strcasecmp(PMA_Table
::sGetStatusInfo($db, $table, 'Engine'),'MRG_MYISAM') == 0);
109 if (strlen($table) && ! isset($num_tables) && ! $is_merge) {
111 <div
class="formelementrow">
113 echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';
115 echo sprintf($strDumpXRows,
116 '<input type="text" name="limit_to" size="5" value="'
117 . (isset($unlim_num_rows) ?
$unlim_num_rows : PMA_Table
::countRecords($db, $table))
118 . '" onfocus="this.select()" />',
119 '<input type="text" name="limit_from" value="0" size="5"'
120 .' onfocus="this.select()" /> ');
122 echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
123 echo '<label for="radio_allrows_1">' . $strDumpAllRows . '</label>';
131 <input type
="checkbox" name
="asfile" value
="sendit"
132 id
="checkbox_dump_asfile" <?php
PMA_exportCheckboxCheck('asfile'); ?
> />
133 <label
for="checkbox_dump_asfile"><?php
echo $strSend; ?
></label
>
136 <?php
if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?
>
137 <input type
="checkbox" name
="onserver" value
="saveit"
138 id
="checkbox_dump_onserver"
139 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
140 <?php
PMA_exportCheckboxCheck('onserver'); ?
> />
141 <label
for="checkbox_dump_onserver">
142 <?php
echo sprintf($strSaveOnServer, htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?
>
144 <input type
="checkbox" name
="onserverover" value
="saveitover"
145 id
="checkbox_dump_onserverover"
146 onclick
="document.getElementById('checkbox_dump_onserver').checked = true;
147 document.getElementById('checkbox_dump_asfile').checked = true;"
148 <?php
PMA_exportCheckboxCheck('onserver_overwrite'); ?
> />
149 <label
for="checkbox_dump_onserverover">
150 <?php
echo $strOverwriteExisting; ?
></label
>
154 <label
for="filename_template">
156 echo $strFileNameTemplate;
158 $trans = new PMA_Message
;
159 $trans->addMessage('__SERVER__/');
160 $trans->addString('strFileNameTemplateDescriptionServer');
161 if ($export_type == 'database' ||
$export_type == 'table') {
162 $trans->addMessage('__DB__/');
163 $trans->addString('strFileNameTemplateDescriptionDatabase');
164 if ($export_type == 'table') {
165 $trans->addMessage('__TABLE__/');
166 $trans->addString('strFileNameTemplateDescriptionTable');
170 $message = new PMA_Message('strFileNameTemplateDescription');
171 $message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
172 . $strDocu . '">', false);
173 $message->addParam('</a>', false);
174 $message->addParam($trans);
176 echo PMA_showHint($message);
179 <input type
="text" name
="filename_template" id
="filename_template"
182 if ($export_type == 'database') {
183 if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
184 echo htmlspecialchars($_COOKIE['pma_db_filename_template']);
186 echo $GLOBALS['cfg']['Export']['file_template_database'];
188 } elseif ($export_type == 'table') {
189 if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
190 echo htmlspecialchars($_COOKIE['pma_table_filename_template']);
192 echo $GLOBALS['cfg']['Export']['file_template_table'];
195 if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
196 echo htmlspecialchars($_COOKIE['pma_server_filename_template']);
198 echo $GLOBALS['cfg']['Export']['file_template_server'];
206 <input type
="checkbox" name
="remember_template"
207 id
="checkbox_remember_template"
208 <?php
PMA_exportCheckboxCheck('remember_file_template'); ?
> />
209 <label
for="checkbox_remember_template">
210 <?php
echo $strFileNameTemplateRemember; ?
></label
>
213 <div
class="formelementrow">
216 if ($cfg['AllowAnywhereRecoding']) {
217 echo ' <label for="select_charset_of_file">'
218 . $strCharsetOfFile . '</label>' . "\n";
220 reset($cfg['AvailableCharsets']);
221 echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
222 foreach ($cfg['AvailableCharsets'] as $temp_charset) {
223 echo '<option value="' . $temp_charset . '"';
224 if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
225 ||
$temp_charset == $cfg['Export']['charset']) {
226 echo ' selected="selected"';
228 echo '>' . $temp_charset . '</option>';
236 // zip, gzip and bzip2 encode features
237 $is_zip = ($cfg['ZipDump'] && @function_exists
('gzcompress'));
238 $is_gzip = ($cfg['GZipDump'] && @function_exists
('gzencode'));
239 $is_bzip = ($cfg['BZipDump'] && @function_exists
('bzcompress'));
241 if ($is_zip ||
$is_gzip ||
$is_bzip) { ?
>
242 <div
class="formelementrow">
243 <?php
echo $strCompression; ?
>:
244 <input type
="radio" name
="compression" value
="none"
245 id
="radio_compression_none"
246 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
247 <?php
PMA_exportIsActive('compression', 'none'); ?
> />
248 <label
for="radio_compression_none"><?php
echo $strNone; ?
></label
>
251 <input type
="radio" name
="compression" value
="zip"
252 id
="radio_compression_zip"
253 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
254 <?php
PMA_exportIsActive('compression', 'zip'); ?
> />
255 <label
for="radio_compression_zip"><?php
echo $strZip; ?
></label
>
256 <?php
} if ($is_gzip) { ?
>
257 <input type
="radio" name
="compression" value
="gzip"
258 id
="radio_compression_gzip"
259 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
260 <?php
PMA_exportIsActive('compression', 'gzip'); ?
> />
261 <label
for="radio_compression_gzip"><?php
echo $strGzip; ?
></label
>
262 <?php
} if ($is_bzip) { ?
>
263 <input type
="radio" name
="compression" value
="bzip"
264 id
="radio_compression_bzip"
265 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
266 <?php
PMA_exportIsActive('compression', 'bzip2'); ?
> />
267 <label
for="radio_compression_bzip"><?php
echo $strBzip; ?
></label
>
271 <input type
="hidden" name
="compression" value
="none" />
275 <?php
if (function_exists('PMA_set_enc_form')) { ?
>
276 <!-- Encoding setting form appended by Y
.Kawada
-->
277 <!-- Japanese encoding setting
-->
279 <?php
echo PMA_set_enc_form(' '); ?
>
283 <fieldset
class="tblFooters">
284 <?php
PMA_externalBug($GLOBALS['strSQLCompatibility'], 'mysql', '50027', '14515'); ?
>
285 <input type
="submit" value
="<?php echo $strGo; ?>" id
="buttonGo" />