From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../phpmyadmin/templates/gis_data_editor_form.twig | 221 +++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 srcs/phpmyadmin/templates/gis_data_editor_form.twig (limited to 'srcs/phpmyadmin/templates/gis_data_editor_form.twig') diff --git a/srcs/phpmyadmin/templates/gis_data_editor_form.twig b/srcs/phpmyadmin/templates/gis_data_editor_form.twig new file mode 100644 index 0000000..412561a --- /dev/null +++ b/srcs/phpmyadmin/templates/gis_data_editor_form.twig @@ -0,0 +1,221 @@ +
+ +
+

{{ 'Value for the column "%s"'|trans|format(field) }}

+ + + {# The input field to which the final result should be added and corresponding null checkbox #} + {% if input_name is not null %} + + {% endif %} + {{ get_hidden_inputs() }} + + {# Visualization section #} +
+ {{ visualization|raw }} +
+ +
+ +
+ + +
+ + + {# End of visualization section #} + + {# Header section - Inclueds GIS type selector and input field for SRID #} +
+ + + + +
+ {# End of header section #} + + {# Data section #} +
+ {% if geom_type == 'GEOMETRYCOLLECTION' %} + + {% endif %} + + {% for a in 0..geom_count - 1 %} + {% if gis_data[a] is not null %} + {% if geom_type == 'GEOMETRYCOLLECTION' %} +

+ {{ 'Geometry %d:'|trans|format(a + 1) }} +
+ {% if gis_data[a]['gis_type'] is not null %} + {% set type = gis_data[a]['gis_type'] %} + {% else %} + {% set type = gis_types[0] %} + {% endif %} + + {% else %} + {% set type = geom_type %} + {% endif %} + + {% if type == 'POINT' %} +
+ {% trans 'Point:' %} + + + + + {% elseif type == 'MULTIPOINT' or type == 'LINESTRING' %} + {% set no_of_points = gis_data[a][type]['no_of_points'] ?? 1 %} + {% if type == 'LINESTRING' and no_of_points < 2 %} + {% set no_of_points = 2 %} + {% endif %} + {% if type == 'MULTIPOINT' and no_of_points < 1 %} + {% set no_of_points = 1 %} + {% endif %} + {% if gis_data[a][type]['add_point'] is not null %} + {% set no_of_points = no_of_points + 1 %} + {% endif %} + + + {% for i in 0..no_of_points - 1 %} +
+ {{ 'Point %d:'|trans|format(i + 1) }} + + + + + {% endfor %} + + {% elseif type == 'MULTILINESTRING' or type == 'POLYGON' %} + {% set no_of_lines = gis_data[a][type]['no_of_lines'] ?? 1 %} + {% if no_of_lines < 1 %} + {% set no_of_lines = 1 %} + {% endif %} + {% if gis_data[a][type]['add_line'] is not null %} + {% set no_of_lines = no_of_lines + 1 %} + {% endif %} + + + {% for i in 0..no_of_lines - 1 %} +
+ {% if type == 'MULTILINESTRING' %} + {{ 'Linestring %d:'|trans|format(i + 1) }} + {% elseif i == 0 %} + {% trans 'Outer ring:' %} + {% else %} + {{ 'Inner ring %d:'|trans|format(i) }} + {% endif %} + + {% set no_of_points = gis_data[a][type][i]['no_of_points'] ?? 2 %} + {% if type == 'MULTILINESTRING' and no_of_points < 2 %} + {% set no_of_points = 2 %} + {% endif %} + {% if type == 'POLYGON' and no_of_points < 4 %} + {% set no_of_points = 4 %} + {% endif %} + {% if gis_data[a][type][i]['add_point'] is not null %} + {% set no_of_points = no_of_points + 1 %} + {% endif %} + + + {% for j in 0..no_of_points - 1 %} +
+ {{ 'Point %d:'|trans|format(j + 1) }} + + + + + {% endfor %} + + {% endfor %} +
+ + {% elseif type == 'MULTIPOLYGON' %} + {% set no_of_polygons = gis_data[a][type]['no_of_polygons'] ?? 1 %} + {% if no_of_polygons < 1 %} + {% set no_of_polygons = 1 %} + {% endif %} + {% if gis_data[a][type]['add_polygon'] is not null %} + {% set no_of_polygons = no_of_polygons + 1 %} + {% endif %} + + + {% for k in 0..no_of_polygons - 1 %} +
+ {{ 'Polygon %d:'|trans|format(k + 1) }} + {% set no_of_lines = gis_data[a][type][k]['no_of_lines'] ?? 1 %} + {% if no_of_lines < 1 %} + {% set no_of_lines = 1 %} + {% endif %} + {% if gis_data[a][type][k]['add_line'] is not null %} + {% set no_of_lines = no_of_lines + 1 %} + {% endif %} + + + {% for i in 0..no_of_lines - 1 %} +

+ {% if i == 0 %} + {% trans 'Outer ring:' %} + {% else %} + {{ 'Inner ring %d:'|trans|format(i) }} + {% endif %} + + {% set no_of_points = gis_data[a][type][k][i]['no_of_points'] ?? 4 %} + {% if no_of_points < 4 %} + {% set no_of_points = 4 %} + {% endif %} + {% if gis_data[a][type][k][i]['add_point'] is not null %} + {% set no_of_points = no_of_points + 1 %} + {% endif %} + + + {% for j in 0..no_of_points - 1 %} +
+ {{ 'Point %d:'|trans|format(j + 1) }} + + + + + {% endfor %} + + {% endfor %} +
+ +
+ {% endfor %} +
+ + {% endif %} + {% endif %} + {% endfor %} + {% if geom_type == 'GEOMETRYCOLLECTION' %} +

+ + {% endif %} +
+ {# End of data section #} + +
+ + +
+

{% trans 'Output' %}

+

+ {% trans 'Choose "GeomFromText" from the "Function" column and paste the string below into the "Value" field.' %} +

+ +
+
+
-- cgit