From 90d2333eef2938e8ebfcdb0d8b777bbfc56c6acd Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 19 Feb 2022 11:15:03 +0100 Subject: [PATCH] change port field in ipsandports to type-number Signed-off-by: Michael Kaufmann --- .../admin/ipsandports/formfield.ipsandports_add.php | 5 +++-- .../admin/ipsandports/formfield.ipsandports_edit.php | 5 +++-- templates/Froxlor/form/form.html.twig | 2 +- templates/Froxlor/form/formfields.html.twig | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php index 2ddd60ba..c9b734e9 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php @@ -29,8 +29,9 @@ return array( ), 'port' => array( 'label' => $lng['admin']['ipsandports']['port'], - 'type' => 'text', - 'size' => 5 + 'type' => 'number', + 'min' => 1, + 'max' => 65535 ) ) ), diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php index 65cb0984..b156e353 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php @@ -30,9 +30,10 @@ return array( ), 'port' => array( 'label' => $lng['admin']['ipsandports']['port'], - 'type' => 'text', + 'type' => 'number', 'value' => $result['port'], - 'size' => 5 + 'min' => 1, + 'max' => 65535 ) ) ), diff --git a/templates/Froxlor/form/form.html.twig b/templates/Froxlor/form/form.html.twig index 356aa224..4140c1ab 100644 --- a/templates/Froxlor/form/form.html.twig +++ b/templates/Froxlor/form/form.html.twig @@ -24,7 +24,7 @@ {% endif %}
{% for id,field in section.fields %} - {% if field.type == 'text' or field.type == 'password' %} + {% if field.type == 'text' or field.type == 'password' or field.type == 'number' %} {{ formfields.input(id, field) }} {% elseif field.type == 'textul' %} {{ formfields.input_ul(id, field) }} diff --git a/templates/Froxlor/form/formfields.html.twig b/templates/Froxlor/form/formfields.html.twig index dc8b8f36..84bfb998 100644 --- a/templates/Froxlor/form/formfields.html.twig +++ b/templates/Froxlor/form/formfields.html.twig @@ -42,7 +42,7 @@ {% endif %}
- +
{% endmacro %}