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( __('Could not load export plugins, please check your installation!'))->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 __('Export'); ?
></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); ?
>
102 <?php
if (strlen($table) && ! isset($num_tables) && ! PMA_Table
::isMerge($db, $table)) { ?
>
103 <div
class="formelementrow">
105 echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';
107 echo sprintf(__('Dump %s row(s) starting at row # %s'),
108 '<input type="text" name="limit_to" size="5" value="'
109 . (isset($unlim_num_rows) ?
$unlim_num_rows : PMA_Table
::countRecords($db, $table))
110 . '" onfocus="this.select()" />',
111 '<input type="text" name="limit_from" value="0" size="5"'
112 .' onfocus="this.select()" /> ');
114 echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
115 echo '<label for="radio_allrows_1">' . __('Dump all rows') . '</label>';
123 <input type
="checkbox" name
="asfile" value
="sendit"
124 id
="checkbox_dump_asfile" <?php
PMA_exportCheckboxCheck('asfile'); ?
> />
125 <label
for="checkbox_dump_asfile"><?php
echo __('Save as file'); ?
></label
>
128 <?php
if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?
>
129 <input type
="checkbox" name
="onserver" value
="saveit"
130 id
="checkbox_dump_onserver"
131 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
132 <?php
PMA_exportCheckboxCheck('onserver'); ?
> />
133 <label
for="checkbox_dump_onserver">
134 <?php
echo sprintf(__('Save on server in %s directory'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?
>
136 <input type
="checkbox" name
="onserverover" value
="saveitover"
137 id
="checkbox_dump_onserverover"
138 onclick
="document.getElementById('checkbox_dump_onserver').checked = true;
139 document.getElementById('checkbox_dump_asfile').checked = true;"
140 <?php
PMA_exportCheckboxCheck('onserver_overwrite'); ?
> />
141 <label
for="checkbox_dump_onserverover">
142 <?php
echo __('Overwrite existing file(s)'); ?
></label
>
146 <label
for="filename_template">
148 echo __('File name template');
150 $trans = new PMA_Message
;
151 $trans->addMessage('__SERVER__/');
152 $trans->addString(__('server name'));
153 if ($export_type == 'database' ||
$export_type == 'table') {
154 $trans->addMessage('__DB__/');
155 $trans->addString(__('database name'));
156 if ($export_type == 'table') {
157 $trans->addMessage('__TABLE__/');
158 $trans->addString(__('table name'));
162 $message = 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.'));
163 $message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
164 . __('Documentation') . '">', false);
165 $message->addParam('</a>', false);
166 $message->addParam($trans);
168 echo PMA_showHint($message);
171 <input type
="text" name
="filename_template" id
="filename_template"
174 if ($export_type == 'database') {
175 echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
176 'pma_db_filename_template',
177 $GLOBALS['cfg']['Export']['file_template_database']));
178 } elseif ($export_type == 'table') {
179 echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
180 'pma_table_filename_template',
181 $GLOBALS['cfg']['Export']['file_template_table']));
183 echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
184 'pma_server_filename_template',
185 $GLOBALS['cfg']['Export']['file_template_server']));
192 <input type
="checkbox" name
="remember_template"
193 id
="checkbox_remember_template"
194 <?php
PMA_exportCheckboxCheck('remember_file_template'); ?
> />
195 <label
for="checkbox_remember_template">
196 <?php
echo __('remember template'); ?
></label
>
199 <div
class="formelementrow">
202 if ($cfg['AllowAnywhereRecoding']) {
203 echo ' <label for="select_charset_of_file">'
204 . __('Character set of the file:') . '</label>' . "\n";
206 reset($cfg['AvailableCharsets']);
207 echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
208 foreach ($cfg['AvailableCharsets'] as $temp_charset) {
209 echo '<option value="' . $temp_charset . '"';
210 if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
211 ||
$temp_charset == $cfg['Export']['charset']) {
212 echo ' selected="selected"';
214 echo '>' . $temp_charset . '</option>';
222 // zip, gzip and bzip2 encode features
223 $is_zip = ($cfg['ZipDump'] && @function_exists
('gzcompress'));
224 $is_gzip = ($cfg['GZipDump'] && @function_exists
('gzencode'));
225 $is_bzip = ($cfg['BZipDump'] && @function_exists
('bzcompress'));
227 if ($is_zip ||
$is_gzip ||
$is_bzip) { ?
>
228 <div
class="formelementrow">
229 <?php
echo __('Compression'); ?
>:
230 <input type
="radio" name
="compression" value
="none"
231 id
="radio_compression_none"
232 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
233 <?php
PMA_exportIsActive('compression', 'none'); ?
> />
234 <label
for="radio_compression_none"><?php
echo __('None'); ?
></label
>
237 <input type
="radio" name
="compression" value
="zip"
238 id
="radio_compression_zip"
239 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
240 <?php
PMA_exportIsActive('compression', 'zip'); ?
> />
241 <label
for="radio_compression_zip"><?php
echo __('"zipped"'); ?
></label
>
242 <?php
} if ($is_gzip) { ?
>
243 <input type
="radio" name
="compression" value
="gzip"
244 id
="radio_compression_gzip"
245 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
246 <?php
PMA_exportIsActive('compression', 'gzip'); ?
> />
247 <label
for="radio_compression_gzip"><?php
echo __('"gzipped"'); ?
></label
>
248 <?php
} if ($is_bzip) { ?
>
249 <input type
="radio" name
="compression" value
="bzip"
250 id
="radio_compression_bzip"
251 onclick
="document.getElementById('checkbox_dump_asfile').checked = true;"
252 <?php
PMA_exportIsActive('compression', 'bzip2'); ?
> />
253 <label
for="radio_compression_bzip"><?php
echo __('"bzipped"'); ?
></label
>
257 <input type
="hidden" name
="compression" value
="none" />
261 <?php
if (function_exists('PMA_set_enc_form')) { ?
>
262 <!-- Encoding setting form appended by Y
.Kawada
-->
263 <!-- Japanese encoding setting
-->
264 <?php
echo PMA_set_enc_form(' '); ?
>
267 <fieldset
class="tblFooters">
268 <?php
PMA_externalBug(__('SQL compatibility mode'), 'mysql', '50027', '14515'); ?
>
269 <input type
="submit" value
="<?php echo __('Go'); ?>" id
="buttonGo" />