1 {{ page_settings_error_html|raw }}
2 {{ page_settings_html|raw }}
4 {% block message %}{% endblock %}
6 <div class="exportoptions row" id="header">
8 {{ get_image('b_export', 'Export'|trans) }}
9 {% block title %}{% endblock %}
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' %}">
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() }}
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' %}">
42 <div class="clearfloat"></div>
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' %}">
55 <div class="d-none"></div>
57 <div class="clearfloat"></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>
66 <div class="modal-body">
67 <div id="export_sql_modal_content">
69 <pre id="sql_preview_query">{{ sql_query }}</pre>
73 <div class="modal-footer">
74 <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans 'Close' %}</button>
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>
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' %}
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' %}
107 <div class="exportoptions" id="format">
108 <h3>{% trans 'Format:' %}</h3>
112 {% block selection_options %}{% endblock %}
114 {% if rows is not empty %}
115 <div class="exportoptions" id="rows">
116 <h3>{% trans 'Rows:' %}</h3>
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>
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 -}}
131 {{- rows.number_of_rows -}}
132 {%- endif -%}" onfocus="this.select()">
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()">
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>
150 {% if has_save_dir %}
151 <div class="exportoptions" id="output_quick_export">
152 <h3>{% trans 'Output:' %}</h3>
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 }}
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)' %}
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>
178 <div class="modal-body" style="overflow: auto;">
179 <table class="table align-middle mb-3" id="alias_data">
183 {% trans 'Defined aliases' %}
189 {% for db, db_data in aliases %}
190 {% if db_data.alias is defined and db_data.alias is not null %}
192 <th>{% trans %}Database{% context %}Alias{% endtrans %}</th>
195 <input name="aliases[{{ db }}][alias]" value="{{ db_data.alias }}" type="text">
198 <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
203 {% for table, table_data in db_data.tables ?? [] %}
204 {% if table_data.alias is defined and table_data.alias is not null %}
206 <th>{% trans %}Table{% context %}Alias{% endtrans %}</th>
207 <td>{{ db }}.{{ table }}</td>
209 <input name="aliases[{{ db }}][tables][{{ table }}][alias]" value="{{ table_data.alias }}" type="text">
212 <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
217 {% for column, column_name in table_data.columns ?? [] %}
219 <th>{% trans %}Column{% context %}Alias{% endtrans %}</th>
220 <td>{{ db }}.{{ table }}.{{ column }}</td>
222 <input name="aliases[{{ db }}][tables][{{ table }}][colums][{{ column }}]" value="{{ column_name }}" type="text">
225 <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
233 {# Empty row for javascript manipulations. #}
239 <input name="aliases_new" value="" type="text">
242 <button class="alias_remove btn btn-secondary">{% trans 'Remove' %}</button>
248 <table class="table align-middle">
251 <th colspan="4">{% trans 'Define new aliases' %}</th>
256 <label>{% trans 'Select database:' %}</label>
259 <select id="db_alias_select"><option value=""></option></select>
262 <input id="db_alias_name" placeholder="{% trans 'New database name' %}" disabled="1">
265 <button id="db_alias_button" class="btn btn-secondary" disabled="1">{% trans 'Add' %}</button>
270 <label>{% trans 'Select table:' %}</label>
273 <select id="table_alias_select"><option value=""></option></select>
276 <input id="table_alias_name" placeholder="{% trans 'New table name' %}" disabled="1">
279 <button id="table_alias_button" class="btn btn-secondary" disabled="1">{% trans 'Add' %}</button>
284 <label>{% trans 'Select column:' %}</label>
287 <select id="column_alias_select"><option value=""></option></select>
290 <input id="column_alias_name" placeholder="{% trans 'New column name' %}" disabled="1">
293 <button id="column_alias_button" class="btn btn-secondary" disabled="1">{% trans 'Add' %}</button>
298 <div class="modal-footer">
299 <button type="button" class="btn btn-secondary" id="saveAndCloseBtn" data-bs-dismiss="modal">
300 {% trans 'Save & close' %}
307 <div class="exportoptions" id="output">
308 <h3>{% trans 'Output:' %}</h3>
311 <input type="checkbox" id="btn_alias_config"{{ has_aliases ? ' checked' }}>
312 <label for="btn_alias_config">
313 {% trans 'Rename exported databases/tables/columns' %}
317 {% if export_type != 'server' %}
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 }}
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' %}
333 <ul id="ul_save_asfile">
334 {% if has_save_dir %}
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 }}
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)' %}
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)) }}
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' %}
362 {% if is_encoding_supported %}
364 <label for="select_charset" class="desc">
365 {% trans 'Character set of the file:' %}
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' }}>
378 {% if has_zip or has_gzip %}
380 <label for="compression" class="desc">
381 {% trans 'Compression:' %}
383 <select id="compression" name="compression">
384 <option value="none">{% trans 'None' %}</option>
387 {{- selected_compression == 'zip' ? ' selected' }}>
393 {{- selected_compression == 'gzip' ? ' selected' }}>
394 {% trans 'gzipped' %}
400 <input type="hidden" name="compression" value="{{ selected_compression }}">
403 {% if export_type == 'server' or export_type == 'database' %}
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' %}
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' %}
428 <label for="maxsize">
429 {{- 'Skip tables larger than %s MiB'|trans|format(
430 '</label><input type="text" id="maxsize" name="maxsize" size="4">'
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.' %}
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' %}
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 }}">