Translated using Weblate (Turkish)
[phpmyadmin.git] / templates / export.twig
blob73404a090a1167f46ed5ab51ef75c2a723af3c9e
1 {{ page_settings_error_html|raw }}
2 {{ page_settings_html|raw }}
4 {% block message %}{% endblock %}
6 <div class="exportoptions row" id="header">
7   <h2>
8     {{ get_image('b_export', 'Export'|trans) }}
9     {% block title %}{% endblock %}
10   </h2>
11 </div>
13 {% if templates.is_enabled %}
14   <div class="exportoptions" id="export_templates">
15     <h3>{% trans 'Export templates:' %}</h3>
17     <div class="float-start">
18       <form method="post" action="{{ url('/export/template/create') }}" id="newTemplateForm" class="ajax">
19         <h4>{% trans 'New template:' %}</h4>
20         <input type="text" name="templateName" id="templateName" maxlength="64" placeholder="{% trans 'Template name' %}" required>
21         <input class="btn btn-secondary" type="submit" name="createTemplate" id="createTemplate" value="{% trans 'Create' %}">
22       </form>
23     </div>
25     <div class="float-start" style="margin-left: 50px;">
26       <form method="post" id="existingTemplatesForm" class="ajax">
27         <h4>{% trans 'Existing templates:' %}</h4>
28         <label for="template">{% trans 'Template:' %}</label>
29         <select name="template" id="template" required>
30           <option value="">-- {% trans 'Select a template' %} --</option>
31           {% for template in templates.templates %}
32             <option value="{{ template.getId() }}"{{ template.getId() == templates.selected ? ' selected' }}>
33               {{ template.getName() }}
34             </option>
35           {% endfor %}
36         </select>
37         <input class="btn btn-secondary" type="submit" formaction="{{ url('/export/template/update') }}" name="updateTemplate" id="updateTemplate" value="{% trans 'Update' %}">
38         <input class="btn btn-secondary" type="submit" formaction="{{ url('/export/template/delete') }}" name="deleteTemplate" id="deleteTemplate" value="{% trans 'Delete' %}">
39       </form>
40     </div>
42     <div class="clearfloat"></div>
43   </div>
44 {% endif %}
46 {% if sql_query is not empty %}
47   <div class="exportoptions">
48     {# l10n: Title of the option on the Export page #}
49     <h3>{% trans 'SQL query:' %}</h3>
50     <div class="float-start">
51       <div id="sqlqueryform">
52         {# l10n: Button to show the SQL query on the export page #}
53         <input class="btn btn-secondary" type="submit" id="showsqlquery" value="{% trans 'Show SQL query' %}">
54       </div>
55       <div class="d-none"></div>
56     </div>
57     <div class="clearfloat"></div>
58   </div>
59   <div class="modal fade" id="showSqlQueryModal" tabindex="-1" aria-labelledby="showSqlQueryModalLabel" aria-hidden="true">
60     <div class="modal-dialog">
61       <div class="modal-content">
62         <div class="modal-header">
63           <h5 class="modal-title" id="showSqlQueryModalLabel">{% trans 'Loading' %}</h5>
64           <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans 'Close' %}"></button>
65         </div>
66         <div class="modal-body">
67           <div id="export_sql_modal_content">
68             <code class="sql">
69               <pre id="sql_preview_query">{{ sql_query }}</pre>
70             </code>
71           </div>
72         </div>
73         <div class="modal-footer">
74           <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans 'Close' %}</button>
75         </div>
76       </div>
77     </div>
78   </div>
79 {% endif %}
81 <form method="post" action="{{ url('/export') }}" name="dump" class="disableAjax">
82   {{ get_hidden_inputs(hidden_inputs) }}
84   {% if export_method != 'custom-no-form' %}
85     <div class="exportoptions" id="quick_or_custom">
86       <h3>{% trans 'Export method:' %}</h3>
87       <ul>
88         <li>
89           <input type="radio" name="quick_or_custom" value="quick" id="radio_quick_export"
90             {{- export_method == 'quick' ? ' checked' }}>
91           <label for="radio_quick_export">
92             {% trans 'Quick - display only the minimal options' %}
93           </label>
94         </li>
96         <li>
97           <input type="radio" name="quick_or_custom" value="custom" id="radio_custom_export"
98             {{- export_method == 'custom' ? ' checked' }}>
99           <label for="radio_custom_export">
100             {% trans 'Custom - display all possible options' %}
101           </label>
102         </li>
103       </ul>
104     </div>
105   {% endif %}
107   <div class="exportoptions" id="format">
108     <h3>{% trans 'Format:' %}</h3>
109     {{ dropdown|raw }}
110   </div>
112   {% block selection_options %}{% endblock %}
114   {% if rows is not empty %}
115     <div class="exportoptions" id="rows">
116       <h3>{% trans 'Rows:' %}</h3>
117       <ul>
118         <li>
119           <input type="radio" name="allrows" value="0" id="radio_allrows_0"
120             {{- rows.allrows is not null and rows.allrows == 0 ? ' checked' }}>
121           <label for="radio_allrows_0">{% trans 'Dump some row(s)' %}</label>
122           <ul>
123             <li>
124               <label for="limit_to">{% trans 'Number of rows:' %}</label>
125               <input type="text" id="limit_to" name="limit_to" size="5" value="
126                 {%- if rows.limit_to is not null -%}
127                   {{- rows.limit_to -}}
128                 {%- elseif rows.unlim_num_rows is not empty and rows.unlim_num_rows != 0 -%}
129                   {{- rows.unlim_num_rows -}}
130                 {%- else %}
131                   {{- rows.number_of_rows -}}
132                 {%- endif -%}" onfocus="this.select()">
133             </li>
134             <li>
135               <label for="limit_from">{% trans 'Row to begin at:' %}</label>
136               <input type="text" id="limit_from" name="limit_from" size="5" value="
137               {{- rows.limit_from is not null ? rows.limit_from : 0 }}" onfocus="this.select()">
138             </li>
139           </ul>
140         </li>
141         <li>
142           <input type="radio" name="allrows" value="1" id="radio_allrows_1"
143             {{- rows.allrows is null or rows.allrows == 1 ? ' checked' }}>
144           <label for="radio_allrows_1">{% trans 'Dump all rows' %}</label>
145         </li>
146       </ul>
147     </div>
148   {% endif %}
150   {% if has_save_dir %}
151     <div class="exportoptions" id="output_quick_export">
152       <h3>{% trans 'Output:' %}</h3>
153       <ul>
154         <li>
155           <input type="checkbox" name="quick_export_onserver" value="saveit" id="checkbox_quick_dump_onserver"{{ export_is_checked ? ' checked' }}>
156           <label for="checkbox_quick_dump_onserver">
157             {{ 'Save on server in the directory <strong>%s</strong>'|trans|format(save_dir|e)|raw }}
158           </label>
159         </li>
160         <li>
161           <input type="checkbox" name="quick_export_onserver_overwrite" value="saveitover" id="checkbox_quick_dump_onserver_overwrite"
162             {{- export_overwrite_is_checked ? ' checked' }}>
163           <label for="checkbox_quick_dump_onserver_overwrite">
164             {% trans 'Overwrite existing file(s)' %}
165           </label>
166         </li>
167       </ul>
168     </div>
169   {% endif %}
171   <div class="modal fade" id="renameExportModal" tabindex="-1" aria-labelledby="renameExportModalLabel" aria-hidden="true">
172     <div class="modal-dialog">
173       <div class="modal-content">
174         <div class="modal-header">
175           <h5 class="modal-title" id="renameExportModalLabel">{% trans 'Rename exported databases/tables/columns' %}</h5>
176           <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans 'Close' %}"></button>
177         </div>
178         <div class="modal-body" style="overflow: auto;">
179           <table class="table align-middle mb-3" id="alias_data">
180             <thead>
181             <tr>
182               <th colspan="4">
183                 {% trans 'Defined aliases' %}
184               </th>
185             </tr>
186             </thead>
188             <tbody>
189             {% for db, db_data in aliases %}
190               {% if db_data.alias is defined and db_data.alias is not null %}
191                 <tr>
192                   <th>{% trans %}Database{% context %}Alias{% endtrans %}</th>
193                   <td>{{ db }}</td>
194                   <td>
195                     <input name="aliases[{{ db }}][alias]" value="{{ db_data.alias }}" type="text">
196                   </td>
197                   <td>
198                     <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
199                   </td>
200                 </tr>
201               {% endif %}
203               {% for table, table_data in db_data.tables ?? [] %}
204                 {% if table_data.alias is defined and table_data.alias is not null %}
205                   <tr>
206                     <th>{% trans %}Table{% context %}Alias{% endtrans %}</th>
207                     <td>{{ db }}.{{ table }}</td>
208                     <td>
209                       <input name="aliases[{{ db }}][tables][{{ table }}][alias]" value="{{ table_data.alias }}" type="text">
210                     </td>
211                     <td>
212                       <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
213                     </td>
214                   </tr>
215                 {% endif %}
217                 {% for column, column_name in table_data.columns ?? [] %}
218                   <tr>
219                     <th>{% trans %}Column{% context %}Alias{% endtrans %}</th>
220                     <td>{{ db }}.{{ table }}.{{ column }}</td>
221                     <td>
222                       <input name="aliases[{{ db }}][tables][{{ table }}][colums][{{ column }}]" value="{{ column_name }}" type="text">
223                     </td>
224                     <td>
225                       <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
226                     </td>
227                   </tr>
228                 {% endfor %}
229               {% endfor %}
230             {% endfor %}
231             </tbody>
233             {# Empty row for javascript manipulations. #}
234             <tfoot class="hide">
235             <tr>
236               <th></th>
237               <td></td>
238               <td>
239                 <input name="aliases_new" value="" type="text">
240               </td>
241               <td>
242                 <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
243               </td>
244             </tr>
245             </tfoot>
246           </table>
248           <table class="table align-middle">
249             <thead>
250             <tr>
251               <th colspan="4">{% trans 'Define new aliases' %}</th>
252             </tr>
253             </thead>
254             <tr>
255               <td>
256                 <label>{% trans 'Select database:' %}</label>
257               </td>
258               <td>
259                 <select id="db_alias_select"><option value=""></option></select>
260               </td>
261               <td>
262                 <input id="db_alias_name" placeholder="{% trans 'New database name' %}" disabled="1">
263               </td>
264               <td>
265                 <button id="db_alias_button" class="btn btn-secondary" disabled="1">{% trans 'Add' %}</button>
266               </td>
267             </tr>
268             <tr>
269               <td>
270                 <label>{% trans 'Select table:' %}</label>
271               </td>
272               <td>
273                 <select id="table_alias_select"><option value=""></option></select>
274               </td>
275               <td>
276                 <input id="table_alias_name" placeholder="{% trans 'New table name' %}" disabled="1">
277               </td>
278               <td>
279                 <button id="table_alias_button" class="btn btn-secondary" disabled="1">{% trans 'Add' %}</button>
280               </td>
281             </tr>
282             <tr>
283               <td>
284                 <label>{% trans 'Select column:' %}</label>
285               </td>
286               <td>
287                 <select id="column_alias_select"><option value=""></option></select>
288               </td>
289               <td>
290                 <input id="column_alias_name" placeholder="{% trans 'New column name' %}" disabled="1">
291               </td>
292               <td>
293                 <button id="column_alias_button" class="btn btn-secondary" disabled="1">{% trans 'Add' %}</button>
294               </td>
295             </tr>
296           </table>
297         </div>
298         <div class="modal-footer">
299           <button type="button" class="btn btn-secondary" id="saveAndCloseBtn" data-bs-dismiss="modal">
300             {% trans 'Save & close' %}
301           </button>
302         </div>
303       </div>
304     </div>
305   </div>
307   <div class="exportoptions" id="output">
308     <h3>{% trans 'Output:' %}</h3>
309     <ul id="ul_output">
310       <li>
311         <input type="checkbox" id="btn_alias_config"{{ has_aliases ? ' checked' }}>
312         <label for="btn_alias_config">
313           {% trans 'Rename exported databases/tables/columns' %}
314         </label>
315       </li>
317       {% if export_type != 'server' %}
318         <li>
319           <input type="checkbox" name="lock_tables" value="something" id="checkbox_lock_tables"
320             {{- (not repopulate and is_checked_lock_tables) or lock_tables ? ' checked' }}>
321           <label for="checkbox_lock_tables">
322             {{ 'Use %s statement'|trans|format('<code>LOCK TABLES</code>')|raw }}
323           </label>
324         </li>
325       {% endif %}
327       <li>
328         <input type="radio" name="output_format" value="sendit" id="radio_dump_asfile"
329           {{- not repopulate and is_checked_asfile ? ' checked' }}>
330         <label for="radio_dump_asfile">
331           {% trans 'Save output to a file' %}
332         </label>
333         <ul id="ul_save_asfile">
334           {% if has_save_dir %}
335             <li>
336               <input type="checkbox" name="onserver" value="saveit" id="checkbox_dump_onserver"{{ is_checked_export ? ' checked' }}>
337               <label for="checkbox_dump_onserver">
338                 {{ 'Save on server in the directory <strong>%s</strong>'|trans|format(save_dir|e)|raw }}
339               </label>
340             </li>
341             <li>
342               <input type="checkbox" name="onserver_overwrite" value="saveitover" id="checkbox_dump_onserver_overwrite"
343                 {{- is_checked_export_overwrite ? ' checked' }}>
344               <label for="checkbox_dump_onserver_overwrite">
345                 {% trans 'Overwrite existing file(s)' %}
346               </label>
347             </li>
348           {% endif %}
350           <li>
351             <label for="filename_template" class="desc">
352               {% trans 'File name template:' %}
353               {{ show_hint('This value is interpreted using the \'strftime\' function, so you can use time formatting strings. Additionally the following transformations will happen: %s Other text will be kept as is. See the FAQ 6.27 for details.'|trans|format(filename_hint)) }}
354             </label>
355             <input type="text" name="filename_template" id="filename_template" value="{{ filename_template }}">
356             <input type="checkbox" name="remember_template" id="checkbox_remember_template"{{ is_checked_remember_file_template ? ' checked' }}>
357             <label for="checkbox_remember_template">
358               {% trans 'use this for future exports' %}
359             </label>
360           </li>
362           {% if is_encoding_supported %}
363             <li>
364               <label for="select_charset" class="desc">
365                 {% trans 'Character set of the file:' %}
366               </label>
367               <select id="select_charset" name="charset" size="1">
368                 {% for charset in encodings %}
369                   <option value="{{ charset }}"
370                     {{- (export_charset is empty and charset == 'utf-8') or charset == export_charset ? ' selected' }}>
371                     {{- charset -}}
372                   </option>
373                 {% endfor %}
374               </select>
375             </li>
376           {% endif %}
378           {% if has_zip or has_gzip %}
379             <li>
380               <label for="compression" class="desc">
381                 {% trans 'Compression:' %}
382               </label>
383               <select id="compression" name="compression">
384                 <option value="none">{% trans 'None' %}</option>
385                 {% if has_zip %}
386                   <option value="zip"
387                     {{- selected_compression == 'zip' ? ' selected' }}>
388                     {% trans 'zipped' %}
389                   </option>
390                 {% endif %}
391                 {% if has_gzip %}
392                   <option value="gzip"
393                     {{- selected_compression == 'gzip' ? ' selected' }}>
394                     {% trans 'gzipped' %}
395                   </option>
396                 {% endif %}
397               </select>
398             </li>
399           {% else %}
400             <input type="hidden" name="compression" value="{{ selected_compression }}">
401           {% endif %}
403           {% if export_type == 'server' or export_type == 'database' %}
404             <li>
405               <input type="checkbox" id="checkbox_as_separate_files" name="as_separate_files" value="{{ export_type }}"
406                 {{- is_checked_as_separate_files ? ' checked' }}>
407               <label for="checkbox_as_separate_files">
408                 {% if export_type == 'server' %}
409                   {% trans 'Export databases as separate files' %}
410                 {% elseif export_type == 'database' %}
411                   {% trans 'Export tables as separate files' %}
412                 {% endif %}
413               </label>
414             </li>
415           {% endif %}
416         </ul>
417       </li>
419       <li>
420         <input type="radio" id="radio_view_as_text" name="output_format" value="astext"
421           {{- repopulate or export_asfile == false ? ' checked' }}>
422         <label for="radio_view_as_text">
423           {% trans 'View output as text' %}
424         </label>
425       </li>
426     </ul>
428     <label for="maxsize">
429       {{- 'Skip tables larger than %s MiB'|trans|format(
430         '</label><input type="text" id="maxsize" name="maxsize" size="4">'
431       )|raw }}
432   </div>
434   <div class="exportoptions" id="format_specific_opts">
435     <h3>{% trans 'Format-specific options:' %}</h3>
436     <p class="no_js_msg" id="scroll_to_options_msg">
437       {% trans 'Scroll down to fill in the options for the selected format and ignore the options for other formats.' %}
438     </p>
439     {{ options|raw }}
440   </div>
442   {% if can_convert_kanji %}
443     {# Japanese encoding setting #}
444     <div class="exportoptions" id="kanji_encoding">
445       <h3>{% trans 'Encoding Conversion:' %}</h3>
446       {% include 'encoding/kanji_encoding_form.twig' %}
447     </div>
448   {% endif %}
450   <div class="exportoptions justify-content-end" id="submit">
451     <input id="buttonGo" class="btn btn-primary" type="submit" value="{% trans 'Go' %}" data-exec-time-limit="{{ exec_time_limit }}">
452   </div>
453 </form>