Translated using Weblate (Dutch)
[phpmyadmin.git] / templates / import.twig
blob87671a85265572f299119872ccf4a5f3f8f64f40
1 {{ page_settings_error_html|raw }}
2 {{ page_settings_html|raw }}
4 <iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" class="hide"></iframe>
5 <div id="import_form_status" class="hide"></div>
6 <div id="importmain" class="container-fluid">
7     <img src="{{ image('ajax_clock_small.gif') }}" width="16" height="16" alt="ajax clock" class="hide">
9     <script type="text/javascript">
10         //<![CDATA[
11         {% include 'import/javascript.twig' with {
12             'upload_id': upload_id,
13             'handler': handler,
14         } only %}
15         //]]>
16     </script>
18     <form id="import_file_form"
19         action="{{ url('/import') }}"
20         method="post"
21         enctype="multipart/form-data"
22         name="import"
23         class="ajax"
24         {%- if handler != 'PhpMyAdmin\\Plugins\\Import\\Upload\\UploadNoplugin' %}
25             target="import_upload_iframe"
26         {%- endif %}>
28         {{ get_hidden_inputs(hidden_inputs) }}
30         <div class="exportoptions" id="header">
31             <h2>
32                 {{ get_image('b_import', 'Import'|trans) }}
33                 {% block title %}{% endblock %}
34             </h2>
35         </div>
37         <div class="importoptions">
38             <h3>{% trans 'File to import:' %}</h3>
40             {# We don't have show anything about compression, when no supported #}
41             {% if compressions is not empty %}
42                 <div class="formelementrow" id="compression_info">
43                     <p>
44                         {{ 'File may be compressed (%s) or uncompressed.'|trans|format(compressions|join(', ')) }}
45                         <br>
46                         {% trans 'A compressed file\'s name must end in <strong>.[format].[compression]</strong>. Example: <strong>.sql.zip</strong>' %}
47                     </p>
48                 </div>
49             {% endif %}
51             <div class="formelementrow" id="upload_form">
52                 {% if is_upload and upload_dir is not empty %}
53                     <ul>
54                         <li>
55                             <input type="radio" name="file_location" id="radio_import_file" required="required">
56                             <label for="radio_import_file">{% trans 'Browse your computer:' %}</label>
58                             <div id="upload_form_status" class="hide"></div>
59                             <div id="upload_form_status_info" class="hide"></div>
61                             <input type="file" name="import_file" id="input_import_file" aria-label="{% trans 'Browse your computer' %}">
63                             {{ get_formatted_maximum_upload_size(max_upload_size) }}
65                             <input type="hidden" name="MAX_FILE_SIZE" value="{{ max_upload_size }}">
67                             <p>{% trans 'You may also drag and drop a file on any page.' %}</p>
68                         </li>
69                         <li>
70                           <input type="radio" name="file_location" id="radio_local_import_file"
71                             {{- timeout_passed_global is not empty and local_import_file is not empty ? ' checked' }}>
72                           <label for="radio_local_import_file">
73                             {{ 'Select from the web server upload directory [strong]%s[/strong]:'|trans|format(user_upload_dir)|sanitize }}
74                           </label>
76                           {% if local_files is same as(false) %}
77                             {{ 'The directory you set for upload work cannot be reached.'|trans|error }}
78                           {% elseif local_files is not empty %}
79                             <select size="1" name="local_import_file" id="select_local_import_file" aria-label="{% trans 'Select file to import' %}">
80                               <option value=""></option>
81                               {{ local_files|raw }}
82                             </select>
83                           {% else %}
84                             <em>{% trans 'There are no files to upload!' %}</em>
85                           {% endif %}
86                         </li>
87                     </ul>
88                 {% elseif is_upload %}
89                     <label for="input_import_file">{% trans 'Browse your computer:' %}</label>
91                     <div id="upload_form_status" class="hide"></div>
92                     <div id="upload_form_status_info" class="hide"></div>
94                     <input type="file" name="import_file" id="input_import_file">
96                     {{ get_formatted_maximum_upload_size(max_upload_size) }}
98                     <input type="hidden" name="MAX_FILE_SIZE" value="{{ max_upload_size }}">
100                     <p>{% trans 'You may also drag and drop a file on any page.' %}</p>
101                 {% elseif upload_dir is not empty %}
102                   <label for="select_local_import_file">
103                     {{ 'Select from the web server upload directory [strong]%s[/strong]:'|trans|format(user_upload_dir)|sanitize }}
104                   </label>
106                   {% if local_files is same as(false) %}
107                     {{ 'The directory you set for upload work cannot be reached.'|trans|error }}
108                   {% elseif local_files is not empty %}
109                     <select size="1" name="local_import_file" id="select_local_import_file">
110                       <option value=""></option>
111                       {{ local_files|raw }}
112                     </select>
113                   {% else %}
114                     <em>{% trans 'There are no files to upload!' %}</em>
115                   {% endif %}
116                 {% else %}
117                     {{ 'File uploads are not allowed on this server.'|trans|notice }}
118                 {% endif %}
119             </div>
121             <div class="formelementrow" id="charaset_of_file">
122                 {# Charset of file #}
123                 <label for="charset_of_file">{% trans 'Character set of the file:' %}</label>
124                 {% if is_encoding_supported %}
125                     <select id="charset_of_file" name="charset_of_file" size="1">
126                         {% for charset in encodings %}
127                             <option value="{{ charset }}"
128                                 {% if (import_charset is empty and charset == 'utf-8')
129                                     or charset == import_charset %}
130                                     selected="selected"
131                                 {% endif %}>
132                                 {{ charset }}
133                             </option>
134                         {% endfor %}
135                     </select>
136                 {% else %}
137                   <select lang="en" dir="ltr" name="charset_of_file" id="charset_of_file">
138                     <option value=""></option>
139                     {% for charset in charsets %}
140                       <option value="{{ charset.name }}" title="{{ charset.description }}"
141                         {{- charset.name == 'utf8' ? ' selected' }}>
142                         {{- charset.name -}}
143                       </option>
144                     {% endfor %}
145                   </select>
146                 {% endif %}
147             </div>
148         </div>
150         <div class="importoptions">
151             <h3>{% trans 'Partial import:' %}</h3>
153             {% if timeout_passed is defined and timeout_passed %}
154                 <div class="formelementrow">
155                     <input type="hidden" name="skip" value="{{ offset }}">
156                     {{ 'Previous import timed out, after resubmitting will continue from position %d.'|trans|format(offset) }}
157                 </div>
158             {% endif %}
160             <div class="formelementrow">
161                 <input type="checkbox" name="allow_interrupt" value="yes" id="checkbox_allow_interrupt"{{ is_allow_interrupt_checked|raw }}>
162                 <label for="checkbox_allow_interrupt">
163                     {% trans 'Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. <em>(This might be a good way to import large files, however it can break transactions.)</em>' %}
164                 </label>
165             </div>
167             {% if not (timeout_passed is defined and timeout_passed) %}
168                 <div class="formelementrow">
169                     <label for="text_skip_queries">
170                         {% trans 'Skip this number of queries (for SQL) starting from the first one:' %}
171                     </label>
172                     <input type="number" name="skip_queries" value="
173                         {{- skip_queries_default|raw -}}
174                         " id="text_skip_queries" min="0">
175                 </div>
176             {% else %}
177                 {# If timeout has passed,
178                    do not show the Skip dialog to avoid the risk of someone
179                    entering a value here that would interfere with "skip" #}
180                 <input type="hidden" name="skip_queries" value="
181                     {{- skip_queries_default|raw -}}
182                     " id="text_skip_queries">
183             {% endif %}
184         </div>
186         <div class="importoptions">
187             <h3>{% trans 'Other options:' %}</h3>
188             <div class="formelementrow">
189                 <input type="hidden" name="fk_checks" value="0">
190                 <input type="checkbox" name="fk_checks" id="fk_checks" value="1"{{ is_foreign_key_check ? ' checked' }}>
191                 <label for="fk_checks">{% trans 'Enable foreign key checks' %}</label>
192             </div>
193         </div>
195         <div class="importoptions">
196             <h3>{% trans 'Format:' %}</h3>
197             <select id="plugins" name="format">
198               {% for option in plugins_choice %}
199                 <option value="{{ option.name }}"{{ option.is_selected ? ' selected' }}>{{ option.text }}</option>
200               {% endfor %}
201             </select>
203             {% for option in plugins_choice %}
204               <input type="hidden" id="force_file_{{ option.name }}" value="true">
205             {% endfor %}
207             <div id="import_notification"></div>
208         </div>
210         <div class="importoptions" id="format_specific_opts">
211             <h3>{% trans 'Format-specific options:' %}</h3>
212             <p class="no_js_msg" id="scroll_to_options_msg">
213                 {% trans 'Scroll down to fill in the options for the selected format and ignore the options for other formats.' %}
214             </p>
215             {{ options|raw }}
216         </div>
217         <div class="clearfloat"></div>
219         {# Japanese encoding setting #}
220         {% if can_convert_kanji %}
221             <div class="importoptions" id="kanji_encoding">
222                 <h3>{% trans 'Encoding Conversion:' %}</h3>
223                 {% include 'encoding/kanji_encoding_form.twig' %}
224             </div>
225         {% endif %}
227         <div class="importoptions justify-content-end" id="submit">
228             <input id="buttonGo" class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
229         </div>
230     </form>
231 </div>