Refactor Util Twig extensions

Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
This commit is contained in:
Leonardo Strozzi 2018-08-02 17:13:48 -03:00
parent b65ede42ee
commit 1037b1d626
55 changed files with 254 additions and 247 deletions

View File

@ -11,6 +11,7 @@ namespace PhpMyAdmin\Twig;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\TwigFilter;
/**
* Class UtilExtension
@ -28,164 +29,170 @@ class UtilExtension extends AbstractExtension
{
return [
new TwigFunction(
'Util_backquote',
'backquote',
'PhpMyAdmin\Util::backquote'
),
new TwigFunction(
'Util_getBrowseUploadFileBlock',
'get_browse_upload_file_block',
'PhpMyAdmin\Util::getBrowseUploadFileBlock',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_convertBitDefaultValue',
'PhpMyAdmin\Util::convertBitDefaultValue'
),
new TwigFunction(
'Util_escapeMysqlWildcards',
'PhpMyAdmin\Util::escapeMysqlWildcards'
),
new TwigFunction(
'Util_extractColumnSpec',
'extract_column_spec',
'PhpMyAdmin\Util::extractColumnSpec'
),
new TwigFunction(
'Util_formatByteDown',
'format_byte_down',
'PhpMyAdmin\Util::formatByteDown'
),
new TwigFunction(
'Util_formatNumber',
'format_number',
'PhpMyAdmin\Util::formatNumber'
),
new TwigFunction(
'Util_formatSql',
'format_sql',
'PhpMyAdmin\Util::formatSql',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getButtonOrImage',
'get_button_or_image',
'PhpMyAdmin\Util::getButtonOrImage',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getClassForType',
'get_class_for_type',
'PhpMyAdmin\Util::getClassForType',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getDivForSliderEffect',
'get_div_for_slider_effect',
'PhpMyAdmin\Util::getDivForSliderEffect',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getDocuLink',
'get_docu_link',
'PhpMyAdmin\Util::getDocuLink',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getListNavigator',
'get_list_navigator',
'PhpMyAdmin\Util::getListNavigator',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_showDocu',
'show_docu',
'PhpMyAdmin\Util::showDocu',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getDropdown',
'get_dropdown',
'PhpMyAdmin\Util::getDropdown',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getFKCheckbox',
'get_fk_checkbox',
'PhpMyAdmin\Util::getFKCheckbox',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getGISDatatypes',
'get_gis_datatypes',
'PhpMyAdmin\Util::getGISDatatypes'
),
new TwigFunction(
'Util_getGISFunctions',
'get_gis_functions',
'PhpMyAdmin\Util::getGISFunctions'
),
new TwigFunction(
'Util_getHtmlTab',
'get_html_tab',
'PhpMyAdmin\Util::getHtmlTab',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getIcon',
'get_icon',
'PhpMyAdmin\Util::getIcon',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getImage',
'get_image',
'PhpMyAdmin\Util::getImage',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getRadioFields',
'get_radio_fields',
'PhpMyAdmin\Util::getRadioFields',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getSelectUploadFileBlock',
'get_select_upload_file_block',
'PhpMyAdmin\Util::getSelectUploadFileBlock',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getScriptNameForOption',
'get_script_name_for_option',
'PhpMyAdmin\Util::getScriptNameForOption',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getStartAndNumberOfRowsPanel',
'get_start_and_number_of_rows_panel',
'PhpMyAdmin\Util::getStartAndNumberOfRowsPanel',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_getSupportedDatatypes',
'get_supported_datatypes',
'PhpMyAdmin\Util::getSupportedDatatypes',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_isForeignKeySupported',
'is_foreign_key_supported',
'PhpMyAdmin\Util::isForeignKeySupported'
),
new TwigFunction(
'Util_linkOrButton',
'link_or_button',
'PhpMyAdmin\Util::linkOrButton',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_localisedDate',
'localised_date',
'PhpMyAdmin\Util::localisedDate'
),
new TwigFunction(
'Util_showHint',
'show_hint',
'PhpMyAdmin\Util::showHint',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_showDocu',
'PhpMyAdmin\Util::showDocu',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_showIcons',
'show_icons',
'PhpMyAdmin\Util::showIcons'
),
new TwigFunction(
'Util_showMySQLDocu',
'show_mysql_docu',
'PhpMyAdmin\Util::showMySQLDocu',
['is_safe' => ['html']]
),
new TwigFunction(
'Util_sortableTableHeader',
'sortable_table_header',
'PhpMyAdmin\Util::sortableTableHeader',
['is_safe' => ['html']]
),
];
}
/**
* Returns a list of filters to add to the existing list.
*
* @return TwigFilter[]
*/
public function getFilters()
{
return [
new TwigFilter(
'convert_bit_default_value',
'PhpMyAdmin\Util::convertBitDefaultValue'
),
new TwigFilter(
'escape_mysql_wildcards',
'PhpMyAdmin\Util::convertBitDefaultValue'
),
];
}
}

View File

@ -75,12 +75,12 @@
<td width="25">&nbsp;</td>
<th>
{% trans 'Storage Engine:' %}
{{ Util_showMySQLDocu('Storage_engines') }}
{{ show_mysql_docu('Storage_engines') }}
</th>
<td width="25">&nbsp;</td>
<th>
{% trans 'Connection:' %}
{{ Util_showMySQLDocu('federated-create-connection') }}
{{ show_mysql_docu('federated-create-connection') }}
</th>
</tr>
<tr>
@ -126,7 +126,7 @@
<tr class="vtop">
<th colspan="5">
{% trans 'PARTITION definition:' %}
{{ Util_showMySQLDocu('Partitioning') }}
{{ show_mysql_docu('Partitioning') }}
</th>
</tr>
<tr>

View File

@ -4,5 +4,5 @@
{%- if column_meta['column_status'] is defined and not column_meta['column_status']['isEditable'] -%}
disabled="disabled"
{%- endif %}>
{{ Util_getSupportedDatatypes(true, type_upper) }}
{{ get_supported_datatypes(true, type_upper) }}
</select>

View File

@ -9,7 +9,7 @@
{% for mi in 0..move_columns|length - 1 %}
<option value="{{ move_columns[mi].name }}"
{{- current_index == mi or current_index == mi + 1 ? ' disabled="disabled"' }}>
{{ 'after %s'|trans|format(Util_backquote(move_columns[mi].name|e)) }}
{{ 'after %s'|trans|format(backquote(move_columns[mi].name|e)) }}
</option>
{% endfor %}
</select>

View File

@ -2,7 +2,7 @@
<table id="table_columns" class="noclick">
<caption class="tblHeaders">
{% trans 'Structure' %}
{{ Util_showMySQLDocu('CREATE_TABLE') }}
{{ show_mysql_docu('CREATE_TABLE') }}
</caption>
<tr>
<th>
@ -10,15 +10,15 @@
</th>
<th>
{% trans 'Type' %}
{{ Util_showMySQLDocu('data-types') }}
{{ show_mysql_docu('data-types') }}
</th>
<th>
{% trans 'Length/Values' %}
{{ Util_showHint('If column type is "enum" or "set", please enter the values using this format: \'a\',\'b\',\'c\'…<br />If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
{{ show_hint('If column type is "enum" or "set", please enter the values using this format: \'a\',\'b\',\'c\'…<br />If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
</th>
<th>
{% trans 'Default' %}
{{ Util_showHint('For default values, please enter just a single value, without backslash escaping or quotes, using this format: a'|trans) }}
{{ show_hint('For default values, please enter just a single value, without backslash escaping or quotes, using this format: a'|trans) }}
</th>
<th>
{% trans 'Collation' %}
@ -34,7 +34,7 @@
{% if change_column is defined and change_column is not empty %}
<th>
{% trans 'Adjust privileges' %}
{{ Util_showDocu('faq', 'faq6-39') }}
{{ show_docu('faq', 'faq6-39') }}
</th>
{% endif %}
@ -80,7 +80,7 @@
</th>
<th>
{% trans 'Browser display transformation options' %}
{{ Util_showHint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…<br />If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
{{ show_hint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…<br />If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
</th>
<th>
<a href="transformation_overview.php{{ get_common() }}#input_transformation"
@ -91,7 +91,7 @@
</th>
<th>
{% trans 'Input transformation options' %}
{{ Util_showHint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…<br />If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
{{ show_hint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…<br />If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
</th>
{% endif %}
</tr>

View File

@ -189,7 +189,7 @@
<tr>
<td class="navigation_separator largescreenonly"></td>
<td class="central_columns_navigation">
{{ Util_getIcon('centralColumns_add', 'Add column' | trans)|raw }}
{{ get_icon('centralColumns_add', 'Add column' | trans)|raw }}
<form id="add_column" action="db_central_columns.php" method="post">
{{ get_hidden_inputs(db) | raw }}
<input type="hidden" name="add_column" value="add">
@ -276,10 +276,10 @@
value="{{ row['col_name'] | raw }}" id="{{ 'checkbox_row_' ~ row_num }}"/>
</td>
<td id="{{ 'edit_' ~ row_num }}" class="edit center">
<a href="#"> {{ Util_getIcon('b_edit', 'Edit' | trans) | raw }}</a>
<a href="#"> {{ get_icon('b_edit', 'Edit' | trans) | raw }}</a>
</td>
<td class="del_row" data-rownum = "{{ row_num }}">
<a hrf="#">{{ Util_getIcon('b_drop', 'Delete' | trans) }}</a>
<a hrf="#">{{ get_icon('b_drop', 'Delete' | trans) }}</a>
<input type="submit" data-rownum = "{{ row_num }}" class="edit_cancel_form" value="Cancel">
</td>
<td id="{{ 'save_' ~ row_num }}" class="hide">
@ -391,14 +391,14 @@
'text_dir' : text_dir,
'form_name' : 'tableslistcontainer',
} only %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'edit_central_columns',
'mult_submit change_central_columns',
'Edit' | trans,
'b_edit',
'edit central columns'
) | raw }}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'delete_central_columns',
'mult_submit',
'Delete' | trans,

View File

@ -1,8 +1,8 @@
<form id="create_table_form_minimal" method="post" action="tbl_create.php" class="lock-page">
<fieldset>
<legend>
{% if Util_showIcons('ActionLinksMode') -%}
{{ Util_getImage('b_table_add') }}
{% if show_icons('ActionLinksMode') -%}
{{ get_image('b_table_add') }}
{%- endif %}
{% trans "Create table" %}
</legend>

View File

@ -64,7 +64,7 @@
table_names_small_url[i],
tab_column[t_n]['COLUMN_NAME'][j]|url_encode
] %}
{% if not Util_isForeignKeySupported(table_types[i]) %}
{% if not is_foreign_key_supported(table_types[i]) %}
{% set click_field_param = click_field_param|merge([tables_pk_or_unique_keys[tmp_column] is defined ? 1 : 0]) %}
{% else %}
{# if foreign keys are supported, it's not necessary that the

View File

@ -110,7 +110,7 @@ var designer_config = {{ designer_config | raw }};
{% trans 'Reload' %}
</span>
</a>
<a href="{{ Util_getDocuLink('faq', 'faq6-31') }}"
<a href="{{ get_docu_link('faq', 'faq6-31') }}"
target="documentation"
class="M_butt">
<img title="{% trans 'Help' %}"

View File

@ -14,7 +14,7 @@
</tr>
<tr>
<td>
{{ Util_getRadioFields(
{{ get_radio_fields(
'save_page',
{
'same': 'Save to selected page'|trans,

View File

@ -1,4 +1,4 @@
{{ Util_getDivForSliderEffect('query_div', 'Query window'|trans, 'open') }}
{{ get_div_for_slider_effect('query_div', 'Query window'|trans, 'open') }}
<form action="" id="query_form">
<input type="hidden" id="db_name" value="{{ db }}">
<fieldset>

View File

@ -16,7 +16,7 @@
{# 4th parameter set to true to add line breaks #}
{# 5th parameter set to false to avoid htmlspecialchars() escaping
in the label since we have some HTML in some labels #}
{{ Util_getRadioFields(
{{ get_radio_fields(
'criteriaSearchType',
choices,
criteria_search_type,

View File

@ -5,7 +5,7 @@
{% set num_tables_trans -%}
{% trans %}%s table{% plural num_tables %}%s tables{% endtrans %}
{%- endset %}
{{ num_tables_trans|format(Util_formatNumber(num_tables, 0)) }}
{{ num_tables_trans|format(format_number(num_tables, 0)) }}
</th>
{% if server_slave_status %}
<th>{% trans 'Replication' %}</th>
@ -15,7 +15,7 @@
{% set sum_colspan = sum_colspan - 1 %}
{% endif %}
<th colspan="{{ sum_colspan }}" class="print_ignore">{% trans 'Sum' %}</th>
{% set row_count_sum = Util_formatNumber(sum_entries, 0) %}
{% set row_count_sum = format_number(sum_entries, 0) %}
{# If a table shows approximate rows count, display update-all-real-count anchor. #}
{% set row_sum_url = [] %}
{% if approx_rows is defined %}
@ -59,12 +59,12 @@
{% endif %}
{% if is_show_stats %}
{% set sum = Util_formatByteDown(sum_size, 3, 1) %}
{% set sum = format_byte_down(sum_size, 3, 1) %}
{% set sum_formatted = sum[0] %}
{% set sum_unit = sum[1] %}
<th class="value tbl_size">{{ sum_formatted }} {{ sum_unit }}</th>
{% set overhead = Util_formatByteDown(overhead_size, 3, 1) %}
{% set overhead = format_byte_down(overhead_size, 3, 1) %}
{% set overhead_formatted = overhead[0] %}
{% set overhead_unit = overhead[1] %}
<th class="value tbl_overhead">{{ overhead_formatted }} {{ overhead_unit }}</th>

View File

@ -1,8 +1,8 @@
<p class="print_ignore">
<a href="#" id="printView">
{{ Util_getIcon('b_print', 'Print'|trans, true) }}
{{ get_icon('b_print', 'Print'|trans, true) }}
</a>
<a href="db_datadict.php{{ url_query }}" target="print_view">
{{ Util_getIcon('b_tblanalyse', 'Data dictionary'|trans, true) }}
{{ get_icon('b_tblanalyse', 'Data dictionary'|trans, true) }}
</a>
</p>

View File

@ -14,8 +14,8 @@
</th>
{% if server_slave_status %}
<td class="center">
{{ ignored ? Util_getImage('s_cancel', 'Not replicated'|trans) }}
{{ do ? Util_getImage('s_success', 'Replicated'|trans) }}
{{ ignored ? get_image('s_cancel', 'Not replicated'|trans) }}
{{ do ? get_image('s_success', 'Replicated'|trans) }}
</td>
{% endif %}
@ -81,7 +81,7 @@
{% if current_table['TABLE_ROWS'] is defined
and (current_table['ENGINE'] != null or table_is_view) %}
{# Get the row count #}
{% set row_count = Util_formatNumber(current_table['TABLE_ROWS'], 0) %}
{% set row_count = format_number(current_table['TABLE_ROWS'], 0) %}
{# Content to be appended into 'tbl_rows' cell.
If row count is approximate, display it as an anchor to get real count. #}

View File

@ -5,7 +5,7 @@
<thead>
<tr>
<th class="print_ignore"></th>
<th>{{ Util_sortableTableHeader('Table'|trans, 'table') }}</th>
<th>{{ sortable_table_header('Table'|trans, 'table') }}</th>
{% if replication %}
<th>{% trans 'Replication' %}</th>
{% endif %}
@ -23,44 +23,44 @@
</th>
{# larger values are more interesting so default sort order is DESC #}
<th>
{{ Util_sortableTableHeader('Rows'|trans, 'records', 'DESC') }}
{{ Util_showHint(Sanitize_sanitize(
{{ sortable_table_header('Rows'|trans, 'records', 'DESC') }}
{{ show_hint(Sanitize_sanitize(
'May be approximate. Click on the number to get the exact count. See [doc@faq3-11]FAQ 3.11[/doc].'|trans
)) }}
</th>
{% if not (properties_num_columns > 1) %}
<th>{{ Util_sortableTableHeader('Type'|trans, 'type') }}</th>
<th>{{ Util_sortableTableHeader('Collation'|trans, 'collation') }}</th>
<th>{{ sortable_table_header('Type'|trans, 'type') }}</th>
<th>{{ sortable_table_header('Collation'|trans, 'collation') }}</th>
{% endif %}
{% if is_show_stats %}
{# larger values are more interesting so default sort order is DESC #}
<th>{{ Util_sortableTableHeader('Size'|trans, 'size', 'DESC') }}</th>
<th>{{ sortable_table_header('Size'|trans, 'size', 'DESC') }}</th>
{# larger values are more interesting so default sort order is DESC #}
<th>{{ Util_sortableTableHeader('Overhead'|trans, 'overhead', 'DESC') }}</th>
<th>{{ sortable_table_header('Overhead'|trans, 'overhead', 'DESC') }}</th>
{% endif %}
{% if show_charset %}
<th>{{ Util_sortableTableHeader('Charset'|trans, 'charset') }}</th>
<th>{{ sortable_table_header('Charset'|trans, 'charset') }}</th>
{% endif %}
{% if show_comment %}
<th>{{ Util_sortableTableHeader('Comment'|trans, 'comment') }}</th>
<th>{{ sortable_table_header('Comment'|trans, 'comment') }}</th>
{% endif %}
{% if show_creation %}
{# newer values are more interesting so default sort order is DESC #}
<th>{{ Util_sortableTableHeader('Creation'|trans, 'creation', 'DESC') }}</th>
<th>{{ sortable_table_header('Creation'|trans, 'creation', 'DESC') }}</th>
{% endif %}
{% if show_last_update %}
{# newer values are more interesting so default sort order is DESC #}
<th>{{ Util_sortableTableHeader('Last update'|trans, 'last_update', 'DESC') }}</th>
<th>{{ sortable_table_header('Last update'|trans, 'last_update', 'DESC') }}</th>
{% endif %}
{% if show_last_check %}
{# newer values are more interesting so default sort order is DESC #}
<th>{{ Util_sortableTableHeader('Last check'|trans, 'last_check', 'DESC') }}</th>
<th>{{ sortable_table_header('Last check'|trans, 'last_check', 'DESC') }}</th>
{% endif %}
</tr>
</thead>

View File

@ -1,7 +1,7 @@
<a href="tbl_tracking.php{{ get_common({'table': table, 'db': db}) }}">
{% if is_tracked -%}
{{ Util_getImage('eye', 'Tracking is active.'|trans) }}
{{ get_image('eye', 'Tracking is active.'|trans) }}
{%- else -%}
{{ Util_getImage('eye_grey', 'Tracking is not active.'|trans) }}
{{ get_image('eye_grey', 'Tracking is not active.'|trans) }}
{%- endif %}
</a>

View File

@ -48,23 +48,23 @@
<a class="delete_tracking_anchor ajax"
href="db_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}&amp;delete_tracking=true">
{{ Util_getIcon('b_drop', 'Delete tracking'|trans) }}
{{ get_icon('b_drop', 'Delete tracking'|trans) }}
</a>
</td>
<td>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}">
{{ Util_getIcon('b_versions', 'Versions'|trans) }}
{{ get_icon('b_versions', 'Versions'|trans) }}
</a>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}&amp;report=true&amp;version=
{{- version.version }}">
{{ Util_getIcon('b_report', 'Tracking report'|trans) }}
{{ get_icon('b_report', 'Tracking report'|trans) }}
</a>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}&amp;snapshot=true&amp;version=
{{- version.version }}">
{{ Util_getIcon('b_props', 'Structure snapshot'|trans) }}
{{ get_icon('b_props', 'Structure snapshot'|trans) }}
</a>
</td>
</tr>
@ -76,7 +76,7 @@
'text_dir': text_dir,
'form_name': 'trackedForm'
} only %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Delete tracking'|trans,
@ -114,7 +114,7 @@
</th>
<td>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table={{ table_name }}">
{{ Util_getIcon('eye', 'Track table'|trans) }}
{{ get_icon('eye', 'Track table'|trans) }}
</a>
</td>
</tr>
@ -126,7 +126,7 @@
'text_dir': text_dir,
'form_name': 'untrackedForm'
} only %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Track table'|trans,

View File

@ -1,6 +1,6 @@
<div class="exportoptions" id="header">
<h2>
{{ Util_getImage('b_export', 'Export'|trans) }}
{{ get_image('b_export', 'Export'|trans) }}
{% if export_type == 'server' %}
{% trans 'Exporting databases from the current server' %}
{% elseif export_type == 'database' %}

View File

@ -1,7 +1,7 @@
<li>
<label for="filename_template" class="desc">
{% trans 'File name template:' %}
{{ Util_showHint(message) }}
{{ show_hint(message) }}
</label>
<input type="text" name="filename_template" id="filename_template" value="
{{- filename_template }}">

View File

@ -35,7 +35,7 @@
<div class="exportoptions" id="header">
<h2>
{{ Util_getImage('b_import', 'Import'|trans) }}
{{ get_image('b_import', 'Import'|trans) }}
{% if import_type == 'server' %}
{% trans 'Importing into the current server' %}
{% elseif import_type == 'database' %}
@ -65,7 +65,7 @@
<ul>
<li>
<input type="radio" name="file_location" id="radio_import_file" required="required" />
{{ Util_getBrowseUploadFileBlock(max_upload_size) }}
{{ get_browse_upload_file_block(max_upload_size) }}
{% trans 'You may also drag and drop a file on any page.' %}
</li>
<li>
@ -73,19 +73,19 @@
{%- if timeout_passed_global is not empty and local_import_file is not empty %}
checked="checked"
{%- endif %} />
{{ Util_getSelectUploadFileBlock(
{{ get_select_upload_file_block(
import_list,
upload_dir
) }}
</li>
</ul>
{% elseif is_upload %}
{{ Util_getBrowseUploadFileBlock(max_upload_size) }}
{{ get_browse_upload_file_block(max_upload_size) }}
<p>{% trans 'You may also drag and drop a file on any page.' %}</p>
{% elseif not is_upload %}
{{ 'File uploads are not allowed on this server.'|trans|notice }}
{% elseif upload_dir is not empty %}
{{ Util_getSelectUploadFileBlock(
{{ get_select_upload_file_block(
import_list,
upload_dir
) }}
@ -160,7 +160,7 @@
<div class="importoptions">
<h3>{% trans 'Other options:' %}</h3>
<div class="formelementrow">
{{ Util_getFKCheckbox() }}
{{ get_fk_checkbox() }}
</div>
</div>

View File

@ -162,7 +162,7 @@ $( function() {
'Please be patient, the file is being uploaded. Details about the upload are not available.'|trans,
false
) -}}
{{- Util_showDocu('faq', 'faq2-9') -}}
{{- show_docu('faq', 'faq2-9') -}}
{%- endset %}
$('#upload_form_status_info').html('{{ image_tag|raw }}');
$("#upload_form_status").css("display", "none");

View File

@ -4,7 +4,7 @@
<input type="hidden" name="pos" size="3" value="{{ pos }}" />
<input type="hidden" name="is_browse_distinct" value="{{ is_browse_distinct }}" />
{% trans 'Number of rows:' %}
{{ Util_getDropdown(
{{ get_dropdown(
'session_max_rows',
number_of_rows_choices,
max_rows,

View File

@ -7,11 +7,11 @@
'display_options_form': 1
}) }}
{{ Util_getDivForSliderEffect('', 'Options'|trans) }}
{{ get_div_for_slider_effect('', 'Options'|trans) }}
<fieldset>
<div class="formelement">
{# pftext means "partial or full texts" (done to reduce line lengths #}
{{ Util_getRadioFields(
{{ get_radio_fields(
'pftext',
{
'P': 'Partial texts'|trans,
@ -27,7 +27,7 @@
{% if relwork and displaywork %}
<div class="formelement">
{{ Util_getRadioFields(
{{ get_radio_fields(
'relational_display',
{
'K': 'Relational key'|trans,
@ -76,7 +76,7 @@
{% if possible_as_geometry %}
<div class="formelement">
{{ Util_getRadioFields(
{{ get_radio_fields(
'geoOption',
{
'GEOM': 'Geometry'|trans,
@ -93,7 +93,7 @@
{% else %}
<div class="formelement">
{{ possible_as_geometry }}
{{ Util_getRadioFields(
{{ get_radio_fields(
'geoOption',
{
'WKT': 'Well Known Text'|trans,

View File

@ -14,6 +14,6 @@
</a>
{% endif %}
{% if mysql_help_page is not empty %}
{{ Util_showMySQLDocu(mysql_help_page) }}
{{ show_mysql_docu(mysql_help_page) }}
{% endif %}
</li>

View File

@ -1,7 +1,7 @@
<div class="group">
<h2>
{% trans "Two-factor authentication status" %}
{{ Util_showDocu('two_factor') }}
{{ show_docu('two_factor') }}
</h2>
<div class="group-cnt">
{% if enabled %}

View File

@ -3,9 +3,9 @@
{% trans 'No change' %}
{% elseif query_data is iterable %}
{% for query in query_data %}
{{ Util_formatSql(query) }}
{{ format_sql(query) }}
{% endfor %}
{% else %}
{{ Util_formatSql(query_data) }}
{{ format_sql(query_data) }}
{% endif %}
</div>

View File

@ -1,6 +1,6 @@
<ul id="topmenu2">
{% for tab in sub_tabs %}
{{ Util_getHtmlTab(tab, url_params) }}
{{ get_html_tab(tab, url_params) }}
{% endfor %}
</ul>
<div class="clearfloat"></div>

View File

@ -6,5 +6,5 @@
<td class="right">
{{- value['Orig_log_pos'] is defined ? value['Orig_log_pos'] : value['End_log_pos'] -}}
</td>
<td>{{ Util_formatSql(value['Info'], not dontlimitchars) }}</td>
<td>{{ format_sql(value['Info'], not dontlimitchars) }}</td>
</tr>

View File

@ -11,7 +11,7 @@
{{- each_log['Log_name'] == log ? ' selected="selected"' }}>
{{ each_log['Log_name'] }}
{% if each_log['File_size'] is defined %}
({{ Util_formatByteDown(each_log['File_size'], 3, 2)|join(' ') }})
({{ format_byte_down(each_log['File_size'], 3, 2)|join(' ') }})
{% set full_size = full_size + each_log['File_size'] %}
{% endif %}
</option>
@ -20,7 +20,7 @@
{{ binary_logs|length }}
{% trans 'Files' %},
{% if full_size > 0 %}
{{ Util_formatByteDown(full_size)|join(' ') }}
{{ format_byte_down(full_size)|join(' ') }}
{% endif %}
</fieldset>
<fieldset class="tblFooters">

View File

@ -42,7 +42,7 @@
'form_name': 'dbStatsForm'
} only %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'',
'mult_submit ajax',
'Drop'|trans,

View File

@ -11,10 +11,10 @@
<form method="post" action="server_databases.php" id="create_database_form" class="ajax">
<p><strong>
<label for="text_create_db">
{{ Util_getImage('b_newdb') }}
{{ get_image('b_newdb') }}
{% trans 'Create database' %}
</label>
{{ Util_showMySQLDocu('CREATE_DATABASE') }}
{{ show_mysql_docu('CREATE_DATABASE') }}
</strong></p>
{{ get_hidden_inputs('', '', 5) }}
@ -39,13 +39,13 @@
{% else %}
{# db creation no privileges message #}
<p><strong>
{{ Util_getImage('b_newdb') }}
{{ get_image('b_newdb') }}
{% trans 'Create database' %}
{{ Util_showMySQLDocu('CREATE_DATABASE') }}
{{ show_mysql_docu('CREATE_DATABASE') }}
</strong></p>
<span class="noPrivileges">
{{ Util_getImage(
{{ get_image(
's_error',
'',
{'hspace': 2, 'border': 0, 'align': 'middle'}
@ -62,7 +62,7 @@
{# Displays the table #}
{% if databases is not null %}
<div id="tableslistcontainer">
{{ Util_getListNavigator(
{{ get_list_navigator(
database_count,
pos,
url_params,
@ -86,7 +86,7 @@
<th>
<a href="server_databases.php{{ get_common(url_params) }}">
{% trans 'Database' %}
{{ sort_by == 'SCHEMA_NAME' ? Util_getImage(
{{ sort_by == 'SCHEMA_NAME' ? get_image(
's_' ~ sort_order,
sort_order == 'asc' ? 'Ascending'|trans : 'Descending'|trans
) }}
@ -101,7 +101,7 @@
<th{{ stat['format'] is same as('byte') ? ' colspan="2"' }}>
<a href="server_databases.php{{ get_common(url_params) }}">
{{ stat['disp_name'] }}
{{ sort_by == stat_name ? Util_getImage(
{{ sort_by == stat_name ? get_image(
's_' ~ sort_order,
sort_order == 'asc' ? 'Ascending'|trans : 'Descending'|trans
) }}

View File

@ -8,7 +8,7 @@
</td>
{% endif %}
<td class="name">
<a href="{{ Util_getScriptNameForOption(default_tab_database, 'database') }}
<a href="{{ get_script_name_for_option(default_tab_database, 'database') }}
{{- get_common({'db': current['SCHEMA_NAME']}) }}" title="
{{- "Jump to database '%s'"|trans|format(current['SCHEMA_NAME']|e) }}">
{{ current['SCHEMA_NAME'] }}
@ -49,7 +49,7 @@
'checkprivsdb': current['SCHEMA_NAME']
}) }}" title="
{{- 'Check privileges for database "%s".'|trans|format(current['SCHEMA_NAME']|e) }}">
{{ Util_getIcon('s_rights', 'Check privileges'|trans) }}
{{ get_icon('s_rights', 'Check privileges'|trans) }}
</a>
</td>
</tr>

View File

@ -1,7 +1,7 @@
<h2>
{{ Util_getImage('b_engine') }}
{{ get_image('b_engine') }}
{{ title }}
{{ Util_showMySQLDocu(help_page) }}
{{ show_mysql_docu(help_page) }}
</h2>
<p><em>{{ comment }}</em></p>

View File

@ -4,5 +4,5 @@
{% if rel_params is not empty %}
rel="{{ get_common(rel_params) }}"
{% endif %}>
{{ Util_getIcon('b_usradd') }}{% trans 'Add user account' %}</a>
{{ get_icon('b_usradd') }}{% trans 'Add user account' %}</a>
</fieldset>

View File

@ -3,7 +3,7 @@
<fieldset id="fieldset_user_group_selection">
<legend>{% trans 'User group' %}</legend>
{% trans 'User group' %}:
{{ Util_getDropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }}
{{ get_dropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }}
<input type="hidden" name="changeUserGroup" value="1">
</fieldset>
</form>

View File

@ -1,6 +1,6 @@
<fieldset id="fieldset_delete_user">
<legend>
{{ Util_getIcon('b_usrdrop') }}{% trans 'Remove selected user accounts' %}
{{ get_icon('b_usrdrop') }}{% trans 'Remove selected user accounts' %}
</legend>
<input type="hidden" name="mode" value="2" />
<p>({% trans 'Revoke all active privileges from the users and delete them afterwards.' %})</p>

View File

@ -39,10 +39,10 @@
} %}
<h2>
{% if is_image|default(true) %}
{{ Util_getImage(header[type]['image']) }}
{{ get_image(header[type]['image']) }}
{% else %}
{{ Util_getIcon(header[type]['image']) }}
{{ get_icon(header[type]['image']) }}
{% endif %}
{{ header[type]['text'] }}
{{ link is defined ? Util_showMySQLDocu(link) }}
{{ link is defined ? show_mysql_docu(link) }}
</h2>

View File

@ -1,10 +1,10 @@
<a href="{{ url|raw }}" class="ajax saveLink hide">
{{ Util_getIcon('b_save', 'Save'|trans) }}
{{ get_icon('b_save', 'Save'|trans) }}
</a>
<a href="#" class="cancelLink hide">
{{ Util_getIcon('b_close', 'Cancel'|trans) }}
{{ get_icon('b_close', 'Cancel'|trans) }}
</a>
{{ Util_getImage('b_help', 'Documentation'|trans, {
{{ get_image('b_help', 'Documentation'|trans, {
'class': 'hide',
'id': 'docImage'
}) }}

View File

@ -1,10 +1,10 @@
<tr class="var-row {{ row_class }}" data-filter-row="{{ name | upper }}">
<td class="var-action">
{% if editable %}
<a href="#" data-variable="{{ name }}" class="editLink">{{ Util_getIcon('b_edit', 'Edit'|trans) }}</a>
<a href="#" data-variable="{{ name }}" class="editLink">{{ get_icon('b_edit', 'Edit'|trans) }}</a>
{% else %}
<span title="{% trans 'This is a read-only variable and can not be edited' %}" class="read_only_var">
{{ Util_getIcon('bd_edit', 'Edit'|trans) }}
{{ get_icon('bd_edit', 'Edit'|trans) }}
</span>
{% endif %}
</td>

View File

@ -145,12 +145,12 @@
{% endfor %}
</select>
</div>
{{ Util_getStartAndNumberOfRowsPanel(sql_query) }}
{{ get_start_and_number_of_rows_panel(sql_query) }}
<div class="clearfloat"></div>
<div id="resizer" style="width:600px; height:400px;">
<div style="position: absolute; right: 10px; top: 10px; cursor: pointer; z-index: 1000;">
<a class="disableAjax" id="saveChart" href="#" download="chart.png">
{{ Util_getImage('b_saveimage', 'Save chart as image'|trans) }}
{{ get_image('b_saveimage', 'Save chart as image'|trans) }}
</a>
</div>
<div id="querychart" dir="ltr">

View File

@ -39,13 +39,13 @@
</label>
</td>
</tr>
{{ Util_getStartAndNumberOfRowsPanel(sql_query) }}
{{ get_start_and_number_of_rows_panel(sql_query) }}
</form>
<div class="pma_quick_warp" style="width: 50px; position: absolute; right: 0; top: 0; cursor: pointer;">
<div class="drop_list">
<span class="drop_button" style="padding: 0; border: 0;">
{{ Util_getImage('b_saveimage', 'Save'|trans) }}
{{ get_image('b_saveimage', 'Save'|trans) }}
</span>
<ul>
<li class="warp_link">

View File

@ -13,7 +13,7 @@
<strong>
<label for="input_index_name">
{% trans 'Index name:' %}
{{ Util_showHint('"PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!'|trans) }}
{{ show_hint('"PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!'|trans) }}
</label>
</strong>
</div>
@ -32,14 +32,14 @@
<strong>
<label for="select_index_choice">
{% trans 'Index choice:' %}
{{ Util_showMySQLDocu('ALTER_TABLE') }}
{{ show_mysql_docu('ALTER_TABLE') }}
</label>
</strong>
</div>
{{ index.generateIndexChoiceSelector(create_edit_table)|raw }}
</div>
{{ Util_getDivForSliderEffect('indexoptions', 'Advanced Options'|trans) }}
{{ get_div_for_slider_effect('indexoptions', 'Advanced Options'|trans) }}
<div>
<div class="label">
@ -63,7 +63,7 @@
<strong>
<label for="select_index_type">
{% trans 'Index type:' %}
{{ Util_showMySQLDocu('ALTER_TABLE') }}
{{ show_mysql_docu('ALTER_TABLE') }}
</label>
</strong>
</div>

View File

@ -1,12 +1,12 @@
{% if cfg_relation['relwork'] or is_foreign_key_supported %}
<ul id="topmenu2">
{{ Util_getHtmlTab({
{{ get_html_tab({
'icon': 'b_props',
'link': 'tbl_structure.php',
'text': 'Table structure'|trans,
'id': 'table_strucuture_id'
}, url_params) }}
{{ Util_getHtmlTab({
{{ get_html_tab({
'icon': 'b_relations',
'link': 'tbl_relation.php',
'text': 'Relation view'|trans,

View File

@ -4,7 +4,7 @@
<form method="post" action="tbl_relation.php">
{{ get_hidden_inputs(db, table) }}
{# InnoDB #}
{% if Util_isForeignKeySupported(tbl_storage_engine) %}
{% if is_foreign_key_supported(tbl_storage_engine) %}
<fieldset>
<legend>{% trans 'Foreign key constraints' %}</legend>
<div class="responsivetable jsresponsive">
@ -15,12 +15,12 @@
{% if tbl_storage_engine|upper == 'INNODB' %}
<th>
{% trans 'Column' %}
{{ Util_showHint('Creating a foreign key over a non-indexed column would automatically create an index on it. Alternatively, you can define an index below, before creating the foreign key.'|trans) }}
{{ show_hint('Creating a foreign key over a non-indexed column would automatically create an index on it. Alternatively, you can define an index below, before creating the foreign key.'|trans) }}
</th>
{% else %}
<th>
{% trans 'Column' %}
{{ Util_showHint('Only columns with index will be displayed. You can define an index below.'|trans) }}
{{ show_hint('Only columns with index will be displayed. You can define an index below.'|trans) }}
</th>
{% endif %}
<th colspan="3">
@ -98,21 +98,21 @@
{% endif %}
{% if cfg_relation['relwork'] %}
{% if Util_isForeignKeySupported(tbl_storage_engine) %}
{{ Util_getDivForSliderEffect('ir_div', 'Internal relationships'|trans) }}
{% if is_foreign_key_supported(tbl_storage_engine) %}
{{ get_div_for_slider_effect('ir_div', 'Internal relationships'|trans) }}
{% endif %}
<fieldset>
<legend>
{% trans 'Internal relationships' %}
{{ Util_showDocu('config', 'cfg_Servers_relation') }}
{{ show_docu('config', 'cfg_Servers_relation') }}
</legend>
<table id="internal_relations" class="relationalTable">
<tr>
<th>{% trans 'Column' %}</th>
<th>{% trans 'Internal relation' %}
{% if Util_isForeignKeySupported(tbl_storage_engine) %}
{{ Util_showHint('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'|trans) }}
{% if is_foreign_key_supported(tbl_storage_engine) %}
{{ show_hint('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'|trans) }}
{% endif %}
</th>
{% set saved_row_cnt = save_row|length - 1 %}
@ -184,7 +184,7 @@
{% endfor %}
</table>
</fieldset>
{% if Util_isForeignKeySupported(tbl_storage_engine) %}
{% if is_foreign_key_supported(tbl_storage_engine) %}
</div>
{% endif %}
{% endif %}

View File

@ -4,9 +4,9 @@
{% set js_msg = '' %}
{% set this_params = null %}
{% if one_key['constraint'] is defined %}
{% set drop_fk_query = 'ALTER TABLE ' ~ Util_backquote(db) ~ '.' ~ Util_backquote(table)
{% set drop_fk_query = 'ALTER TABLE ' ~ backquote(db) ~ '.' ~ backquote(table)
~ ' DROP FOREIGN KEY '
~ Util_backquote(one_key['constraint']) ~ ';'
~ backquote(one_key['constraint']) ~ ';'
%}
{% set this_params = url_params %}
{% set this_params = {
@ -27,8 +27,8 @@
<input type="hidden" class="drop_foreign_key_msg" value="
{{- js_msg }}" />
{% set drop_url = 'sql.php' ~ get_common(this_params) %}
{% set drop_str = Util_getIcon('b_drop', 'Drop'|trans) %}
{{ Util_linkOrButton(drop_url, drop_str, {'class': 'drop_foreign_key_anchor ajax'}) }}
{% set drop_str = get_icon('b_drop', 'Drop'|trans) %}
{{ link_or_button(drop_url, drop_str, {'class': 'drop_foreign_key_anchor ajax'}) }}
{% endif %}
</td>
<td>

View File

@ -1,10 +1,10 @@
{# Displays 'Function' column if it is present #}
<td>
{% set geom_types = Util_getGISDatatypes() %}
{% set geom_types = get_gis_datatypes() %}
{% if column_types[column_index] in geom_types %}
<select class="geom_func" name="geom_func[{{ column_index }}]">
{# get the relevant list of GIS functions #}
{% set funcs = Util_getGISFunctions(column_types[column_index], true, true) %}
{% set funcs = get_gis_functions(column_types[column_index], true, true) %}
{% for func_name, func in funcs %}
{% set name = func['display'] is defined ? func['display'] : func_name %}

View File

@ -28,7 +28,7 @@
{{ titles['Browse']|replace({"'": "\\'"})|raw }}
</a>
{% endif %}
{% elseif column_type in Util_getGISDatatypes() %}
{% elseif column_type in get_gis_datatypes() %}
<input type="text"
name="criteriaValues[{{ column_index }}]"
size="40"
@ -36,9 +36,9 @@
id="field_{{ column_index }}" />
{% if in_fbs %}
{% set edit_url = 'gis_data_editor.php' ~ get_common() %}
{% set edit_str = Util_getIcon('b_edit', 'Edit/Insert'|trans) %}
{% set edit_str = get_icon('b_edit', 'Edit/Insert'|trans) %}
<span class="open_search_gis_editor">
{{ Util_linkOrButton(edit_url, edit_str, [], '_blank') }}
{{ link_or_button(edit_url, edit_str, [], '_blank') }}
</span>
{% endif %}
{% elseif column_type starts with 'enum'

View File

@ -94,7 +94,7 @@
<div id="gis_editor"></div>
<div id="popup_background"></div>
</fieldset>
{{ Util_getDivForSliderEffect('searchoptions', 'Options'|trans) }}
{{ get_div_for_slider_effect('searchoptions', 'Options'|trans) }}
{# Displays columns select list for selecting distinct columns in the search #}
<fieldset id="fieldset_select_fields">
@ -121,7 +121,7 @@
<em>{% trans 'Or' %}</em>
{% trans 'Add search conditions (body of the "where" clause):' %}
</legend>
{{ Util_showMySQLDocu('Functions') }}
{{ show_mysql_docu('Functions') }}
<input type="text" name="customWhereClause" class="textfield" size="64" />
</fieldset>
@ -147,7 +147,7 @@
{% endfor %}
</select>
{{ Util_getRadioFields(
{{ get_radio_fields(
'order',
{
'ASC': 'Ascending'|trans,

View File

@ -17,12 +17,12 @@
{%- endif %}" href="tbl_structure.php" data-post="{{ url_query|raw -}}
&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~
Util_backquote(table) ~
backquote(table) ~
(is_primary ? (primary ? ' DROP PRIMARY KEY,')) ~
' ' ~
syntax ~
'(' ~
Util_backquote(row['Field']) ~
backquote(row['Field']) ~
');')|url_encode -}}
&amp;message_to_show={{ message|format(row['Field']|e)|url_encode }}">
{{ titles[action]|raw }}

View File

@ -2,7 +2,7 @@
<fieldset>
<legend>
{% trans 'Partitions' %}
{{ Util_showMySQLDocu('partitioning') }}
{{ show_mysql_docu('partitioning') }}
</legend>
{% if partitions is empty %}
{{ 'No partitioning defined!'|trans|notice }}
@ -56,7 +56,7 @@
{% endif %}
<td class="value">{{ partition.getRows() }}</td>
<td class="value">
{% set data_length = Util_formatByteDown(
{% set data_length = format_byte_down(
partition.getDataLength(),
3,
1
@ -65,7 +65,7 @@
<span class="unit">{{ data_length[1] }}</span>
</td>
<td class="value">
{% set index_length = Util_formatByteDown(
{% set index_length = format_byte_down(
partition.getIndexLength(),
3,
1
@ -78,7 +78,7 @@
<td>
<a href="tbl_structure.php" data-post="{{ url_query -}}
&amp;partition_maintenance=1&amp;sql_query=
{{- ("ALTER TABLE " ~ Util_backquote(table) ~ " " ~ action
{{- ("ALTER TABLE " ~ backquote(table) ~ " " ~ action
~ " PARTITION " ~ partition.getName())|url_encode }}"
id="partition_action_{{ action }}"
name="partition_action_{{ action }}"
@ -99,7 +99,7 @@
{% endif %}
<td class="value">{{ sub_partition.getRows() }}</td>
<td class="value">
{% set data_length = Util_formatByteDown(
{% set data_length = format_byte_down(
sub_partition.getDataLength(),
3,
1
@ -108,7 +108,7 @@
<span class="unit">{{ data_length[1] }}</span>
</td>
<td class="value">
{% set index_length = Util_formatByteDown(
{% set index_length = format_byte_down(
sub_partition.getIndexLength(),
3,
1
@ -134,7 +134,7 @@
{% if partitions is empty %}
<input type="submit" name="edit_partitioning" value="{% trans 'Partition table' %}" />
{% else %}
{{ Util_linkOrButton(remove_url, 'Remove partitioning'|trans, {
{{ link_or_button(remove_url, 'Remove partitioning'|trans, {
'class': 'button ajax',
'id': 'remove_partitioning'
}) }}

View File

@ -30,7 +30,7 @@
<th>{% trans 'Extra' %}</th>
{# @see tbl_structure.js, function moreOptsMenuResize() #}
{% if not db_is_system_schema and not tbl_is_view %}
<th colspan="{{ Util_showIcons('ActionLinksMode') ? '8' : '9' -}}
<th colspan="{{ show_icons('ActionLinksMode') ? '8' : '9' -}}
" class="action print_ignore">{% trans 'Action' %}</th>
{% endif %}
</tr>
@ -62,7 +62,7 @@
{{ displayed_fields[rownum].icon|raw }}
</label>
</th>
<td {{ Util_getClassForType(extracted_columnspec['type']) }}>
<td {{ get_class_for_type(extracted_columnspec['type']) }}>
<bdo dir="ltr" lang="en">
{{ extracted_columnspec['displayed_type']|raw }}
{% if relation_commwork and relation_mimework and browse_mime
@ -81,7 +81,7 @@
<td class="nowrap">
{% if row['Default'] is not null %}
{% if extracted_columnspec['type'] == 'bit' %}
{{ Util_convertBitDefaultValue(row['Default']) }}
{{ row['Default']|convert_bit_default_value }}
{% else %}
{{ row['Default']|raw }}
{% endif %}
@ -104,8 +104,8 @@
</td>
<td class="drop center print_ignore">
<a class="drop_column_anchor ajax" href="sql.php" data-post="{{ url_query }}&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' DROP ' ~ Util_backquote(row['Field']) ~ ';')|url_encode -}}
{{- ('ALTER TABLE ' ~ backquote(table)
~ ' DROP ' ~ backquote(row['Field']) ~ ';')|url_encode -}}
&amp;dropped_column={{ row['Field']|url_encode }}&amp;purge=1&amp;message_to_show=
{{- ('Column %s has been dropped.'|trans|format(row['Field']|e))|url_encode }}">
{{ titles['Drop']|raw }}
@ -119,7 +119,7 @@
<ul class="table-structure-actions resizable-menu">
{% if hide_structure_actions %}
<li class="submenu shown">
<a href="#" class="tab nowrap">{{ Util_getIcon('b_more', 'More'|trans) }}</a>
<a href="#" class="tab nowrap">{{ get_icon('b_more', 'More'|trans) }}</a>
<ul>
{% endif %}
{# Add primary #}
@ -215,8 +215,8 @@
) and ('text' in type or 'char' in type) %}
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="tbl_structure.php"
data-post="{{- url_query|raw }}&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' ADD FULLTEXT(' ~ Util_backquote(row['Field'])
{{- ('ALTER TABLE ' ~ backquote(table)
~ ' ADD FULLTEXT(' ~ backquote(row['Field'])
~ ');')|url_encode }}&amp;message_to_show=
{{- ('An index has been added on %s.'|trans|format(row['Field']|e))|url_encode }}">
{{ titles['IdxFulltext']|raw }}
@ -229,11 +229,11 @@
{# Distinct value action #}
<li class="browse nowrap">
<a href="sql.php" data-post="{{ url_query|raw }}&amp;sql_query=
{{- ('SELECT COUNT(*) AS ' ~ Util_backquote('Rows'|trans)
~ ', ' ~ Util_backquote(row['Field'])
~ ' FROM ' ~ Util_backquote(table)
~ ' GROUP BY ' ~ Util_backquote(row['Field'])
~ ' ORDER BY ' ~ Util_backquote(row['Field']))|url_encode -}}
{{- ('SELECT COUNT(*) AS ' ~ backquote('Rows'|trans)
~ ', ' ~ backquote(row['Field'])
~ ' FROM ' ~ backquote(table)
~ ' GROUP BY ' ~ backquote(row['Field'])
~ ' ORDER BY ' ~ backquote(row['Field']))|url_encode -}}
&amp;is_browse_distinct=1">
{{ titles['DistinctValues']|raw }}
</a>
@ -242,11 +242,11 @@
<li class="browse nowrap">
{% if row['Field'] in central_list %}
<a href="#" class="central_columns remove_button">
{{ Util_getIcon('centralColumns_delete', 'Remove from central columns'|trans) }}
{{ get_icon('centralColumns_delete', 'Remove from central columns'|trans) }}
</a>
{% else %}
<a href="#" class="central_columns add_button">
{{ Util_getIcon('centralColumns_add', 'Add to central columns'|trans) }}
{{ get_icon('centralColumns_add', 'Add to central columns'|trans) }}
</a>
{% endif %}
</li>
@ -270,7 +270,7 @@
'form_name': 'fieldsForm'
} only %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Browse'|trans,
@ -279,14 +279,14 @@
) }}
{% if not tbl_is_view and not db_is_system_schema %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit change_columns_anchor ajax',
'Change'|trans,
'b_edit',
'change'
) }}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Drop'|trans,
@ -295,28 +295,28 @@
) }}
{% if tbl_storage_engine != 'ARCHIVE' %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Primary'|trans,
'b_primary',
'primary'
) }}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Unique'|trans,
'b_unique',
'unique'
) }}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Index'|trans,
'b_index',
'index'
) }}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Fulltext'|trans,
@ -328,7 +328,7 @@
tbl_storage_engine == 'MYISAM'
or tbl_storage_engine == 'ARIA'
or tbl_storage_engine == 'MARIA') %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Fulltext'|trans,
@ -338,14 +338,14 @@
{% endif %}
{% if central_columns_work %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Add to central columns'|trans,
'centralColumns_add',
'add_to_central_columns'
) }}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Remove from central columns'|trans,
@ -370,39 +370,39 @@
{# Work on the table #}
<div id="structure-action-links">
{% if tbl_is_view and not db_is_system_schema %}
{{ Util_linkOrButton(
{{ link_or_button(
edit_view_url,
Util_getIcon('b_edit', 'Edit view'|trans, true)
get_icon('b_edit', 'Edit view'|trans, true)
) }}
{% endif %}
<a href="#" id="printView">{{ Util_getIcon('b_print', 'Print'|trans, true) }}</a>
<a href="#" id="printView">{{ get_icon('b_print', 'Print'|trans, true) }}</a>
{% if not tbl_is_view and not db_is_system_schema %}
<a href="sql.php" data-post="{{ url_query|raw }}&amp;session_max_rows=all&amp;sql_query=
{{- ('SELECT * FROM ' ~ Util_backquote(table) ~ ' PROCEDURE ANALYSE()')|url_encode -}}
{{- ('SELECT * FROM ' ~ backquote(table) ~ ' PROCEDURE ANALYSE()')|url_encode -}}
" style="margin-right: 0;">
{{ Util_getIcon(
{{ get_icon(
'b_tblanalyse',
'Propose table structure'|trans,
true
) }}
</a>
{{ Util_showMySQLDocu('procedure_analyse') }}
{{ show_mysql_docu('procedure_analyse') }}
{% if is_active %}
<a href="tbl_tracking.php{{ url_query|raw }}">
{{ Util_getIcon('eye', 'Track table'|trans, true) }}
{{ get_icon('eye', 'Track table'|trans, true) }}
</a>
{% endif %}
<a href="#" id="move_columns_anchor">
{{ Util_getIcon('b_move', 'Move columns'|trans, true) }}
{{ get_icon('b_move', 'Move columns'|trans, true) }}
</a>
<a href="normalization.php{{ url_query|raw }}">
{{ Util_getIcon('normalize', 'Normalize'|trans, true) }}
{{ get_icon('normalize', 'Normalize'|trans, true) }}
</a>
{% endif %}
{% if tbl_is_view and not db_is_system_schema %}
{% if is_active %}
<a href="tbl_tracking.php{{ url_query|raw }}">
{{ Util_getIcon('eye', 'Track view'|trans, true) }}
{{ get_icon('eye', 'Track view'|trans, true) }}
</a>
{% endif %}
{% endif %}
@ -410,8 +410,8 @@
{% if not tbl_is_view and not db_is_system_schema %}
<form method="post" action="tbl_addfield.php" id="addColumns" name="addColumns">
{{ get_hidden_inputs(db, table) }}
{% if Util_showIcons('ActionLinksMode') %}
{{ Util_getImage('b_insrow', 'Add column'|trans) }}&nbsp;
{% if show_icons('ActionLinksMode') %}
{{ get_image('b_insrow', 'Add column'|trans) }}&nbsp;
{% endif %}
{% set num_fields -%}
<input type="number" name="num_fields" value="1" onfocus="this.select()" min="1" required />
@ -456,20 +456,20 @@
{% endif %}
{% set action_icons = {
'ANALYZE': Util_getIcon('b_search', 'Analyze'|trans),
'CHECK': Util_getIcon('eye', 'Check'|trans),
'OPTIMIZE': Util_getIcon('normalize', 'Optimize'|trans),
'REBUILD': Util_getIcon('s_tbl', 'Rebuild'|trans),
'REPAIR': Util_getIcon('b_tblops', 'Repair'|trans),
'TRUNCATE': Util_getIcon('b_empty', 'Truncate'|trans),
'ANALYZE': get_icon('b_search', 'Analyze'|trans),
'CHECK': get_icon('eye', 'Check'|trans),
'OPTIMIZE': get_icon('normalize', 'Optimize'|trans),
'REBUILD': get_icon('s_tbl', 'Rebuild'|trans),
'REPAIR': get_icon('b_tblops', 'Repair'|trans),
'TRUNCATE': get_icon('b_empty', 'Truncate'|trans),
} %}
{% if range_or_list %}
{% set action_icons = action_icons|merge({'DROP': Util_getIcon('b_drop', 'Drop'|trans)}) %}
{% set action_icons = action_icons|merge({'DROP': get_icon('b_drop', 'Drop'|trans)}) %}
{% endif %}
{{ Util_getDivForSliderEffect('partitions', 'Partitions'|trans) }}
{{ get_div_for_slider_effect('partitions', 'Partitions'|trans) }}
{% set remove_sql = 'ALTER TABLE ' ~ Util_backquote(table) ~ ' REMOVE PARTITIONING' %}
{% set remove_sql = 'ALTER TABLE ' ~ backquote(table) ~ ' REMOVE PARTITIONING' %}
{% set remove_url = 'sql.php' ~ url_query ~ '&sql_query=' ~ remove_sql|url_encode %}
{% include 'table/structure/display_partitions.twig' with {

View File

@ -57,8 +57,8 @@
<tr class="tblFooters print_ignore">
<td colspan="3" class="center">
<a href="sql.php" data-post="{{ url_query }}&amp;pos=0&amp;sql_query=
{{- ('OPTIMIZE TABLE ' ~ Util_backquote(table))|url_encode }}">
{{ Util_getIcon('b_tbloptimize', 'Optimize table'|trans) }}
{{- ('OPTIMIZE TABLE ' ~ backquote(table))|url_encode }}">
{{ get_icon('b_tbloptimize', 'Optimize table'|trans) }}
</a>
</td>
</tr>
@ -110,7 +110,7 @@
{% if not is_innodb and showtable['Rows'] is defined %}
<tr>
<th class="name">{% trans 'Rows' %}</th>
<td class="value">{{ Util_formatNumber(showtable['Rows'], 0) }}</td>
<td class="value">{{ format_number(showtable['Rows'], 0) }}</td>
</tr>
{% endif %}
@ -119,7 +119,7 @@
and showtable['Avg_row_length'] > 0 %}
<tr>
<th class="name">{% trans 'Row length' %}</th>
{% set avg_row_length = Util_formatByteDown(showtable['Avg_row_length'], 6, 1) %}
{% set avg_row_length = format_byte_down(showtable['Avg_row_length'], 6, 1) %}
<td class="value">{{ avg_row_length[0] }} {{ avg_row_length[1] }}</td>
</tr>
{% endif %}
@ -138,28 +138,28 @@
{% if showtable['Auto_increment'] is defined %}
<tr>
<th class="name">{% trans 'Next autoindex' %}</th>
<td class="value">{{ Util_formatNumber(showtable['Auto_increment'], 0) }}</td>
<td class="value">{{ format_number(showtable['Auto_increment'], 0) }}</td>
</tr>
{% endif %}
{% if showtable['Create_time'] is defined %}
<tr>
<th class="name">{% trans 'Creation' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Create_time']|date('U')) }}</td>
<td class="value">{{ localised_date(showtable['Create_time']|date('U')) }}</td>
</tr>
{% endif %}
{% if showtable['Update_time'] is defined %}
<tr>
<th class="name">{% trans 'Last update' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Update_time']|date('U')) }}</td>
<td class="value">{{ localised_date(showtable['Update_time']|date('U')) }}</td>
</tr>
{% endif %}
{% if showtable['Check_time'] is defined %}
<tr>
<th class="name">{% trans 'Last check' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Check_time']|date('U')) }}</td>
<td class="value">{{ localised_date(showtable['Check_time']|date('U')) }}</td>
</tr>
{% endif %}
</tbody>

View File

@ -58,7 +58,7 @@
<td>
<a class="delete_version_anchor ajax" href="tbl_tracking.php{{- url_query|raw -}}&version=
{{- version['version']|escape -}}&submit_delete_version=true">
{{ Util_getIcon('b_drop', 'Delete version'|trans) }}
{{ get_icon('b_drop', 'Delete version'|trans) }}
</a>
</td>
<td>
@ -66,14 +66,14 @@
{{- get_common(
url_params|merge({'report': 'true', 'version': version['version']})
) -}}">
{{ Util_getIcon('b_report', 'Tracking report'|trans) }}
{{ get_icon('b_report', 'Tracking report'|trans) }}
</a>
&nbsp;&nbsp;
<a href="tbl_tracking.php
{{- get_common(
url_params|merge({'snapshot': 'true', 'version': version['version']})
) -}}">
{{ Util_getIcon('b_props', 'Structure snapshot'|trans) }}
{{ get_icon('b_props', 'Structure snapshot'|trans) }}
</a>
</td>
</tr>
@ -85,7 +85,7 @@
'text_dir': text_dir,
'form_name': 'versionsForm',
} only %}
{{ Util_getButtonOrImage(
{{ get_button_or_image(
'submit_mult',
'mult_submit',
'Delete version'|trans,

View File

@ -22,9 +22,9 @@
<strong>
{{ field['Field'] }}
{% if field['Key'] == 'PRI' %}
{{ Util_getImage('b_primary', 'Primary'|trans) }}
{{ get_image('b_primary', 'Primary'|trans) }}
{% elseif field['Key'] is not empty %}
{{ Util_getImage('bd_primary', 'Index'|trans) }}
{{ get_image('bd_primary', 'Index'|trans) }}
{% endif %}
</strong>
</td>
@ -33,10 +33,10 @@
<td>{{ field['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }}</td>
<td>
{% if field['Default'] is defined %}
{% set extracted_columnspec = Util_extractColumnSpec(field['Type']) %}
{% set extracted_columnspec = extract_column_spec(field['Type']) %}
{% if extracted_columnspec['type'] == 'bit' %}
{# here, $field['Default'] contains something like b'010' #}
{{ Util_convertBitDefaultValue(field['Default']) }}
{{ field['Default']|convert_bit_default_value }}
{% else %}
{{ field['Default'] }}
{% endif %}