1
+ {#
2
+ # ---------------------------------------------------------------------
3
+ # Formcreator is a plugin which allows creation of custom forms of
4
+ # easy access.
5
+ # ---------------------------------------------------------------------
6
+ # LICENSE
7
+ #
8
+ # This file is part of Formcreator.
9
+ #
10
+ # Formcreator is free software; you can redistribute it and/or modify
11
+ # it under the terms of the GNU General Public License as published by
12
+ # the Free Software Foundation; either version 2 of the License, or
13
+ # (at your option) any later version.
14
+ #
15
+ # Formcreator is distributed in the hope that it will be useful,
16
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ # GNU General Public License for more details.
19
+ #
20
+ # You should have received a copy of the GNU General Public License
21
+ # along with Formcreator. If not, see <http://www.gnu.org/licenses/>.
22
+ # ---------------------------------------------------------------------
23
+ # @copyright Copyright © 2011 - 2021 Teclib'
24
+ # @license http://www.gnu.org/licenses/gpl.txt GPLv3+
25
+ # @link https://github.com/pluginsGLPI/formcreator/
26
+ # @link https://pluginsglpi.github.io/formcreator/
27
+ # @link http://plugins.glpi-project.org/#/plugin/formcreator
28
+ # ---------------------------------------------------------------------
29
+ #}
30
+
31
+
32
+ {% block parameters %}
33
+ {{ _self.regexField (params .name , item , label ) }}
34
+ {% endblock %}
35
+
36
+ {% macro regexField(name , item , label = ' ' , options = {}) %}
37
+ {% import ' components/form/fields_macros.html.twig' as fields %}
38
+
39
+ {{ fields.textField (name ~ ' [regex]' , item .fields .regex , __(' Regular expression' , ' formcreator' ), {rand : ' ' }) }}
40
+
41
+ {{ fields.nullField () }}
42
+ {% endmacro %}
0 commit comments