PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.2.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.2.2
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / includes / Frontend / Form / View / Theme / Fields / TextAreaField.php

TextAreaField.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.2.2, at includes/Frontend/Form/View/Theme/Fields/TextAreaField.php

87 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Frontend\Form\View\Theme\Fields;
4
5 use BitCode\BitForm\Core\Util\FrontendHelpers;
6
7 class TextAreaField
8 {
9 public static function init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null)
10 {
11 $inputWrapper = new ClassicInputWrapper($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value);
12 $input = self::field($field, $rowID, $form_atomic_Cls_map, $value);
13 return $inputWrapper->wrapper($input);
14 }
15
16 private static function field($field, $rowID, $form_atomic_Cls_map, $value)
17 {
18 $fieldHelpers = new ClassicFieldHelpers($field, $rowID, $form_atomic_Cls_map);
19
20 $prefixIcn = $fieldHelpers->icon('prefixIcn', 'pre-i');
21 $suffixIcn = $fieldHelpers->icon('suffixIcn', 'suf-i');
22 $req = $fieldHelpers->required();
23 $disabled = $fieldHelpers->disabled();
24 $readonly = $fieldHelpers->readonly();
25 $name = $fieldHelpers->name();
26 $ac = $fieldHelpers->autocomplete();
27 $ph = $fieldHelpers->placeholder();
28 $value = $fieldHelpers->value();
29 $minlength = $fieldHelpers->minlength();
30 $maxlength = $fieldHelpers->maxlength();
31 $maxword = $fieldHelpers->maxword();
32 $minword = $fieldHelpers->minword();
33 $ariaDescribedBy = $fieldHelpers->ariaDescribedBy();
34 $ariaRequired = $fieldHelpers->ariaRequired();
35 $bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds;
36 $contentCount = count($bfFrontendFormIds);
37
38 // {...'disabled' in attr.valid && { readOnly: attr.valid.disabled }}
39
40 return sprintf(
41 '<div %1$s class="%2$s %3$s">
42 <textarea
43 %4$s
44 id="%5$s"
45 class="%6$s %7$s"
46 %8$s
47 %9$s
48 %10$s
49 %11$s
50 %12$s
51 %13$s
52 %14$s
53 %15$s
54 %16$s
55 %17$s
56 %18$s
57 %19$s
58 >%20$s</textarea>
59 %21$s
60 %22$s
61 </div>',
62 $fieldHelpers->getCustomAttributes('inp-fld-wrp'),
63 $fieldHelpers->getAtomicCls('inp-fld-wrp'),
64 $fieldHelpers->getCustomClasses('inp-fld-wrp'),
65 $fieldHelpers->getCustomAttributes('fld'),
66 "{$rowID}-{$contentCount}",
67 $fieldHelpers->getAtomicCls('fld'),
68 $fieldHelpers->getCustomClasses('fld'),
69 $req,
70 $ariaRequired,
71 $ariaDescribedBy,
72 $disabled,
73 $readonly,
74 $ph,
75 $ac,
76 $name,
77 $minlength,
78 $maxlength,
79 $maxword,
80 $minword,
81 $fieldHelpers->esc_textarea($value),
82 $prefixIcn,
83 $suffixIcn
84 );
85 }
86 }
87