PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
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 / Conversational / Fields / TextAreaField.php

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

72 lines 2.7 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\Conversational\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 ConversationalInputWrapper($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value);
12 $input = self::field($formID, $field, $rowID, $form_atomic_Cls_map, $value);
13 return $inputWrapper->wrapper($input);
14 }
15
16 private static function field($formID, $field, $rowID, $form_atomic_Cls_map, $value)
17 {
18 $fieldHelpers = new ConversationalFieldHelpers($formID, $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 $inputWrapperCustomAttributes = $fieldHelpers->getCustomAttributes('inp-fld-wrp');
40 $inputWrapperClass = $fieldHelpers->getConversationalCls('inp-fld-wrp') . ' ' . $fieldHelpers->getCustomClasses('inp-fld-wrp');
41 $fieldCustomAttributes = $fieldHelpers->getCustomAttributes('fld');
42 $fieldClass = $fieldHelpers->getConversationalCls('focus-elm') . ' ' . $fieldHelpers->getConversationalMultiCls('fld') . ' ' . $fieldHelpers->getCustomClasses('fld');
43 $id = "{$rowID}-{$contentCount}";
44 $escapedValue = $fieldHelpers->esc_textarea($value);
45
46 return '<div
47 ' . $inputWrapperCustomAttributes . '
48 class="' . $inputWrapperClass . '"
49 >
50 <textarea
51 ' . $fieldCustomAttributes . '
52 id="' . $id . '"
53 class="' . $fieldClass . '"
54 ' . $req . '
55 ' . $ariaRequired . '
56 ' . $ariaDescribedBy . '
57 ' . $disabled . '
58 ' . $readonly . '
59 ' . $ph . '
60 ' . $ac . '
61 ' . $name . '
62 ' . $minlength . '
63 ' . $maxlength . '
64 ' . $maxword . '
65 ' . $minword . '
66 >' . $escapedValue . '</textarea>
67 ' . $prefixIcn . '
68 ' . $suffixIcn . '
69 </div>';
70 }
71 }
72