From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../table/browse_foreigners/column_element.twig | 12 + .../table/browse_foreigners/show_all.twig | 5 + .../templates/table/chart/tbl_chart.twig | 159 +++++++ .../table/gis_visualization/gis_visualization.twig | 80 ++++ srcs/phpmyadmin/templates/table/index_form.twig | 223 +++++++++ .../table/insert/continue_insertion_form.twig | 19 + .../templates/table/operations/view.twig | 31 ++ .../templates/table/page_with_secondary_tabs.twig | 22 + .../templates/table/relation/common_form.twig | 223 +++++++++ .../table/relation/dropdown_generate.twig | 9 + .../templates/table/relation/foreign_key_row.twig | 136 ++++++ .../table/relation/relational_dropdown.twig | 18 + .../table/search/column_comparison_operators.twig | 3 + .../templates/table/search/fields_table.twig | 33 ++ .../templates/table/search/form_tag.twig | 4 + .../templates/table/search/geom_func.twig | 19 + .../templates/table/search/input_box.twig | 97 ++++ .../templates/table/search/replace_preview.twig | 39 ++ .../templates/table/search/rows_normal.twig | 39 ++ .../templates/table/search/rows_zoom.twig | 74 +++ .../templates/table/search/selection_form.twig | 226 +++++++++ .../templates/table/search/zoom_result_form.twig | 86 ++++ .../structure/action_row_in_structure_table.twig | 31 ++ .../table/structure/display_partitions.twig | 145 ++++++ .../table/structure/display_structure.twig | 516 +++++++++++++++++++++ .../table/structure/display_table_stats.twig | 169 +++++++ .../table/structure/partition_definition_form.twig | 14 + srcs/phpmyadmin/templates/table/tracking/main.twig | 132 ++++++ .../templates/table/tracking/report_table.twig | 27 ++ .../table/tracking/structure_snapshot_columns.twig | 56 +++ .../table/tracking/structure_snapshot_indexes.twig | 33 ++ 31 files changed, 2680 insertions(+) create mode 100644 srcs/phpmyadmin/templates/table/browse_foreigners/column_element.twig create mode 100644 srcs/phpmyadmin/templates/table/browse_foreigners/show_all.twig create mode 100644 srcs/phpmyadmin/templates/table/chart/tbl_chart.twig create mode 100644 srcs/phpmyadmin/templates/table/gis_visualization/gis_visualization.twig create mode 100644 srcs/phpmyadmin/templates/table/index_form.twig create mode 100644 srcs/phpmyadmin/templates/table/insert/continue_insertion_form.twig create mode 100644 srcs/phpmyadmin/templates/table/operations/view.twig create mode 100644 srcs/phpmyadmin/templates/table/page_with_secondary_tabs.twig create mode 100644 srcs/phpmyadmin/templates/table/relation/common_form.twig create mode 100644 srcs/phpmyadmin/templates/table/relation/dropdown_generate.twig create mode 100644 srcs/phpmyadmin/templates/table/relation/foreign_key_row.twig create mode 100644 srcs/phpmyadmin/templates/table/relation/relational_dropdown.twig create mode 100644 srcs/phpmyadmin/templates/table/search/column_comparison_operators.twig create mode 100644 srcs/phpmyadmin/templates/table/search/fields_table.twig create mode 100644 srcs/phpmyadmin/templates/table/search/form_tag.twig create mode 100644 srcs/phpmyadmin/templates/table/search/geom_func.twig create mode 100644 srcs/phpmyadmin/templates/table/search/input_box.twig create mode 100644 srcs/phpmyadmin/templates/table/search/replace_preview.twig create mode 100644 srcs/phpmyadmin/templates/table/search/rows_normal.twig create mode 100644 srcs/phpmyadmin/templates/table/search/rows_zoom.twig create mode 100644 srcs/phpmyadmin/templates/table/search/selection_form.twig create mode 100644 srcs/phpmyadmin/templates/table/search/zoom_result_form.twig create mode 100644 srcs/phpmyadmin/templates/table/structure/action_row_in_structure_table.twig create mode 100644 srcs/phpmyadmin/templates/table/structure/display_partitions.twig create mode 100644 srcs/phpmyadmin/templates/table/structure/display_structure.twig create mode 100644 srcs/phpmyadmin/templates/table/structure/display_table_stats.twig create mode 100644 srcs/phpmyadmin/templates/table/structure/partition_definition_form.twig create mode 100644 srcs/phpmyadmin/templates/table/tracking/main.twig create mode 100644 srcs/phpmyadmin/templates/table/tracking/report_table.twig create mode 100644 srcs/phpmyadmin/templates/table/tracking/structure_snapshot_columns.twig create mode 100644 srcs/phpmyadmin/templates/table/tracking/structure_snapshot_indexes.twig (limited to 'srcs/phpmyadmin/templates/table') diff --git a/srcs/phpmyadmin/templates/table/browse_foreigners/column_element.twig b/srcs/phpmyadmin/templates/table/browse_foreigners/column_element.twig new file mode 100644 index 0000000..f2ec2ba --- /dev/null +++ b/srcs/phpmyadmin/templates/table/browse_foreigners/column_element.twig @@ -0,0 +1,12 @@ + + {{ is_selected ? '' }} + + {% if nowrap %} + {{ keyname }} + {% else %} + {{ description }} + {% endif %} + + {{ is_selected ? '' }} + diff --git a/srcs/phpmyadmin/templates/table/browse_foreigners/show_all.twig b/srcs/phpmyadmin/templates/table/browse_foreigners/show_all.twig new file mode 100644 index 0000000..4de9b81 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/browse_foreigners/show_all.twig @@ -0,0 +1,5 @@ +{% if foreign_data.disp_row is iterable and + (show_all and foreign_data.the_total > max_rows) %} + +{% endif %} diff --git a/srcs/phpmyadmin/templates/table/chart/tbl_chart.twig b/srcs/phpmyadmin/templates/table/chart/tbl_chart.twig new file mode 100644 index 0000000..4201599 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/chart/tbl_chart.twig @@ -0,0 +1,159 @@ + +{# Display Chart options #} +
+
+ {{ get_hidden_inputs(url_params) }} +
+ + {% trans 'Display chart' %} + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + + + + + + + + + + +

+ + + + +

+ + +
+ {% set xaxis = null %} +
+ + +
+ + + + +
+
+ + +
+ + +
+
+
+
+ + +
+ + + + +
+ {{ get_start_and_number_of_rows_panel(sql_query) }} +
+ +
+
+
diff --git a/srcs/phpmyadmin/templates/table/gis_visualization/gis_visualization.twig b/srcs/phpmyadmin/templates/table/gis_visualization/gis_visualization.twig new file mode 100644 index 0000000..9e82e2e --- /dev/null +++ b/srcs/phpmyadmin/templates/table/gis_visualization/gis_visualization.twig @@ -0,0 +1,80 @@ +
+
+ {% trans 'Display GIS Visualization' %} +
+
+ {{ get_hidden_inputs(url_params) }} + + + + + + + + + + + + {{ get_start_and_number_of_rows_panel(sql_query) }} +
+ +
+
+ + {{ get_image('b_saveimage', 'Save'|trans) }} + + +
+
+
+ +
+ +
+ {{ visualization|raw }} +
+
+ + +
+
diff --git a/srcs/phpmyadmin/templates/table/index_form.twig b/srcs/phpmyadmin/templates/table/index_form.twig new file mode 100644 index 0000000..6364599 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/index_form.twig @@ -0,0 +1,223 @@ +
+ + {{ get_hidden_inputs(form_params) }} + +
+
+
+
+ + + +
+ + +
+ +
+
+ + + +
+ {{ index.generateIndexChoiceSelector(create_edit_table)|raw }} +
+ + {% include 'div_for_slider_effect.twig' with { + 'id': 'indexoptions', + 'message': 'Advanced Options'|trans, + 'initial_sliders_state': default_sliders_state + } only %} + +
+
+ + + +
+ + +
+ +
+ +
+ + + +
+ {{ index.generateIndexTypeSelector()|raw }} +
+ +
+
+ + + +
+ + +
+ +
+
+ + + +
+ + +
+
+ + +
+ + + + + + + + + + {% set spatial_types = [ + 'geometry', + 'point', + 'linestring', + 'polygon', + 'multipoint', + 'multilinestring', + 'multipolygon', + 'geomtrycollection' + ] %} + + {% for column in index.getColumns() %} + + + + + + {% endfor %} + {% if add_fields > 0 %} + {% for i in range(1, add_fields) %} + + + + + + {% endfor %} + {% endif %} + +
+ {% trans 'Column' %} + + {% trans 'Size' %} +
+ + + + + +
+ + + + + +
+
+ +
+
+ +
+
+
+
+ + +
+
diff --git a/srcs/phpmyadmin/templates/table/insert/continue_insertion_form.twig b/srcs/phpmyadmin/templates/table/insert/continue_insertion_form.twig new file mode 100644 index 0000000..86a8215 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/insert/continue_insertion_form.twig @@ -0,0 +1,19 @@ +
+ {{ get_hidden_inputs(db, table) }} + + + + + {% if has_where_clause %} + {% for key_id, where_clause in where_clause_array %} + + {% endfor %} + {% endif %} + + {% set insert_rows %} + + {% endset %} + {{ 'Continue insertion with %s rows'|trans|format(insert_rows)|raw }} +
diff --git a/srcs/phpmyadmin/templates/table/operations/view.twig b/srcs/phpmyadmin/templates/table/operations/view.twig new file mode 100644 index 0000000..e590532 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/operations/view.twig @@ -0,0 +1,31 @@ + +
+
+ {{ get_hidden_inputs(db, table) }} + +
+ {% trans 'Operations' %} + + + + + + +
{% trans 'Rename view to' %} +
+
+
+ + +
+
+
+ +
+
+ {% trans 'Delete data or table' %} +
    {{ delete_data_or_table_link | raw }}
+
+
diff --git a/srcs/phpmyadmin/templates/table/page_with_secondary_tabs.twig b/srcs/phpmyadmin/templates/table/page_with_secondary_tabs.twig new file mode 100644 index 0000000..2aae85a --- /dev/null +++ b/srcs/phpmyadmin/templates/table/page_with_secondary_tabs.twig @@ -0,0 +1,22 @@ +{% if cfg_relation['relwork'] or is_foreign_key_supported %} + +
+{% endif %} + +
+ {% block content %} + {% endblock %} +
diff --git a/srcs/phpmyadmin/templates/table/relation/common_form.twig b/srcs/phpmyadmin/templates/table/relation/common_form.twig new file mode 100644 index 0000000..e85c6ce --- /dev/null +++ b/srcs/phpmyadmin/templates/table/relation/common_form.twig @@ -0,0 +1,223 @@ +{% extends 'table/page_with_secondary_tabs.twig' %} + +{% block content %} +
+ {{ get_hidden_inputs(db, table) }} + {# InnoDB #} + {% if is_foreign_key_supported(tbl_storage_engine) %} +
+ {% trans 'Foreign key constraints' %} +
+ + + + + {% if tbl_storage_engine|upper == 'INNODB' %} + + {% else %} + + {% endif %} + + + + + + + + + + + {% set i = 0 %} + {% if existrel_foreign is not empty %} + {% for key, one_key in existrel_foreign %} + {# Foreign database dropdown #} + {% set foreign_db = one_key['ref_db_name'] is defined + and one_key['ref_db_name'] is not null + ? one_key['ref_db_name'] : db %} + {% set foreign_table = false %} + {% if foreign_db %} + {% set foreign_table = one_key['ref_table_name'] is defined + and one_key['ref_table_name'] is not null + ? one_key['ref_table_name'] : false %} + {% endif %} + {% set unique_columns = [] %} + {% if foreign_db and foreign_table %} + {% set table_obj = table_get(foreign_table, foreign_db) %} + {% set unique_columns = table_obj.getUniqueColumns(false, false) %} + {% endif %} + {% include 'table/relation/foreign_key_row.twig' with { + 'i': i, + 'one_key': one_key, + 'column_array': column_array, + 'options_array': options_array, + 'tbl_storage_engine': tbl_storage_engine, + 'db': db, + 'table': table, + 'url_params': url_params, + 'databases': databases, + 'foreign_db': foreign_db, + 'foreign_table': foreign_table, + 'unique_columns': unique_columns + } only %} + {% set i = i + 1 %} + {% endfor %} + {% endif %} + {% include 'table/relation/foreign_key_row.twig' with { + 'i': i, + 'one_key': [], + 'column_array': column_array, + 'options_array': options_array, + 'tbl_storage_engine': tbl_storage_engine, + 'db': db, + 'table': table, + 'url_params': url_params, + 'databases': databases, + 'foreign_db': foreign_db, + 'foreign_table': foreign_table, + 'unique_columns': unique_columns + } only %} + {% set i = i + 1 %} + + + +
{% trans 'Actions' %}{% trans 'Constraint properties' %} + {% trans 'Column' %} + {{ 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' %} + {{ show_hint('Only columns with index will be displayed. You can define an index below.'|trans) }} + + {% trans 'Foreign key constraint' %} + ({{ tbl_storage_engine }}) +
{% trans 'Database' %}{% trans 'Table' %}{% trans 'Column' %}
+ + {% trans '+ Add constraint' %} + +
+
+
+ {% endif %} + + {% if cfg_relation['relwork'] %} + {% if is_foreign_key_supported(tbl_storage_engine) %} + {% include 'div_for_slider_effect.twig' with { + 'id': 'ir_div', + 'message': 'Internal relationships'|trans, + 'initial_sliders_state': default_sliders_state + } only %} + {% endif %} + +
+ + {% trans 'Internal relationships' %} + {{ show_docu('config', 'cfg_Servers_relation') }} + + + + + + {% set saved_row_cnt = save_row|length - 1 %} + {% for i in 0..saved_row_cnt %} + {% set myfield = save_row[i]['Field'] %} + {# Use an md5 as array index to avoid having special characters + in the name attribute (see bug #1746964 ) #} + {% set myfield_md5 = column_hash_array[myfield] %} + + {% set foreign_table = false %} + {% set foreign_column = false %} + + {# Database dropdown #} + {% if existrel[myfield] is defined %} + {% set foreign_db = existrel[myfield]['foreign_db'] %} + {% else %} + {% set foreign_db = db %} + {% endif %} + + {# Table dropdown #} + {% set tables = [] %} + {% if foreign_db %} + {% if existrel[myfield] is defined %} + {% set foreign_table = existrel[myfield]['foreign_table'] %} + {% endif %} + {% set tables = dbi.getTables(foreign_db) %} + {% endif %} + + {# Column dropdown #} + {% set unique_columns = [] %} + {% if foreign_db and foreign_table %} + {% if existrel[myfield] is defined %} + {% set foreign_column = existrel[myfield]['foreign_field'] %} + {% endif %} + {% set table_obj = table_get(foreign_table, foreign_db) %} + {% set unique_columns = table_obj.getUniqueColumns(false, false) %} + {% endif %} + + + + + + + {% endfor %} +
{% trans 'Column' %}{% trans 'Internal relation' %} + {% 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 %} +
+ {{ myfield }} + + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_db[' ~ myfield_md5 ~ ']', + 'title': 'Database'|trans, + 'values': databases, + 'foreign': foreign_db + } only %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_table[' ~ myfield_md5 ~ ']', + 'title': 'Table'|trans, + 'values': tables, + 'foreign': foreign_table + } only %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_column[' ~ myfield_md5 ~ ']', + 'title': 'Column'|trans, + 'values': unique_columns, + 'foreign': foreign_column + } only %} +
+
+ {% if is_foreign_key_supported(tbl_storage_engine) %} + + {% endif %} + {% endif %} + + {% if cfg_relation['displaywork'] %} + {% set disp = get_display_field(db, table) %} +
+ + +
+ {% endif %} + +
+ + +
+
+{% if foreignKeySupported %} + {{ displayIndexesHtml|raw }} +{% endif %} +{% endblock %} diff --git a/srcs/phpmyadmin/templates/table/relation/dropdown_generate.twig b/srcs/phpmyadmin/templates/table/relation/dropdown_generate.twig new file mode 100644 index 0000000..ff179bc --- /dev/null +++ b/srcs/phpmyadmin/templates/table/relation/dropdown_generate.twig @@ -0,0 +1,9 @@ +{{ dropdown_question is not empty ? dropdown_question -}} + diff --git a/srcs/phpmyadmin/templates/table/relation/foreign_key_row.twig b/srcs/phpmyadmin/templates/table/relation/foreign_key_row.twig new file mode 100644 index 0000000..3df6c34 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/relation/foreign_key_row.twig @@ -0,0 +1,136 @@ + + {# Drop key anchor #} + + {% set js_msg = '' %} + {% set this_params = null %} + {% if one_key['constraint'] is defined %} + {% set drop_fk_query = 'ALTER TABLE ' ~ backquote(db) ~ '.' ~ backquote(table) + ~ ' DROP FOREIGN KEY ' + ~ backquote(one_key['constraint']) ~ ';' + %} + {% set this_params = url_params %} + {% set this_params = { + 'goto': 'tbl_relation.php', + 'back': 'tbl_relation.php', + 'sql_query': drop_fk_query, + 'message_to_show': 'Foreign key constraint %s has been dropped'|trans|format( + one_key['constraint'] + ) + } %} + {% set js_msg = 'ALTER TABLE ' ~ db ~ '.' ~ table ~ ' DROP FOREIGN KEY ' ~ one_key['constraint'] ~ ';'|js_format %} + {% endif %} + {% if one_key['constraint'] is defined %} + + {% set drop_url = 'sql.php' ~ get_common(this_params) %} + {% set drop_str = get_icon('b_drop', 'Drop'|trans) %} + {{ link_or_button(drop_url, drop_str, {'class': 'drop_foreign_key_anchor ajax'}) }} + {% endif %} + + + + + +
+ {# For ON DELETE and ON UPDATE, the default action + is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE + won't display the clause if it's set as RESTRICT. #} + {% set on_delete = one_key['on_delete'] is defined + ? one_key['on_delete'] : 'RESTRICT' %} + {% set on_update = one_key['on_update'] is defined + ? one_key['on_update'] : 'RESTRICT' %} + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': 'ON DELETE', + 'select_name': 'on_delete[' ~ i ~ ']', + 'choices': options_array, + 'selected_value': on_delete + } only %} + + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': 'ON UPDATE', + 'select_name': 'on_update[' ~ i ~ ']', + 'choices': options_array, + 'selected_value': on_update + } only %} + +
+ + + {% if one_key['index_list'] is defined %} + {% for key, column in one_key['index_list'] %} + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': '', + 'select_name': 'foreign_key_fields_name[' ~ i ~ '][]', + 'choices': column_array, + 'selected_value': column + } only %} + + {% endfor %} + {% else %} + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': '', + 'select_name': 'foreign_key_fields_name[' ~ i ~ '][]', + 'choices': column_array, + 'selected_value': '' + } only %} + + {% endif %} + + {% trans '+ Add column' %} + + + {% set tables = [] %} + {% if foreign_db %} + {% set tables = get_tables(foreign_db, tbl_storage_engine) %} + {% endif %} + + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_db[' ~ i ~ ']', + 'title': 'Database'|trans, + 'values': databases, + 'foreign': foreign_db + } only %} + + + + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_table[' ~ i ~ ']', + 'title': 'Table'|trans, + 'values': tables, + 'foreign': foreign_table + } only %} + + + + {% if foreign_db and foreign_table %} + {% for foreign_column in one_key['ref_index_list'] %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_column[' ~ i ~ '][]', + 'title': 'Column'|trans, + 'values': unique_columns, + 'foreign': foreign_column + } only %} + + {% endfor %} + {% else %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_column[' ~ i ~ '][]', + 'title': 'Column'|trans, + 'values': [], + 'foreign': '' + } only %} + + {% endif %} + + diff --git a/srcs/phpmyadmin/templates/table/relation/relational_dropdown.twig b/srcs/phpmyadmin/templates/table/relation/relational_dropdown.twig new file mode 100644 index 0000000..9d5f3c9 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/relation/relational_dropdown.twig @@ -0,0 +1,18 @@ + diff --git a/srcs/phpmyadmin/templates/table/search/column_comparison_operators.twig b/srcs/phpmyadmin/templates/table/search/column_comparison_operators.twig new file mode 100644 index 0000000..b72e530 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/column_comparison_operators.twig @@ -0,0 +1,3 @@ + diff --git a/srcs/phpmyadmin/templates/table/search/fields_table.twig b/srcs/phpmyadmin/templates/table/search/fields_table.twig new file mode 100644 index 0000000..8b74939 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/fields_table.twig @@ -0,0 +1,33 @@ + + + + {% if geom_column_flag %} + + {% endif %} + + + + + + + + + {% if search_type == 'zoom' %} + {% include 'table/search/rows_zoom.twig' with { + 'self': self, + 'column_names': column_names, + 'keys': keys, + 'criteria_column_names': criteria_column_names, + 'criteria_column_types': criteria_column_types + } only %} + {% else %} + {% include 'table/search/rows_normal.twig' with { + 'self': self, + 'geom_column_flag': geom_column_flag, + 'column_names': column_names, + 'column_types': column_types, + 'column_collations': column_collations + } only %} + {% endif %} + +
{% trans 'Function' %}{% trans 'Column' %}{% trans 'Type' %}{% trans 'Collation' %}{% trans 'Operator' %}{% trans 'Value' %}
diff --git a/srcs/phpmyadmin/templates/table/search/form_tag.twig b/srcs/phpmyadmin/templates/table/search/form_tag.twig new file mode 100644 index 0000000..1017abd --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/form_tag.twig @@ -0,0 +1,4 @@ +
+ {{ get_hidden_inputs(db, table) }} + + diff --git a/srcs/phpmyadmin/templates/table/search/geom_func.twig b/srcs/phpmyadmin/templates/table/search/geom_func.twig new file mode 100644 index 0000000..f7a7415 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/geom_func.twig @@ -0,0 +1,19 @@ +{# Displays 'Function' column if it is present #} + + {% set geom_types = get_gis_datatypes() %} + {% if column_types[column_index] in geom_types %} + + {% else %} +   + {% endif %} + diff --git a/srcs/phpmyadmin/templates/table/search/input_box.twig b/srcs/phpmyadmin/templates/table/search/input_box.twig new file mode 100644 index 0000000..5c30535 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/input_box.twig @@ -0,0 +1,97 @@ +{# Get inputbox based on different column types (Foreign key, geometrical, enum) #} +{% if foreigners and search_column_in_foreigners(foreigners, column_name) %} + {% if foreign_data['disp_row'] is iterable %} + + {% elseif foreign_data['foreign_link'] == true %} + + + {{ titles['Browse']|replace({"'": "\\'"})|raw }} + + {% endif %} +{% elseif column_type in get_gis_datatypes() %} + + {% if in_fbs %} + {% set edit_url = 'gis_data_editor.php' ~ get_common() %} + {% set edit_str = get_icon('b_edit', 'Edit/Insert'|trans) %} + + {{ link_or_button(edit_url, edit_str, [], '_blank') }} + + {% endif %} +{% elseif column_type starts with 'enum' + or (column_type starts with 'set' and in_zoom_search_edit) %} + {% set in_zoom_search_edit = false %} + {% set value = column_type|e|slice(5, -1)|replace({''': ''})|split(', ') %} + {% set cnt_value = value|length %} + {# + Enum in edit mode --> dropdown + Enum in search mode --> multiselect + Set in edit mode --> multiselect + Set in search mode --> input (skipped here, so the 'else' section would handle it) + #} + {% if (column_type starts with 'enum' and not in_zoom_search_edit) + or (column_type starts with 'set' and in_zoom_search_edit) %} + + {% endif %} + {# Add select options #} + + {% for i in 0..cnt_value - 1 %} + {% if criteria_values[column_index] is defined + and criteria_values[column_index] is iterable + and value[i] in criteria_values[column_index] %} + + {% else %} + + {% endif %} + {% endfor %} + +{% else %} + {% set the_class = 'textfield' %} + {% if column_type == 'date' %} + {% set the_class = the_class ~ ' datefield' %} + {% elseif column_type == 'datetime' or column_type starts with 'timestamp' %} + {% set the_class = the_class ~ ' datetimefield' %} + {% elseif column_type starts with 'bit' %} + {% set the_class = the_class ~ ' bit' %} + {% endif %} + +{% endif %} diff --git a/srcs/phpmyadmin/templates/table/search/replace_preview.twig b/srcs/phpmyadmin/templates/table/search/replace_preview.twig new file mode 100644 index 0000000..e7a2423 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/replace_preview.twig @@ -0,0 +1,39 @@ + + {{ get_hidden_inputs(db, table) }} + + + + + + +
+ {% trans 'Find and replace - preview' %} + + + + + + + + + + {% if result is iterable %} + {% for row in result %} + + {# count #} + {# original #} + {# replaced #} + + {% endfor %} + {% endif %} + +
{% trans 'Count' %}{% trans 'Original string' %}{% trans 'Replaced string' %}
{{ row[2] }}{{ row[0] }}{{ row[1] }}
+
+ +
+ +
+
diff --git a/srcs/phpmyadmin/templates/table/search/rows_normal.twig b/srcs/phpmyadmin/templates/table/search/rows_normal.twig new file mode 100644 index 0000000..5e21efa --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/rows_normal.twig @@ -0,0 +1,39 @@ +{% for column_index in 0..column_names|length - 1 %} + + {# If 'Function' column is present trying to change comment #} + {% if geom_column_flag %} + {% include 'table/search/geom_func.twig' with { + 'column_index': column_index, + 'column_types': column_types + } only %} + {% endif %} + {# Displays column's name, type, collation and value #} + + {{ column_names[column_index] }} + + {% set properties = self.getColumnProperties(column_index, column_index) %} + + {{ properties['type'] }} + + + {{ properties['collation'] }} + + + {{ properties['func']|raw }} + + {# here, the data-type attribute is needed for a date/time picker #} + + {{ properties['value']|raw }} + {# Displays hidden fields #} + + + + + +{% endfor %} diff --git a/srcs/phpmyadmin/templates/table/search/rows_zoom.twig b/srcs/phpmyadmin/templates/table/search/rows_zoom.twig new file mode 100644 index 0000000..dc46f1d --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/rows_zoom.twig @@ -0,0 +1,74 @@ +{# Get already set search criteria (if any) #} +{% set type = [] %} +{% set collation = [] %} +{% set func = [] %} +{% set value = [] %} + +{% for i in 0..3 %} + {# After X-Axis and Y-Axis column rows, display additional criteria option #} + {% if i == 2 %} + + + {% trans 'Additional search criteria' %} + + + {% endif %} + + + + + {% if criteria_column_names[i] is defined + and criteria_column_names[i] != 'pma_null' %} + {% set key = keys[criteria_column_names[i]] %} + {% set properties = self.getColumnProperties(i, key) %} + {% set type = type|merge({i: properties['type']}) %} + {% set collation = collation|merge({i: properties['collation']}) %} + {% set func = func|merge({i: properties['func']}) %} + {% set value = value|merge({i: properties['value']}) %} + {% endif %} + {# Column type #} + + {{ type[i] is defined ? type[i] }} + + {# Column Collation #} + + {{ collation[i] is defined ? collation[i] }} + + {# Select options for column operators #} + + {{ func[i] is defined ? func[i]|raw }} + + {# Inputbox for search criteria value #} + + + + {{ value[i] is defined ? value[i]|raw }} + {# Displays hidden fields #} + + + + +{% endfor %} diff --git a/srcs/phpmyadmin/templates/table/search/selection_form.twig b/srcs/phpmyadmin/templates/table/search/selection_form.twig new file mode 100644 index 0000000..2ba4d60 --- /dev/null +++ b/srcs/phpmyadmin/templates/table/search/selection_form.twig @@ -0,0 +1,226 @@ +{% if search_type == 'zoom' %} + {%