{% include 'table/structure/move_columns_dialog.twig' with {
'db': db,
'table': table
} only %}
{# Work on the table #}
{% if tbl_is_view and not db_is_system_schema %}
{{ Util_linkOrButton(
edit_view_url,
Util_getIcon('b_edit', 'Edit view'|trans, true)
) }}
{% endif %}
{% include 'table/structure/optional_action_links.twig' with {
'url_query': url_query,
'tbl_is_view': tbl_is_view,
'db_is_system_schema': db_is_system_schema,
'table': table,
'is_active': is_active
} only %}
{% if not tbl_is_view and not db_is_system_schema %}
{% include 'table/structure/add_column.twig' with {
'columns_list': columns_list,
'db': db,
'table': table
} only %}
{% endif %}
{# Displays indexes #}
{% if not tbl_is_view and not db_is_system_schema
and 'ARCHIVE' != tbl_storage_engine %}
{{ Index_getHtmlForDisplayIndexes() }}
{% endif %}
{# Display partition details #}
{% if have_partitioning %}
{# Detect partitioning #}
{% if partition_names is not empty and partition_names[0] is not null %}
{% set partitions = Partition_getPartitions(db, table) %}
{% set first_partition = partitions[0] %}
{% set range_or_list = first_partition.getMethod() == 'RANGE'
or first_partition.getMethod() == 'RANGE COLUMNS'
or first_partition.getMethod() == 'LIST'
or first_partition.getMethod() == 'LIST COLUMNS' %}
{% set sub_partitions = first_partition.getSubPartitions() %}
{% set has_sub_partitions = first_partition.hasSubPartitions() %}
{% if has_sub_partitions %}
{% set first_sub_partition = sub_partitions[0] %}
{% 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),
} %}
{% if range_or_list %}
{% set action_icons = action_icons|merge({'DROP': Util_getIcon('b_drop', 'Drop'|trans)}) %}
{% endif %}
{{ Util_getDivForSliderEffect('partitions', 'Partitions'|trans) }}
{% set remove_sql = 'ALTER TABLE ' ~ Util_backquote(table) ~ ' REMOVE PARTITIONING' %}
{% set remove_url = 'sql.php' ~ url_query ~ '&sql_query=' ~ remove_sql|url_encode %}
{% include 'table/structure/display_partitions.twig' with {
'db': db,
'table': table,
'url_query': url_query,
'partitions': partitions,
'partition_method': first_partition.getMethod(),
'partition_expression': first_partition.getExpression(),
'has_description': first_partition.getDescription() is not empty,
'has_sub_partitions': has_sub_partitions,
'sub_partition_method': has_sub_partitions ? first_sub_partition.getMethod(),
'sub_partition_expression': has_sub_partitions ? first_sub_partition.getExpression(),
'action_icons': action_icons,
'range_or_list': range_or_list,
'remove_url': remove_url
} only %}
{% else %}
{% include 'table/structure/display_partitions.twig' with {
'db': db,
'table': table
} only %}
{% endif %}
{# For closing Slider effect div #}
{% endif %}
{# Displays Space usage and row statistics #}
{% if show_stats %}
{{ table_stats|raw }}
{% endif %}