From 1037b1d626a338d9de7f34b8503166a664484278 Mon Sep 17 00:00:00 2001 From: Leonardo Strozzi Date: Thu, 2 Aug 2018 17:13:48 -0300 Subject: [PATCH] Refactor Util Twig extensions Signed-off-by: Leonardo Strozzi --- libraries/classes/Twig/UtilExtension.php | 95 ++++++++++--------- .../column_definitions_form.twig | 6 +- .../columns_definitions/column_type.twig | 2 +- .../columns_definitions/move_column.twig | 2 +- .../table_fields_definitions.twig | 14 +-- templates/database/central_columns/main.twig | 10 +- templates/database/create_table.twig | 4 +- .../database/designer/database_tables.twig | 2 +- templates/database/designer/main.twig | 2 +- templates/database/designer/page_save_as.twig | 2 +- .../database/multi_table_query/form.twig | 2 +- templates/database/search/main.twig | 2 +- .../structure/body_for_table_summary.twig | 8 +- .../print_view_data_dictionary_link.twig | 4 +- .../structure/structure_table_row.twig | 6 +- .../database/structure/table_header.twig | 24 ++--- .../database/structure/tracking_icon.twig | 4 +- templates/database/tracking/tables.twig | 14 +-- templates/display/export/option_header.twig | 2 +- .../display/export/options_output_format.twig | 2 +- templates/display/import/import.twig | 12 +-- templates/display/import/javascript.twig | 2 +- .../display/results/additional_fields.twig | 2 +- templates/display/results/options_block.twig | 10 +- templates/list/item.twig | 2 +- templates/prefs_twofactor.twig | 2 +- templates/preview_sql.twig | 4 +- templates/secondary_tabs.twig | 2 +- templates/server/binlog/log_row.twig | 2 +- templates/server/binlog/log_selector.twig | 4 +- .../server/databases/databases_footer.twig | 2 +- templates/server/databases/index.twig | 16 ++-- templates/server/databases/table_row.twig | 4 +- templates/server/engines/show_engine.twig | 4 +- .../server/privileges/add_user_fieldset.twig | 2 +- .../server/privileges/choose_user_group.twig | 2 +- .../privileges/delete_user_fieldset.twig | 2 +- templates/server/sub_page_header.twig | 6 +- templates/server/variables/link_template.twig | 6 +- templates/server/variables/variable_row.twig | 4 +- templates/table/chart/tbl_chart.twig | 4 +- .../gis_visualization/gis_visualization.twig | 4 +- templates/table/index_form.twig | 8 +- templates/table/page_with_secondary_tabs.twig | 4 +- templates/table/relation/common_form.twig | 18 ++-- templates/table/relation/foreign_key_row.twig | 8 +- templates/table/search/geom_func.twig | 4 +- templates/table/search/input_box.twig | 6 +- templates/table/search/selection_form.twig | 6 +- .../action_row_in_structure_table.twig | 4 +- .../table/structure/display_partitions.twig | 14 +-- .../table/structure/display_structure.twig | 92 +++++++++--------- .../table/structure/display_table_stats.twig | 16 ++-- templates/table/tracking/main.twig | 8 +- .../tracking/structure_snapshot_columns.twig | 8 +- 55 files changed, 254 insertions(+), 247 deletions(-) diff --git a/libraries/classes/Twig/UtilExtension.php b/libraries/classes/Twig/UtilExtension.php index c6277c7158..a13023b374 100644 --- a/libraries/classes/Twig/UtilExtension.php +++ b/libraries/classes/Twig/UtilExtension.php @@ -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' + ), + ]; + } } diff --git a/templates/columns_definitions/column_definitions_form.twig b/templates/columns_definitions/column_definitions_form.twig index ad7f738363..4a9b15d7ac 100644 --- a/templates/columns_definitions/column_definitions_form.twig +++ b/templates/columns_definitions/column_definitions_form.twig @@ -75,12 +75,12 @@   {% trans 'Storage Engine:' %} - {{ Util_showMySQLDocu('Storage_engines') }} + {{ show_mysql_docu('Storage_engines') }}   {% trans 'Connection:' %} - {{ Util_showMySQLDocu('federated-create-connection') }} + {{ show_mysql_docu('federated-create-connection') }} @@ -126,7 +126,7 @@ {% trans 'PARTITION definition:' %} - {{ Util_showMySQLDocu('Partitioning') }} + {{ show_mysql_docu('Partitioning') }} diff --git a/templates/columns_definitions/column_type.twig b/templates/columns_definitions/column_type.twig index c8f72a3459..e74eb0e135 100644 --- a/templates/columns_definitions/column_type.twig +++ b/templates/columns_definitions/column_type.twig @@ -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) }} diff --git a/templates/columns_definitions/move_column.twig b/templates/columns_definitions/move_column.twig index de2a2a5f3b..7c0b3f4bfc 100644 --- a/templates/columns_definitions/move_column.twig +++ b/templates/columns_definitions/move_column.twig @@ -9,7 +9,7 @@ {% for mi in 0..move_columns|length - 1 %} {% endfor %} diff --git a/templates/columns_definitions/table_fields_definitions.twig b/templates/columns_definitions/table_fields_definitions.twig index 9de82d795b..a4971c32c8 100644 --- a/templates/columns_definitions/table_fields_definitions.twig +++ b/templates/columns_definitions/table_fields_definitions.twig @@ -2,7 +2,7 @@ {% endif %} @@ -80,7 +80,7 @@ {% endif %} diff --git a/templates/database/central_columns/main.twig b/templates/database/central_columns/main.twig index 2be943ef96..ca9021367b 100644 --- a/templates/database/central_columns/main.twig +++ b/templates/database/central_columns/main.twig @@ -189,7 +189,7 @@ @@ -15,7 +15,7 @@ {% set sum_colspan = sum_colspan - 1 %} {% endif %} - {% 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] %} - {% 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] %} diff --git a/templates/database/structure/print_view_data_dictionary_link.twig b/templates/database/structure/print_view_data_dictionary_link.twig index 81d52035fa..8b9df8e4be 100644 --- a/templates/database/structure/print_view_data_dictionary_link.twig +++ b/templates/database/structure/print_view_data_dictionary_link.twig @@ -1,8 +1,8 @@ diff --git a/templates/database/structure/structure_table_row.twig b/templates/database/structure/structure_table_row.twig index 800db544b9..9ddd9854d2 100644 --- a/templates/database/structure/structure_table_row.twig +++ b/templates/database/structure/structure_table_row.twig @@ -14,8 +14,8 @@ {% if server_slave_status %} {% 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. #} diff --git a/templates/database/structure/table_header.twig b/templates/database/structure/table_header.twig index afeb106788..4888196cdf 100644 --- a/templates/database/structure/table_header.twig +++ b/templates/database/structure/table_header.twig @@ -5,7 +5,7 @@ - + {% if replication %} {% endif %} @@ -23,44 +23,44 @@ {# larger values are more interesting so default sort order is DESC #} {% if not (properties_num_columns > 1) %} - - + + {% endif %} {% if is_show_stats %} {# larger values are more interesting so default sort order is DESC #} - + {# larger values are more interesting so default sort order is DESC #} - + {% endif %} {% if show_charset %} - + {% endif %} {% if show_comment %} - + {% endif %} {% if show_creation %} {# newer values are more interesting so default sort order is DESC #} - + {% endif %} {% if show_last_update %} {# newer values are more interesting so default sort order is DESC #} - + {% endif %} {% if show_last_check %} {# newer values are more interesting so default sort order is DESC #} - + {% endif %} diff --git a/templates/database/structure/tracking_icon.twig b/templates/database/structure/tracking_icon.twig index 80280cd9bf..b09c9bb777 100644 --- a/templates/database/structure/tracking_icon.twig +++ b/templates/database/structure/tracking_icon.twig @@ -1,7 +1,7 @@ {% 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 %} diff --git a/templates/database/tracking/tables.twig b/templates/database/tracking/tables.twig index 3a9bd4b27c..43a75c1b38 100644 --- a/templates/database/tracking/tables.twig +++ b/templates/database/tracking/tables.twig @@ -48,23 +48,23 @@ - {{ Util_getIcon('b_drop', 'Delete tracking'|trans) }} + {{ get_icon('b_drop', 'Delete tracking'|trans) }} @@ -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 @@ @@ -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, diff --git a/templates/display/export/option_header.twig b/templates/display/export/option_header.twig index 074586a7ba..03e4f6b864 100644 --- a/templates/display/export/option_header.twig +++ b/templates/display/export/option_header.twig @@ -1,6 +1,6 @@ - + diff --git a/templates/server/binlog/log_selector.twig b/templates/server/binlog/log_selector.twig index 2b4b1cd7b8..4750bfe16b 100644 --- a/templates/server/binlog/log_selector.twig +++ b/templates/server/binlog/log_selector.twig @@ -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 %} @@ -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 %}
diff --git a/templates/server/databases/databases_footer.twig b/templates/server/databases/databases_footer.twig index 4fa3e645d0..6d2ae47bdb 100644 --- a/templates/server/databases/databases_footer.twig +++ b/templates/server/databases/databases_footer.twig @@ -42,7 +42,7 @@ 'form_name': 'dbStatsForm' } only %} - {{ Util_getButtonOrImage( + {{ get_button_or_image( '', 'mult_submit ajax', 'Drop'|trans, diff --git a/templates/server/databases/index.twig b/templates/server/databases/index.twig index d487dfb684..d701eff336 100644 --- a/templates/server/databases/index.twig +++ b/templates/server/databases/index.twig @@ -11,10 +11,10 @@

- {{ Util_showMySQLDocu('CREATE_DATABASE') }} + {{ show_mysql_docu('CREATE_DATABASE') }}

{{ get_hidden_inputs('', '', 5) }} @@ -39,13 +39,13 @@ {% else %} {# db creation no privileges message #}

- {{ Util_getImage('b_newdb') }} + {{ get_image('b_newdb') }} {% trans 'Create database' %} - {{ Util_showMySQLDocu('CREATE_DATABASE') }} + {{ show_mysql_docu('CREATE_DATABASE') }}

- {{ Util_getImage( + {{ get_image( 's_error', '', {'hspace': 2, 'border': 0, 'align': 'middle'} @@ -62,7 +62,7 @@ {# Displays the table #} {% if databases is not null %}
- {{ Util_getListNavigator( + {{ get_list_navigator( database_count, pos, url_params, @@ -86,7 +86,7 @@
diff --git a/templates/server/engines/show_engine.twig b/templates/server/engines/show_engine.twig index 279a398138..aa10e4d22a 100644 --- a/templates/server/engines/show_engine.twig +++ b/templates/server/engines/show_engine.twig @@ -1,7 +1,7 @@

- {{ Util_getImage('b_engine') }} + {{ get_image('b_engine') }} {{ title }} - {{ Util_showMySQLDocu(help_page) }} + {{ show_mysql_docu(help_page) }}

{{ comment }}

diff --git a/templates/server/privileges/add_user_fieldset.twig b/templates/server/privileges/add_user_fieldset.twig index 9774e10dce..26f0419c8c 100644 --- a/templates/server/privileges/add_user_fieldset.twig +++ b/templates/server/privileges/add_user_fieldset.twig @@ -4,5 +4,5 @@ {% if rel_params is not empty %} rel="{{ get_common(rel_params) }}" {% endif %}> - {{ Util_getIcon('b_usradd') }}{% trans 'Add user account' %} + {{ get_icon('b_usradd') }}{% trans 'Add user account' %} diff --git a/templates/server/privileges/choose_user_group.twig b/templates/server/privileges/choose_user_group.twig index f0c3b5aa0f..a28f3021d2 100644 --- a/templates/server/privileges/choose_user_group.twig +++ b/templates/server/privileges/choose_user_group.twig @@ -3,7 +3,7 @@
{% trans 'User group' %} {% trans 'User group' %}: - {{ Util_getDropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }} + {{ get_dropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }}
diff --git a/templates/server/privileges/delete_user_fieldset.twig b/templates/server/privileges/delete_user_fieldset.twig index d948afea11..4ffba78f2e 100644 --- a/templates/server/privileges/delete_user_fieldset.twig +++ b/templates/server/privileges/delete_user_fieldset.twig @@ -1,6 +1,6 @@
- {{ Util_getIcon('b_usrdrop') }}{% trans 'Remove selected user accounts' %} + {{ get_icon('b_usrdrop') }}{% trans 'Remove selected user accounts' %}

({% trans 'Revoke all active privileges from the users and delete them afterwards.' %})

diff --git a/templates/server/sub_page_header.twig b/templates/server/sub_page_header.twig index 883de257aa..959a12c968 100644 --- a/templates/server/sub_page_header.twig +++ b/templates/server/sub_page_header.twig @@ -39,10 +39,10 @@ } %}

{% 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) }}

diff --git a/templates/server/variables/link_template.twig b/templates/server/variables/link_template.twig index 4bcbfb157b..9b4f774e9e 100644 --- a/templates/server/variables/link_template.twig +++ b/templates/server/variables/link_template.twig @@ -1,10 +1,10 @@ - {{ Util_getIcon('b_save', 'Save'|trans) }} + {{ get_icon('b_save', 'Save'|trans) }} - {{ Util_getIcon('b_close', 'Cancel'|trans) }} + {{ get_icon('b_close', 'Cancel'|trans) }} -{{ Util_getImage('b_help', 'Documentation'|trans, { +{{ get_image('b_help', 'Documentation'|trans, { 'class': 'hide', 'id': 'docImage' }) }} diff --git a/templates/server/variables/variable_row.twig b/templates/server/variables/variable_row.twig index e07118c919..1aaff1b231 100644 --- a/templates/server/variables/variable_row.twig +++ b/templates/server/variables/variable_row.twig @@ -1,10 +1,10 @@
diff --git a/templates/table/chart/tbl_chart.twig b/templates/table/chart/tbl_chart.twig index 09706aab6c..c0eb627787 100644 --- a/templates/table/chart/tbl_chart.twig +++ b/templates/table/chart/tbl_chart.twig @@ -145,12 +145,12 @@ {% endfor %} - {{ Util_getStartAndNumberOfRowsPanel(sql_query) }} + {{ get_start_and_number_of_rows_panel(sql_query) }}
- {{ Util_getImage('b_saveimage', 'Save chart as image'|trans) }} + {{ get_image('b_saveimage', 'Save chart as image'|trans) }}
diff --git a/templates/table/gis_visualization/gis_visualization.twig b/templates/table/gis_visualization/gis_visualization.twig index c7016b4185..ebe642eb40 100644 --- a/templates/table/gis_visualization/gis_visualization.twig +++ b/templates/table/gis_visualization/gis_visualization.twig @@ -39,13 +39,13 @@
- {{ Util_getStartAndNumberOfRowsPanel(sql_query) }} + {{ get_start_and_number_of_rows_panel(sql_query) }}
- {{ Util_getImage('b_saveimage', 'Save'|trans) }} + {{ get_image('b_saveimage', 'Save'|trans) }}
@@ -32,14 +32,14 @@
{{ index.generateIndexChoiceSelector(create_edit_table)|raw }} - {{ Util_getDivForSliderEffect('indexoptions', 'Advanced Options'|trans) }} + {{ get_div_for_slider_effect('indexoptions', 'Advanced Options'|trans) }}
@@ -63,7 +63,7 @@
diff --git a/templates/table/page_with_secondary_tabs.twig b/templates/table/page_with_secondary_tabs.twig index f5d34cbb4b..2aae85aa9d 100644 --- a/templates/table/page_with_secondary_tabs.twig +++ b/templates/table/page_with_secondary_tabs.twig @@ -1,12 +1,12 @@ {% if cfg_relation['relwork'] or is_foreign_key_supported %}
    - {{ 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, diff --git a/templates/table/relation/common_form.twig b/templates/table/relation/common_form.twig index 83c36a76cf..9ecbce8c01 100644 --- a/templates/table/relation/common_form.twig +++ b/templates/table/relation/common_form.twig @@ -4,7 +4,7 @@
    {{ get_hidden_inputs(db, table) }} {# InnoDB #} - {% if Util_isForeignKeySupported(tbl_storage_engine) %} + {% if is_foreign_key_supported(tbl_storage_engine) %}
    {% trans 'Foreign key constraints' %}
    @@ -15,12 +15,12 @@ {% if tbl_storage_engine|upper == 'INNODB' %}
{% else %} {% endif %} {# @see tbl_structure.js, function moreOptsMenuResize() #} {% if not db_is_system_schema and not tbl_is_view %} - {% endif %} @@ -62,7 +62,7 @@ {{ displayed_fields[rownum].icon|raw }} - @@ -110,7 +110,7 @@ {% if not is_innodb and showtable['Rows'] is defined %} - + {% endif %} @@ -119,7 +119,7 @@ and showtable['Avg_row_length'] > 0 %} - {% 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) %} {% endif %} @@ -138,28 +138,28 @@ {% if showtable['Auto_increment'] is defined %} - + {% endif %} {% if showtable['Create_time'] is defined %} - + {% endif %} {% if showtable['Update_time'] is defined %} - + {% endif %} {% if showtable['Check_time'] is defined %} - + {% endif %} diff --git a/templates/table/tracking/main.twig b/templates/table/tracking/main.twig index 37370c5f12..c0aadb1ae3 100644 --- a/templates/table/tracking/main.twig +++ b/templates/table/tracking/main.twig @@ -58,7 +58,7 @@ @@ -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, diff --git a/templates/table/tracking/structure_snapshot_columns.twig b/templates/table/tracking/structure_snapshot_columns.twig index c98dfbe341..4ef8c215a1 100644 --- a/templates/table/tracking/structure_snapshot_columns.twig +++ b/templates/table/tracking/structure_snapshot_columns.twig @@ -22,9 +22,9 @@ {{ 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 %} @@ -33,10 +33,10 @@
{% trans 'Structure' %} - {{ Util_showMySQLDocu('CREATE_TABLE') }} + {{ show_mysql_docu('CREATE_TABLE') }}
@@ -10,15 +10,15 @@ {% trans 'Type' %} - {{ Util_showMySQLDocu('data-types') }} + {{ show_mysql_docu('data-types') }} {% trans 'Length/Values' %} - {{ Util_showHint('If column type is "enum" or "set", please enter the values using this format: \'a\',\'b\',\'c\'…
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\'…
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) }}
{% 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) }} {% trans 'Collation' %} @@ -34,7 +34,7 @@ {% if change_column is defined and change_column is not empty %} {% trans 'Adjust privileges' %} - {{ Util_showDocu('faq', 'faq6-39') }} + {{ show_docu('faq', 'faq6-39') }} {% trans 'Browser display transformation options' %} - {{ Util_showHint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…
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\'…
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) }}
{% trans 'Input transformation options' %} - {{ Util_showHint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…
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\'…
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) }}
- {{ Util_getIcon('centralColumns_add', 'Add column' | trans)|raw }} + {{ get_icon('centralColumns_add', 'Add column' | trans)|raw }}
{{ get_hidden_inputs(db) | raw }} @@ -276,10 +276,10 @@ value="{{ row['col_name'] | raw }}" id="{{ 'checkbox_row_' ~ row_num }}"/>
- {{ Util_getIcon('b_edit', 'Edit' | trans) | raw }} + {{ get_icon('b_edit', 'Edit' | trans) | raw }} - {{ Util_getIcon('b_drop', 'Delete' | trans) }} + {{ get_icon('b_drop', 'Delete' | trans) }} @@ -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, diff --git a/templates/database/create_table.twig b/templates/database/create_table.twig index 4b448788f5..0ab17c27e1 100644 --- a/templates/database/create_table.twig +++ b/templates/database/create_table.twig @@ -1,8 +1,8 @@
- {% if Util_showIcons('ActionLinksMode') -%} - {{ Util_getImage('b_table_add') }} + {% if show_icons('ActionLinksMode') -%} + {{ get_image('b_table_add') }} {%- endif %} {% trans "Create table" %} diff --git a/templates/database/designer/database_tables.twig b/templates/database/designer/database_tables.twig index aeefa07bd9..b7ce1187cc 100644 --- a/templates/database/designer/database_tables.twig +++ b/templates/database/designer/database_tables.twig @@ -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 diff --git a/templates/database/designer/main.twig b/templates/database/designer/main.twig index c04424bb5a..bf5a5ba03f 100644 --- a/templates/database/designer/main.twig +++ b/templates/database/designer/main.twig @@ -110,7 +110,7 @@ var designer_config = {{ designer_config | raw }}; {% trans 'Reload' %} -
- {{ Util_getRadioFields( + {{ get_radio_fields( 'save_page', { 'same': 'Save to selected page'|trans, diff --git a/templates/database/multi_table_query/form.twig b/templates/database/multi_table_query/form.twig index 2aff0ebfbb..3e9d301bea 100644 --- a/templates/database/multi_table_query/form.twig +++ b/templates/database/multi_table_query/form.twig @@ -1,4 +1,4 @@ -{{ Util_getDivForSliderEffect('query_div', 'Query window'|trans, 'open') }} +{{ get_div_for_slider_effect('query_div', 'Query window'|trans, 'open') }}
diff --git a/templates/database/search/main.twig b/templates/database/search/main.twig index 324dcc3044..926a94da97 100644 --- a/templates/database/search/main.twig +++ b/templates/database/search/main.twig @@ -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, diff --git a/templates/database/structure/body_for_table_summary.twig b/templates/database/structure/body_for_table_summary.twig index d9a97d9d88..4dc97cacd1 100644 --- a/templates/database/structure/body_for_table_summary.twig +++ b/templates/database/structure/body_for_table_summary.twig @@ -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)) }} {% if server_slave_status %}
{% trans 'Replication' %}{% trans 'Sum' %}{{ sum_formatted }} {{ sum_unit }}{{ overhead_formatted }} {{ overhead_unit }} - {{ 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) }}
{{ Util_sortableTableHeader('Table'|trans, 'table') }}{{ sortable_table_header('Table'|trans, 'table') }}{% trans 'Replication' %} - {{ 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 )) }} {{ Util_sortableTableHeader('Type'|trans, 'type') }}{{ Util_sortableTableHeader('Collation'|trans, 'collation') }}{{ sortable_table_header('Type'|trans, 'type') }}{{ sortable_table_header('Collation'|trans, 'collation') }}{{ Util_sortableTableHeader('Size'|trans, 'size', 'DESC') }}{{ sortable_table_header('Size'|trans, 'size', 'DESC') }}{{ Util_sortableTableHeader('Overhead'|trans, 'overhead', 'DESC') }}{{ sortable_table_header('Overhead'|trans, 'overhead', 'DESC') }}{{ Util_sortableTableHeader('Charset'|trans, 'charset') }}{{ sortable_table_header('Charset'|trans, 'charset') }}{{ Util_sortableTableHeader('Comment'|trans, 'comment') }}{{ sortable_table_header('Comment'|trans, 'comment') }}{{ Util_sortableTableHeader('Creation'|trans, 'creation', 'DESC') }}{{ sortable_table_header('Creation'|trans, 'creation', 'DESC') }}{{ Util_sortableTableHeader('Last update'|trans, 'last_update', 'DESC') }}{{ sortable_table_header('Last update'|trans, 'last_update', 'DESC') }}{{ Util_sortableTableHeader('Last check'|trans, 'last_check', 'DESC') }}{{ sortable_table_header('Last check'|trans, 'last_check', 'DESC') }}
- {{ Util_getIcon('b_versions', 'Versions'|trans) }} + {{ get_icon('b_versions', 'Versions'|trans) }} - {{ Util_getIcon('b_report', 'Tracking report'|trans) }} + {{ get_icon('b_report', 'Tracking report'|trans) }} - {{ Util_getIcon('b_props', 'Structure snapshot'|trans) }} + {{ get_icon('b_props', 'Structure snapshot'|trans) }}
- {{ Util_getIcon('eye', 'Track table'|trans) }} + {{ get_icon('eye', 'Track table'|trans) }}
{{- value['Orig_log_pos'] is defined ? value['Orig_log_pos'] : value['End_log_pos'] -}} {{ Util_formatSql(value['Info'], not dontlimitchars) }}{{ format_sql(value['Info'], not dontlimitchars) }}
{% 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 @@ {{ 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 ) }} diff --git a/templates/server/databases/table_row.twig b/templates/server/databases/table_row.twig index 9acc2c4138..4b41423831 100644 --- a/templates/server/databases/table_row.twig +++ b/templates/server/databases/table_row.twig @@ -8,7 +8,7 @@ {% endif %} - {{ 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) }}
{% if editable %} - {{ Util_getIcon('b_edit', 'Edit'|trans) }} + {{ get_icon('b_edit', 'Edit'|trans) }} {% else %} - {{ Util_getIcon('bd_edit', 'Edit'|trans) }} + {{ get_icon('bd_edit', 'Edit'|trans) }} {% endif %}
{% 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) }} {% 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) }} @@ -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 %}
{% trans 'Internal relationships' %} - {{ Util_showDocu('config', 'cfg_Servers_relation') }} + {{ show_docu('config', 'cfg_Servers_relation') }} {% set saved_row_cnt = save_row|length - 1 %} @@ -184,7 +184,7 @@ {% endfor %}
{% trans 'Column' %} {% 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 %}
- {% if Util_isForeignKeySupported(tbl_storage_engine) %} + {% if is_foreign_key_supported(tbl_storage_engine) %} {% endif %} {% endif %} diff --git a/templates/table/relation/foreign_key_row.twig b/templates/table/relation/foreign_key_row.twig index 1f42bd70d3..454040fa95 100644 --- a/templates/table/relation/foreign_key_row.twig +++ b/templates/table/relation/foreign_key_row.twig @@ -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 @@ {% 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 %}
diff --git a/templates/table/search/geom_func.twig b/templates/table/search/geom_func.twig index 3ac3000a4a..f7a741529f 100644 --- a/templates/table/search/geom_func.twig +++ b/templates/table/search/geom_func.twig @@ -1,10 +1,10 @@ {# Displays 'Function' column if it is present #} - {% set geom_types = Util_getGISDatatypes() %} + {% set geom_types = get_gis_datatypes() %} {% if column_types[column_index] in geom_types %} {% 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) %} - {{ Util_linkOrButton(edit_url, edit_str, [], '_blank') }} + {{ link_or_button(edit_url, edit_str, [], '_blank') }} {% endif %} {% elseif column_type starts with 'enum' diff --git a/templates/table/search/selection_form.twig b/templates/table/search/selection_form.twig index ab8cc25bb4..d0a6557dcc 100644 --- a/templates/table/search/selection_form.twig +++ b/templates/table/search/selection_form.twig @@ -94,7 +94,7 @@
- {{ Util_getDivForSliderEffect('searchoptions', 'Options'|trans) }} + {{ get_div_for_slider_effect('searchoptions', 'Options'|trans) }} {# Displays columns select list for selecting distinct columns in the search #}
@@ -121,7 +121,7 @@ {% trans 'Or' %} {% trans 'Add search conditions (body of the "where" clause):' %} - {{ Util_showMySQLDocu('Functions') }} + {{ show_mysql_docu('Functions') }}
@@ -147,7 +147,7 @@ {% endfor %} - {{ Util_getRadioFields( + {{ get_radio_fields( 'order', { 'ASC': 'Ascending'|trans, diff --git a/templates/table/structure/action_row_in_structure_table.twig b/templates/table/structure/action_row_in_structure_table.twig index 45bf4a3fc7..d9c629c9e2 100644 --- a/templates/table/structure/action_row_in_structure_table.twig +++ b/templates/table/structure/action_row_in_structure_table.twig @@ -17,12 +17,12 @@ {%- endif %}" href="tbl_structure.php" data-post="{{ url_query|raw -}} &add_key=1&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 -}} &message_to_show={{ message|format(row['Field']|e)|url_encode }}"> {{ titles[action]|raw }} diff --git a/templates/table/structure/display_partitions.twig b/templates/table/structure/display_partitions.twig index fa6208d0cb..b8a11f3549 100644 --- a/templates/table/structure/display_partitions.twig +++ b/templates/table/structure/display_partitions.twig @@ -2,7 +2,7 @@
{% trans 'Partitions' %} - {{ Util_showMySQLDocu('partitioning') }} + {{ show_mysql_docu('partitioning') }} {% if partitions is empty %} {{ 'No partitioning defined!'|trans|notice }} @@ -56,7 +56,7 @@ {% endif %}
{{ partition.getRows() }} - {% set data_length = Util_formatByteDown( + {% set data_length = format_byte_down( partition.getDataLength(), 3, 1 @@ -65,7 +65,7 @@ {{ data_length[1] }} - {% set index_length = Util_formatByteDown( + {% set index_length = format_byte_down( partition.getIndexLength(), 3, 1 @@ -78,7 +78,7 @@ {{ sub_partition.getRows() }} - {% set data_length = Util_formatByteDown( + {% set data_length = format_byte_down( sub_partition.getDataLength(), 3, 1 @@ -108,7 +108,7 @@ {{ data_length[1] }} - {% set index_length = Util_formatByteDown( + {% set index_length = format_byte_down( sub_partition.getIndexLength(), 3, 1 @@ -134,7 +134,7 @@ {% if partitions is empty %} {% else %} - {{ Util_linkOrButton(remove_url, 'Remove partitioning'|trans, { + {{ link_or_button(remove_url, 'Remove partitioning'|trans, { 'class': 'button ajax', 'id': 'remove_partitioning' }) }} diff --git a/templates/table/structure/display_structure.twig b/templates/table/structure/display_structure.twig index 909a225b7a..71d6e61bc3 100644 --- a/templates/table/structure/display_structure.twig +++ b/templates/table/structure/display_structure.twig @@ -30,7 +30,7 @@ {% trans 'Extra' %}{% trans 'Action' %}
+ {{ extracted_columnspec['displayed_type']|raw }} {% if relation_commwork and relation_mimework and browse_mime @@ -81,7 +81,7 @@ {% 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 @@
{% trans 'Rows' %}{{ Util_formatNumber(showtable['Rows'], 0) }}{{ format_number(showtable['Rows'], 0) }}
{% trans 'Row length' %}{{ avg_row_length[0] }} {{ avg_row_length[1] }}
{% trans 'Next autoindex' %}{{ Util_formatNumber(showtable['Auto_increment'], 0) }}{{ format_number(showtable['Auto_increment'], 0) }}
{% trans 'Creation' %}{{ Util_localisedDate(showtable['Create_time']|date('U')) }}{{ localised_date(showtable['Create_time']|date('U')) }}
{% trans 'Last update' %}{{ Util_localisedDate(showtable['Update_time']|date('U')) }}{{ localised_date(showtable['Update_time']|date('U')) }}
{% trans 'Last check' %}{{ Util_localisedDate(showtable['Check_time']|date('U')) }}{{ localised_date(showtable['Check_time']|date('U')) }}
- {{ Util_getIcon('b_drop', 'Delete version'|trans) }} + {{ get_icon('b_drop', 'Delete version'|trans) }} @@ -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) }}    - {{ Util_getIcon('b_props', 'Structure snapshot'|trans) }} + {{ get_icon('b_props', 'Structure snapshot'|trans) }}
{{ field['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }} {% 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 %}