From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../database/designer/database_tables.twig | 121 +++ .../database/designer/edit_delete_pages.twig | 13 + .../templates/database/designer/main.twig | 1105 ++++++++++++++++++++ .../templates/database/designer/page_save_as.twig | 37 + .../templates/database/designer/page_selector.twig | 10 + .../templates/database/designer/schema_export.twig | 9 + 6 files changed, 1295 insertions(+) create mode 100644 srcs/phpmyadmin/templates/database/designer/database_tables.twig create mode 100644 srcs/phpmyadmin/templates/database/designer/edit_delete_pages.twig create mode 100644 srcs/phpmyadmin/templates/database/designer/main.twig create mode 100644 srcs/phpmyadmin/templates/database/designer/page_save_as.twig create mode 100644 srcs/phpmyadmin/templates/database/designer/page_selector.twig create mode 100644 srcs/phpmyadmin/templates/database/designer/schema_export.twig (limited to 'srcs/phpmyadmin/templates/database/designer') diff --git a/srcs/phpmyadmin/templates/database/designer/database_tables.twig b/srcs/phpmyadmin/templates/database/designer/database_tables.twig new file mode 100644 index 0000000..5453bb5 --- /dev/null +++ b/srcs/phpmyadmin/templates/database/designer/database_tables.twig @@ -0,0 +1,121 @@ +{% for designerTable in tables %} + {% set i = loop.index0 %} + {% set t_n_url = designerTable.getDbTableString()|escape('url') %} + {% set db = designerTable.getDatabaseName() %} + {% set db_url = db|escape('url') %} + {% set t_n = designerTable.getDbTableString() %} + {% set table_name = designerTable.getTableName()|escape('html') %} + + + + + + + + {% if has_query %} + + {% endif %} + + + + {% if has_query %} + + {% endif %} + + + + {% set display_field = designerTable.getDisplayField() %} + {% for j in 0..tab_column[t_n]['COLUMN_ID']|length - 1 %} + {% set col_name = tab_column[t_n]['COLUMN_NAME'][j] %} + {% set tmp_column = t_n ~ '.' ~ tab_column[t_n]['COLUMN_NAME'][j] %} + {% set click_field_param = [ + designerTable.getTableName()|escape('url'), + tab_column[t_n]['COLUMN_NAME'][j]|url_encode + ] %} + {% if not designerTable.supportsForeignkeys() %} + {% 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 + index is a primary key #} + {% set click_field_param = click_field_param|merge([tables_all_keys[tmp_column] is defined ? 1 : 0]) %} + {% endif %} + {% set click_field_param = click_field_param|merge([db]) %} + + {% if has_query %} + + {% endif %} + + {% if has_query %} + + {% endif %} + + {% endfor %} + +
+ + {{ tab_pos[t_n] is not defined or tab_pos[t_n]['V'] is not empty ? 'v' : '>' }} + + + {{ designerTable.getDatabaseName() }} + {{ designerTable.getTableName() }} + +
+{% endfor %} diff --git a/srcs/phpmyadmin/templates/database/designer/edit_delete_pages.twig b/srcs/phpmyadmin/templates/database/designer/edit_delete_pages.twig new file mode 100644 index 0000000..75d1a1a --- /dev/null +++ b/srcs/phpmyadmin/templates/database/designer/edit_delete_pages.twig @@ -0,0 +1,13 @@ +
+ {{ get_hidden_inputs(db) }} +
+ + + {% include 'database/designer/page_selector.twig' with { + 'pdfwork': pdfwork, + 'pages': pages + } only %} +
+
diff --git a/srcs/phpmyadmin/templates/database/designer/main.twig b/srcs/phpmyadmin/templates/database/designer/main.twig new file mode 100644 index 0000000..f971dc5 --- /dev/null +++ b/srcs/phpmyadmin/templates/database/designer/main.twig @@ -0,0 +1,1105 @@ +{# Invisible characters will make javascript crash #} +{% apply spaceless %} + +{% endapply %} + +{# side menu #} +{% if not has_query %} +
+ + {{ selected_page == null ? 'Untitled'|trans : selected_page }} + + + {{ selected_page == null ? '*' : '' }} + +
+{% endif %} +
+ + v + + {% trans 'Show/Hide tables list' %} + + + + + + {% trans 'View in fullscreen' %} + + + + + + {% trans 'Add tables from other databases' %} + + + {% if not has_query %} + + + + {% trans 'New page' %} + + + + + + {% trans 'Open page' %} + + + + + + {% trans 'Save page' %} + + + + + + {% trans 'Save page as' %} + + + + + + {% trans 'Delete pages' %} + + + + + + {% trans 'Create table' %} + + + + + + {% trans 'Create relationship' %} + + + + + + {% trans 'Choose column to display' %} + + + + + + {% trans 'Reload' %} + + + + + + {% trans 'Help' %} + + + {% endif %} + + + + {% trans 'Angular links' %} / {% trans 'Direct links' %} + + + + + + {% trans 'Snap to grid' %} + + + + v + + {% trans 'Small/Big All' %} + + + + + + {% trans 'Toggle small/big' %} + + + + + + {% trans 'Toggle relationship lines' %} + + + {% if not visual_builder %} + + + + {% trans 'Export schema' %} + + + {% else %} + + + + {% trans 'Build Query' %} + + + {% endif %} + + > + + {% trans 'Move Menu' %} + + + + > + + {% trans 'Pin text' %} + + +
+
+
+
+ +
+
+ +
+
+
+ {# end id_scroll_tab #} +
+ {% trans 'Number of tables:' %} 0 +
+
+
+ +
+
+
+ {# end layer_menu #} + {% include 'database/designer/database_tables.twig' with { + 'db': db, + 'get_db': get_db, + 'has_query': has_query, + 'tab_pos': tab_pos, + 'display_page': display_page, + 'tab_column': tab_column, + 'tables_all_keys': tables_all_keys, + 'tables_pk_or_unique_keys': tables_pk_or_unique_keys, + 'columns_type': columns_type, + 'tables': designerTables, + 'theme': theme, + } only %} +
+
+
+{# create relation pane #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {% trans 'Create relationship' %} + +
+ + FOREIGN KEY + +
+ on delete + + +
+ on update + + +
+ + +
+
+
+
+
+
+ +
+{# delete relation pane #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + +
+ + {% trans 'Delete relationship' %} + +
+ + +
+
+
+
+
+
+ +
+{% if has_query %} + {# options pane #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + WHERE + +
+ {% trans 'Relationship operator' %} + + +
+ {% trans 'Value' %} +
+ {% trans 'subquery' %} +
+ +
+ + {% trans 'Rename to' %} + +
+ {% trans 'New name' %} + + +
+ + {% trans 'Aggregate' %} + +
+ {% trans 'Operator' %} + + +
+ + GROUP BY + + + +
+ + ORDER BY + + + +
+ + HAVING + +
+ {% trans 'Operator' %} + + +
+ {% trans 'Relationship operator' %} + + +
+ {% trans 'Value' %} +
+ {% trans 'subquery' %} +
+ +
+ + + + + + +
+
+
+
+
+
+ +
+ {# rename to pane #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + +
+ + {% trans 'Rename to' %} + +
+ {% trans 'New name' %} + + +
+ + +
+
+
+
+
+
+ +
+ {# having query panel #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + HAVING + +
+ {% trans 'Operator' %} + + +
+ {% trans 'Operator' %} + + +
+ {% trans 'Value' %} +
+ {% trans 'subquery' %} +
+ +
+ + +
+
+
+
+
+
+ +
+ {# aggregate query pane #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + +
+ + {% trans 'Aggregate' %} + +
+ {% trans 'Operator' %} + + +
+ + +
+
+
+
+
+
+ +
+ {# where query pane #} + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + WHERE + +
+ {% trans 'Operator' %} + + +
+ {% trans 'Value' %} +
+ {% trans 'subquery' %} +
+ +
+ + +
+
+
+
+
+
+ +
+ {# query details #} +
+
+
+
+
+ {% trans 'Active options' %} +
+
+ + + {{ get_hidden_inputs(get_db) }} +
+
+{% endif %} +
diff --git a/srcs/phpmyadmin/templates/database/designer/page_save_as.twig b/srcs/phpmyadmin/templates/database/designer/page_save_as.twig new file mode 100644 index 0000000..bbcf34b --- /dev/null +++ b/srcs/phpmyadmin/templates/database/designer/page_save_as.twig @@ -0,0 +1,37 @@ +
+ {{ get_hidden_inputs(db) }} +
+ + + + + + + + + + + + +
+ + {% include 'database/designer/page_selector.twig' with { + 'pdfwork': pdfwork, + 'pages': pages + } only %} +
+ {{ get_radio_fields( + 'save_page', + { + 'same': 'Save to selected page'|trans, + 'new': 'Create a page and save to it'|trans + }, + 'same', + true + ) }} +
+ + +
+
+
diff --git a/srcs/phpmyadmin/templates/database/designer/page_selector.twig b/srcs/phpmyadmin/templates/database/designer/page_selector.twig new file mode 100644 index 0000000..01c0650 --- /dev/null +++ b/srcs/phpmyadmin/templates/database/designer/page_selector.twig @@ -0,0 +1,10 @@ + diff --git a/srcs/phpmyadmin/templates/database/designer/schema_export.twig b/srcs/phpmyadmin/templates/database/designer/schema_export.twig new file mode 100644 index 0000000..71f15f2 --- /dev/null +++ b/srcs/phpmyadmin/templates/database/designer/schema_export.twig @@ -0,0 +1,9 @@ +
+
+ {{ get_hidden_inputs(db) }} + + {{ get_choice('Schema', 'export_type', export_list, 'format') }} + + {{ get_options('Schema', export_list) }} +
+
-- cgit