2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 if (! defined('PHPMYADMIN')) {
14 require_once './libraries/file_listing.php';
15 require_once './libraries/plugin_interface.lib.php';
17 /* Scan for plugins */
18 $import_list = PMA_getPlugins('./libraries/import/', $import_type);
20 /* Fail if we didn't find any plugin */
21 if (empty($import_list)) {
22 $GLOBALS['show_error_header'] = TRUE;
23 PMA_showMessage($strCanNotLoadImportPlugins);
24 unset($GLOBALS['show_error_header']);
25 require './libraries/footer.inc.php';
29 <form action
="import.php" method
="post" enctype
="multipart/form-data" name
="import">
31 if ($import_type == 'server') {
32 echo PMA_generate_common_hidden_inputs('', '', 1);
33 } elseif ($import_type == 'database') {
34 echo PMA_generate_common_hidden_inputs($db, '', 1);
36 echo PMA_generate_common_hidden_inputs($db, $table, 1);
38 echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />';
39 echo PMA_pluginGetJavascript($import_list);
42 <h2
><?php
echo $strImport; ?
></h2
>
44 <!-- File name
, and some other common options
-->
45 <fieldset
class="options">
46 <legend
><?php
echo $strFileToImport; ?
></legend
>
49 if ($GLOBALS['is_upload']) {
51 <div
class="formelementrow">
52 <label
for="input_import_file"><?php
echo $strLocationTextfile; ?
></label
>
53 <input style
="margin: 5px" type
="file" name
="import_file" id
="input_import_file" onchange
="match_file(this.value);" />
55 echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
56 // some browsers should respect this :)
57 echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
59 echo '<div class="warning">' . "\n";
60 echo $strUploadsNotAllowed . "\n";
65 if (!empty($cfg['UploadDir'])) {
67 foreach ($import_list as $key => $val) {
68 if (!empty($extensions)) {
71 $extensions .= $val['extension'];
73 $matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
75 $files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ?
$local_import_file : '');
76 echo '<div class="formelementrow">' . "\n";
77 if ($files === FALSE) {
78 echo ' <div class="warning">' . "\n";
79 echo ' <strong>' . $strError . '</strong>: ' . "\n";
80 echo ' ' . $strWebServerUploadDirectoryError . "\n";
81 echo ' </div>' . "\n";
82 } elseif (!empty($files)) {
84 echo ' <i>' . $strOr . '</i><br/><label for="select_local_import_file">' . $strWebServerUploadDirectory . '</label> : ' . "\n";
85 echo ' <select style="margin: 5px" size="1" name="local_import_file" onchange="match_file(this.value)" id="select_local_import_file">' . "\n";
86 echo ' <option value=""> </option>' . "\n";
88 echo ' </select>' . "\n";
91 } // end if (web-server upload directory)
94 echo '<div class="formelementrow">' . "\n";
95 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
96 echo '<label for="charset_of_file">' . $strCharsetOfFile . '</label>' . "\n";
97 $temp_charset = reset($cfg['AvailableCharsets']);
98 echo ' <select id="charset_of_file" name="charset_of_file" size="1">' . "\n"
99 . ' <option value="' . htmlentities($temp_charset) . '"';
100 if ($temp_charset == $charset) {
101 echo ' selected="selected"';
103 echo '>' . htmlentities($temp_charset) . '</option>' . "\n";
104 while ($temp_charset = next($cfg['AvailableCharsets'])) {
105 echo ' <option value="' . htmlentities($temp_charset) . '"';
106 if ($temp_charset == $charset) {
107 echo ' selected="selected"';
109 echo '>' . htmlentities($temp_charset) . '</option>' . "\n";
111 echo ' </select><br />' . "\n" . ' ';
112 } elseif (PMA_MYSQL_INT_VERSION
>= 40100) {
113 echo '<label for="charset_of_file">' . $strCharsetOfFile . '</label>' . "\n";
114 echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET
, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
115 } // end if (recoding)
116 echo '</div>' . "\n";
118 // zip, gzip and bzip2 encode features
119 $compressions = $strNone;
121 if ($cfg['GZipDump'] && @function_exists
('gzopen')) {
122 $compressions .= ', gzip';
124 if ($cfg['BZipDump'] && @function_exists
('bzopen')) {
125 $compressions .= ', bzip2';
127 if ($cfg['ZipDump'] && @function_exists
('gzinflate')) {
128 $compressions .= ', zip';
131 // We don't have show anything about compression, when no supported
132 if ($compressions != $strNone) {
133 echo '<div class="formelementrow">' . "\n";
134 printf($strCompressionWillBeDetected, $compressions);
135 echo '</div>' . "\n";
140 <fieldset
class="options">
141 <legend
><?php
echo $strPartialImport; ?
></legend
>
144 if (isset($timeout_passed) && $timeout_passed) {
145 echo '<div class="formelementrow">' . "\n";
146 echo '<input type="hidden" name="skip" value="' . $offset . '" />';
147 echo sprintf($strTimeoutInfo, $offset) . '';
148 echo '</div>' . "\n";
151 <div
class="formelementrow">
152 <input type
="checkbox" name
="allow_interrupt" value
="yes"
153 id
="checkbox_allow_interrupt" <?php
echo PMA_pluginCheckboxCheck('Import', 'allow_interrupt'); ?
>/>
154 <label
for="checkbox_allow_interrupt"><?php
echo $strAllowInterrupt; ?
></label
><br
/>
158 if (! (isset($timeout_passed) && $timeout_passed)) {
160 <div
class="formelementrow">
161 <label
for="text_skip_queries"><?php
echo $strSkipQueries; ?
></label
>
162 <input type
="text" name
="skip_queries" value
="<?php echo PMA_pluginGetDefault('Import', 'skip_queries');?>" id
="text_skip_queries" />
166 // If timeout has passed,
167 // do not show the Skip dialog to avoid the risk of someone
168 // entering a value here that would interfere with "skip"
170 <input type
="hidden" name
="skip_queries" value
="<?php echo PMA_pluginGetDefault('Import', 'skip_queries');?>" id
="text_skip_queries" />
176 <fieldset
class="options">
177 <legend
><?php
echo $strImportFormat; ?
></legend
>
179 // Let's show format options now
180 echo '<div style="float: left;">';
181 echo PMA_pluginGetChoice('Import', 'format', $import_list);
184 echo '<div style="float: left;">';
185 echo PMA_pluginGetOptions('Import', $import_list);
188 <div
class="clearfloat"></div
>
191 // Encoding setting form appended by Y.Kawada
192 if (function_exists('PMA_set_enc_form')) {
193 echo PMA_set_enc_form(' ');
197 <fieldset
class="tblFooters">
198 <input type
="submit" value
="<?php echo $strGo; ?>" id
="buttonGo" />
201 <script type
="text/javascript">