Browse code

Allow the `mandatory` optionin the field configuration

Cliff Parnitzky authored on08/10/2021 00:35:02
Showing1 changed files
... ...
@@ -15,6 +15,7 @@
15 15
  * Additions tl_form_field
16 16
  */
17 17
 $GLOBALS['TL_DCA']['tl_form_field']['palettes']['signature'] = '{type_legend},type,name,label;'
18
+                                                              .'{fconfig_legend},mandatory;'
18 19
                                                               .'{size_legend},sig_size;'
19 20
                                                               .'{expert_legend:hide},class,sig_bgcolor,sig_color,sig_width;'
20 21
                                                               .'{template_legend:hide},customTpl;'
Browse code

Initial

Hagen Klemp authored on03/02/2019 23:08:50
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,57 @@
1
+<?php
2
+
3
+/**
4
+ * Extension for Contao 4
5
+ *
6
+ * @copyright  Softleister 2019
7
+ * @author     Softleister <info@softleister.de>
8
+ * @package    contao-signature-formfield-bundle
9
+ *             based on jSignature (https://github.com/brinley/jSignature)
10
+ * @licence    MIT License
11
+ */
12
+
13
+
14
+/**
15
+ * Additions tl_form_field
16
+ */
17
+$GLOBALS['TL_DCA']['tl_form_field']['palettes']['signature'] = '{type_legend},type,name,label;'
18
+                                                              .'{size_legend},sig_size;'
19
+                                                              .'{expert_legend:hide},class,sig_bgcolor,sig_color,sig_width;'
20
+                                                              .'{template_legend:hide},customTpl;'
21
+                                                              .'{invisible_legend:hide},invisible';
22
+
23
+$GLOBALS['TL_DCA']['tl_form_field']['fields']['sig_size'] = array
24
+(
25
+    'label'                   => &$GLOBALS['TL_LANG']['tl_form_field']['sig_size'],
26
+    'default'                 => array(500, 250),
27
+    'exclude'                 => true,
28
+    'inputType'               => 'text',
29
+    'eval'                    => array('mandatory'=>true, 'multiple'=>true, 'size'=>2, 'rgxp'=>'natural', 'tl_class'=>'w50'),
30
+    'sql'                     => "varchar(255) NOT NULL default ''"
31
+);
32
+                                                      
33
+$GLOBALS['TL_DCA']['tl_form_field']['fields']['sig_bgcolor'] = array
34
+(
35
+    'label'                   => &$GLOBALS['TL_LANG']['tl_form_field']['sig_bgcolor'],
36
+    'inputType'               => 'text',
37
+    'eval'                    => array('maxlength'=>6, 'colorpicker'=>true, 'isHexColor'=>true, 'decodeEntities'=>true, 'tl_class'=>'w50 wizard'),
38
+    'sql'                     => "varchar(6) NOT NULL default ''"
39
+);
40
+
41
+$GLOBALS['TL_DCA']['tl_form_field']['fields']['sig_color'] = array
42
+(
43
+    'label'                   => &$GLOBALS['TL_LANG']['tl_form_field']['sig_color'],
44
+    'inputType'               => 'text',
45
+    'eval'                    => array('maxlength'=>6, 'colorpicker'=>true, 'isHexColor'=>true, 'decodeEntities'=>true, 'tl_class'=>'w50 wizard'),
46
+    'sql'                     => "varchar(6) NOT NULL default ''"
47
+);
48
+
49
+$GLOBALS['TL_DCA']['tl_form_field']['fields']['sig_width'] = array
50
+(
51
+    'label'                   => &$GLOBALS['TL_LANG']['tl_form_field']['sig_width'],
52
+    'default'                 => 5,
53
+    'exclude'                 => true,
54
+    'inputType'               => 'text',
55
+    'eval'                    => array('maxlength'=>5, 'rgxp'=>'natural', 'tl_class'=>'w50'),
56
+    'sql'                     => "smallint(5) unsigned NOT NULL default '0'"
57
+);