← All changes
|
includes/Frontend/Form/View/Conversational/Fields/TextAreaField.php
+35
-18
2.10.0
→
3.3.1
View file →
| @@ -25,30 +25,47 @@ | ||
| 25 | 25 | $name = $fieldHelpers->name(); |
| 26 | 26 | $ac = $fieldHelpers->autocomplete(); |
| 27 | 27 | $ph = $fieldHelpers->placeholder(); |
| 28 | 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(); | |
| 29 | 35 | $bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds; |
| 30 | 36 | $contentCount = count($bfFrontendFormIds); |
| 31 | 37 | |
| 32 | 38 | // {...'disabled' in attr.valid && { readOnly: attr.valid.disabled }} |
| 33 | - return <<<TEXTAREAFIELD | |
| 34 | - <div | |
| 35 | - {$fieldHelpers->getCustomAttributes('inp-fld-wrp')} | |
| 36 | - class="{$fieldHelpers->getConversationalCls('inp-fld-wrp')} {$fieldHelpers->getCustomClasses('inp-fld-wrp')}" | |
| 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 . '" | |
| 37 | 49 | > |
| 38 | 50 | <textarea |
| 39 | - {$fieldHelpers->getCustomAttributes('fld')} | |
| 40 | - id="{$rowID}-{$contentCount}" | |
| 41 | - class="{$fieldHelpers->getConversationalCls('focus-elm')} {$fieldHelpers->getConversationalMultiCls('fld')} {$fieldHelpers->getCustomClasses('fld')}" | |
| 42 | - {$req} | |
| 43 | - {$disabled} | |
| 44 | - {$readonly} | |
| 45 | - {$ph} | |
| 46 | - {$ac} | |
| 47 | - {$name} | |
| 48 | - >{$fieldHelpers->esc_textarea($value)}</textarea> | |
| 49 | - {$prefixIcn} | |
| 50 | - {$suffixIcn} | |
| 51 | - </div> | |
| 52 | -TEXTAREAFIELD; | |
| 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>'; | |
| 53 | 70 | } |
| 54 | 71 | } |