← All changes
|
includes/Frontend/Form/View/Theme/DefaultTheme.php
+192
-100
2.0
→
3.3.1
View file →
| @@ -1,10 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace BitCode\BitForm\Frontend\Form\View\Theme; |
| 4 | 4 | |
| 5 | -final class DefaultTheme extends ThemeBase { | |
| 6 | - protected function fileUp($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 5 | +final class DefaultTheme extends ThemeBase | |
| 6 | +{ | |
| 7 | + protected function fileUp($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 8 | + { | |
| 7 | 9 | $name = esc_attr($field_name); |
| 8 | 10 | $name .= isset($field->mul) ? '[]' : null; |
| 9 | 11 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 10 | 12 | $upBtnTxt = isset($field->upBtnTxt) ? '<span>' . esc_html($field->upBtnTxt) . '</span>' : ''; |
| @@ -11,28 +13,37 @@ | ||
| 11 | 13 | $maxUpload = isset($field->mxUp) ? 'Max ' . esc_html($field->mxUp) . ' MB' : ''; |
| 12 | 14 | $req = isset($field->req) ? 'required' : ''; |
| 13 | 15 | $mul = isset($field->mul) ? 'multiple' : ''; |
| 14 | 16 | $extention = isset($field->exts) ? "accept='" . esc_attr($field->exts) . "'" : ''; |
| 15 | - return <<<FILEUPLOAD | |
| 16 | - <div class="btcd-f-input"> | |
| 17 | + return sprintf( | |
| 18 | + ' <div class="btcd-f-input"> | |
| 17 | 19 | <div class="btcd-f-wrp"> |
| 18 | 20 | <div class="btn-wrp"> |
| 19 | 21 | <button class="btcd-inpBtn" type="button"> |
| 20 | 22 | <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" width="15" height="15"><path d="M13.5 7.5l-5.757 5.757a4.243 4.243 0 01-6-6l5.929-5.929a2.828 2.828 0 014 4l-5.758 5.758a1.414 1.414 0 01-2-2L9.5 3.5" stroke="currentColor" /></svg> |
| 21 | - $upBtnTxt | |
| 23 | + %1$s | |
| 22 | 24 | </button> |
| 23 | 25 | </div> |
| 24 | 26 | <span class="btcd-f-title">No File Chosen</span> |
| 25 | - <small class="f-max">$maxUpload</small> | |
| 26 | - <input id="$rowID" name="$name" $req $mul $extention $isDisabled type="file" /> | |
| 27 | + <small class="f-max">%2$s</small> | |
| 28 | + <input id="%3$s" name="%4$s" %5$s %6$s %7$s %8$s type="file" /> | |
| 27 | 29 | </div> |
| 28 | - </div> | |
| 29 | -FILEUPLOAD; | |
| 30 | + </div>', | |
| 31 | + $upBtnTxt, | |
| 32 | + $maxUpload, | |
| 33 | + $rowID, | |
| 34 | + $name, | |
| 35 | + $req, | |
| 36 | + $mul, | |
| 37 | + $extention, | |
| 38 | + $isDisabled | |
| 39 | + ); | |
| 30 | 40 | } |
| 31 | 41 | |
| 32 | - protected function submitBtns($field, $style, $field_id) { | |
| 42 | + protected function submitBtns($field, $style, $field_id) | |
| 43 | + { | |
| 33 | 44 | ob_start(); ?> |
| 34 | - <div class="<?php echo $style; ?>"> | |
| 45 | + <div class="<?php echo esc_attr($style); ?>"> | |
| 35 | 46 | <div> |
| 36 | 47 | <div class="btcd-frm-sub <?php 'center' === $field->align ? $this->setSingleValuedAttribute('j-c-c') : ''; ?><?php 'right' === $field->align ? $this->setSingleValuedAttribute('j-c-e') : ''; ?>"> |
| 37 | 48 | <button class="btcd-sub-btn btcd-sub <?php 'md' === $field->btnSiz ? $this->setSingleValuedAttribute('btcd-btn-md') : ''; ?> <?php $field->fulW ? $this->setSingleValuedAttribute('ful-w') : ''; ?>" type="submit" <?php isset($field->name) ? $this->setAttribute('name', $field->name) : '' ?>><?php echo esc_html($field->subBtnTxt) ?></button> |
| 38 | 49 | <?php //{'rstBtnTxt' in attr && <button className={`btcd-sub-btn btcd-rst ${attr.btnSiz === 'md' && 'btcd-btn-md'} ${attr.fulW && 'ful-w'}`} type="button">{attr.rstBtnTxt}</button>} |
| @@ -46,9 +57,10 @@ | ||
| 46 | 57 | <?php |
| 47 | 58 | return ob_get_clean(); |
| 48 | 59 | } |
| 49 | 60 | |
| 50 | - protected function button($field, $style, $field_name, $formID, $error, $value) { | |
| 61 | + protected function button($field, $style, $field_name, $formID, $error, $value) | |
| 62 | + { | |
| 51 | 63 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 52 | 64 | $align = isset($field->align) ? ('center' === $field->align ? 'j-c-c' : ('right' === $field->align ? 'j-c-e' : '')) : ''; |
| 53 | 65 | if ('reset' === $field->btnTyp) { |
| 54 | 66 | $btnCls = 'btcd-rst'; |
| @@ -59,23 +71,32 @@ | ||
| 59 | 71 | } |
| 60 | 72 | $btnSizCls = 'md' === $field->btnSiz ? 'btcd-btn-md' : ''; |
| 61 | 73 | $btnfulW = !empty($field->fulW) ? 'ful-w' : ''; |
| 62 | 74 | $btnTyp = !empty($field->btnTyp) ? "type='$field->btnTyp'" : ''; |
| 63 | - return <<<BUTTON | |
| 64 | - <div class='btcd-frm-sub $align'> | |
| 75 | + return sprintf( | |
| 76 | + '<div class="btcd-frm-sub %1$s"> | |
| 65 | 77 | <button |
| 66 | - class='btcd-sub-btn $btnCls $btnSizCls $btnfulW' | |
| 67 | - $btnTyp | |
| 68 | - $name | |
| 69 | - $isDisabled | |
| 78 | + class="btcd-sub-btn %2$s %3$s %4$s" | |
| 79 | + %5$s | |
| 80 | + %6$s | |
| 81 | + %7$s | |
| 70 | 82 | > |
| 71 | - $field->txt | |
| 83 | + %8$s | |
| 72 | 84 | </button> |
| 73 | - </div> | |
| 74 | -BUTTON; | |
| 85 | + </div>', | |
| 86 | + $align, | |
| 87 | + $btnCls, | |
| 88 | + $btnSizCls, | |
| 89 | + $btnfulW, | |
| 90 | + $btnTyp, | |
| 91 | + $name, | |
| 92 | + $isDisabled, | |
| 93 | + $field->txt | |
| 94 | + ); | |
| 75 | 95 | } |
| 76 | 96 | |
| 77 | - protected function textField($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 97 | + protected function textField($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 98 | + { | |
| 78 | 99 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 79 | 100 | $readonly = empty($field->valid->readonly) ? null : 'readonly'; |
| 80 | 101 | $name = isset($field_name) ? "name='" . esc_attr($field_name) . "'" : ''; |
| 81 | 102 | $ph = isset($field->ph) ? "placeholder='" . esc_attr($field->ph) . "'" : ''; |
| @@ -83,14 +104,26 @@ | ||
| 83 | 104 | $mn = isset($field->mn) ? "min='" . esc_attr($field->mn) . "'" : ''; |
| 84 | 105 | $val = isset($value) ? "value='" . esc_attr($value) . "'" : ''; |
| 85 | 106 | $required = isset($field->valid->req) ? 'required' : ''; |
| 86 | 107 | |
| 87 | - return <<<TEXTFIELD | |
| 88 | - <input id="$rowID" class="fld fld-$formID no-drg" type="$field->typ" $name $ph $mx $mn $val $required $isDisabled $readonly/> | |
| 89 | -TEXTFIELD; | |
| 108 | + return sprintf( | |
| 109 | + '<input id="%1$s" class="fld fld-%2$s no-drg" type="%3$s" %4$s %5$s %6$s %7$s %8$s %9$s %10$s %11$s/>', | |
| 110 | + $rowID, | |
| 111 | + $formID, | |
| 112 | + $field->typ, | |
| 113 | + $name, | |
| 114 | + $ph, | |
| 115 | + $mx, | |
| 116 | + $mn, | |
| 117 | + $val, | |
| 118 | + $required, | |
| 119 | + $isDisabled, | |
| 120 | + $readonly | |
| 121 | + ); | |
| 90 | 122 | } |
| 91 | 123 | |
| 92 | - protected function textArea($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 124 | + protected function textArea($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 125 | + { | |
| 93 | 126 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 94 | 127 | $readonly = empty($field->valid->readonly) ? null : 'readonly'; |
| 95 | 128 | $name = isset($field_name) ? "name='" . esc_attr($field_name) . "'" : ''; |
| 96 | 129 | if (isset($field->ph)) { |
| @@ -99,16 +132,26 @@ | ||
| 99 | 132 | $ph = isset($field->ph) ? "placeholder='$ph'" : ''; |
| 100 | 133 | $val = isset($value) ? $value : ''; |
| 101 | 134 | $required = isset($field->valid->req) ? 'required' : ''; |
| 102 | 135 | |
| 103 | - return <<<TEXTAREA | |
| 104 | - <div> | |
| 105 | - <textarea id="$rowID" class="fld fld-$formID no-drg" type="$field->typ" $name $ph $required $isDisabled $readonly>$val</textArea> | |
| 106 | - </div> | |
| 107 | -TEXTAREA; | |
| 136 | + return sprintf( | |
| 137 | + '<div> | |
| 138 | + <textarea id="%1$s" class="fld fld-%2$s no-drg" type="%3$s" %4$s %5$s %6$s %7$s %8$s>%9$s</textArea> | |
| 139 | + </div>', | |
| 140 | + $rowID, | |
| 141 | + $formID, | |
| 142 | + $field->typ, | |
| 143 | + $name, | |
| 144 | + $ph, | |
| 145 | + $required, | |
| 146 | + $isDisabled, | |
| 147 | + $readonly, | |
| 148 | + $val | |
| 149 | + ); | |
| 108 | 150 | } |
| 109 | 151 | |
| 110 | - protected function dropDown($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 152 | + protected function dropDown($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 153 | + { | |
| 111 | 154 | $defaultValue = null === $value ? [] : array_map('esc_html', $value); |
| 112 | 155 | $isDisabled = empty($field->valid->disabled) ? (empty($field->valid->readonly) ? null : 'msl-disabled') : 'msl-disabled'; |
| 113 | 156 | $mul = isset($field->mul); |
| 114 | 157 | $ph = isset($field->ph) ? "data-placeholder='$field->ph'" : "data-placeholder='Select...'"; |
| @@ -129,14 +172,14 @@ | ||
| 129 | 172 | $defaultValuePlacehold = "<div data-msl='true' $ph class='msl-input' contenteditable='true'></div>"; |
| 130 | 173 | if (null !== $defaultValue && 1 === sizeof($defaultValue) && !$mul) { |
| 131 | 174 | $defaultValuePlacehold = "<span class='msl-single-value' data-msl='true'>$defaultValue[0]</span>"; |
| 132 | 175 | } |
| 133 | - return <<<DROPDOWN | |
| 134 | - <div class="msl-wrp msl-vars no-drg $isDisabled fld fld-$formID dpd" style="width: 100%;"> | |
| 135 | - <input name="$field_name" type="hidden" value="$val"> | |
| 176 | + return sprintf( | |
| 177 | + ' <div class="msl-wrp msl-vars no-drg %1$s fld fld-%2$s dpd" style="width: 100%%;"> | |
| 178 | + <input name="%3$s" type="hidden" value="%4$s"> | |
| 136 | 179 | <div data-msl="true" class="msl"> |
| 137 | 180 | <div data-msl="true" class="msl-input-wrp" tabindex="0"> |
| 138 | - $defaultValuePlacehold | |
| 181 | + %5$s | |
| 139 | 182 | </div> |
| 140 | 183 | <div class="msl-actions msl-flx"> |
| 141 | 184 | <div role="button" aria-label="toggle-menu" class="msl-btn msl-arrow-btn msl-flx"></div> |
| 142 | 185 | </div> |
| @@ -141,27 +184,32 @@ | ||
| 141 | 184 | <div role="button" aria-label="toggle-menu" class="msl-btn msl-arrow-btn msl-flx"></div> |
| 142 | 185 | </div> |
| 143 | 186 | </div> |
| 144 | 187 | <div class="msl-options"> |
| 145 | - $options | |
| 188 | + %6$s | |
| 146 | 189 | </div> |
| 147 | - </div> | |
| 148 | -DROPDOWN; | |
| 190 | + </div>', | |
| 191 | + $isDisabled, | |
| 192 | + $formID, | |
| 193 | + $field_name, | |
| 194 | + $val, | |
| 195 | + $defaultValuePlacehold, | |
| 196 | + $options | |
| 197 | + ); | |
| 149 | 198 | } |
| 150 | 199 | |
| 151 | - protected function recaptcha($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 152 | - return <<<RECAPTCHA | |
| 153 | - <div class="btcd-flx j-c-c" style="min-height='inherit'"></div> | |
| 154 | -RECAPTCHA; | |
| 200 | + protected function recaptcha($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 201 | + { | |
| 202 | + return '<div class="btcd-flx j-c-c" style="min-height=inherit"></div>'; | |
| 155 | 203 | } |
| 156 | 204 | |
| 157 | - protected function paypal($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 158 | - return <<<PAYPAL | |
| 159 | - <div style="width: auto; min-width: 150px; max-width: 750px; margin-left: auto; margin-right: auto;"></div> | |
| 160 | -PAYPAL; | |
| 205 | + protected function paypal($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 206 | + { | |
| 207 | + return ' <div style="width: auto; min-width: 150px; max-width: 750px; margin-left: auto; margin-right: auto;"></div>'; | |
| 161 | 208 | } |
| 162 | 209 | |
| 163 | - protected function razorPay($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 210 | + protected function razorPay($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 211 | + { | |
| 164 | 212 | $center = 'center' === $field->align ? 'j-c-c' : ''; |
| 165 | 213 | $right = 'right' === $field->align ? 'j-c-e' : ''; |
| 166 | 214 | $btnSiz = 'md' === $field->btnSiz ? 'btcd-btn-md' : ''; |
| 167 | 215 | $fulW = $field->fulW ? 'ful-w' : ''; |
| @@ -166,18 +214,25 @@ | ||
| 166 | 214 | $btnSiz = 'md' === $field->btnSiz ? 'btcd-btn-md' : ''; |
| 167 | 215 | $fulW = $field->fulW ? 'ful-w' : ''; |
| 168 | 216 | $btnTxt = isset($field->btnTxt) ? esc_html($field->btnTxt) : ''; |
| 169 | 217 | |
| 170 | - return <<<RAZORPAY | |
| 171 | - <div class="btcd-frm-sub $center $right"> | |
| 172 | - <button class="btcd-sub-btn btcd-sub $btnSiz $fulW" type="button" name="$field_name"> | |
| 173 | - $btnTxt | |
| 218 | + return sprintf( | |
| 219 | + '<div class="btcd-frm-sub %1$s %2$s"> | |
| 220 | + <button class="btcd-sub-btn btcd-sub %3$s %4$s" type="button" name="%5$s"> | |
| 221 | + %6$s | |
| 174 | 222 | </button> |
| 175 | - </div> | |
| 176 | -RAZORPAY; | |
| 223 | + </div>', | |
| 224 | + $center, | |
| 225 | + $right, | |
| 226 | + $btnSiz, | |
| 227 | + $fulW, | |
| 228 | + $field_name, | |
| 229 | + $btnTxt | |
| 230 | + ); | |
| 177 | 231 | } |
| 178 | 232 | |
| 179 | - protected function checkBox($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 233 | + protected function checkBox($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 234 | + { | |
| 180 | 235 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 181 | 236 | $readonly = empty($field->valid->readonly) ? null : 'readonly'; |
| 182 | 237 | $round = isset($field->round) ? 'btcd-round' : ''; |
| 183 | 238 | $options = ''; |
| @@ -190,25 +245,36 @@ | ||
| 190 | 245 | $value = null === $value ? '' : $value; |
| 191 | 246 | if ((!is_array($value) && false !== strpos($value, $checkBoxOptionValue)) || (isset($value) && \is_array($value) && $checkBoxOptionValue === $value[array_search($checkBoxOptionValue, $value)])) { |
| 192 | 247 | $checked = 'checked'; |
| 193 | 248 | } |
| 194 | - $options .= <<<OPTION | |
| 195 | - <label class="btcd-ck-wrp btcd-ck-wrp-$formID"> | |
| 196 | - <span>$checkBoxOption->lbl</span> | |
| 197 | - <input type="checkbox" $checked $required $name value="$checkBoxOptionValue" $isDisabled $readonly/> | |
| 198 | - <span class="btcd-mrk ck"></span> | |
| 199 | - </label> | |
| 200 | -OPTION; | |
| 249 | + $options .= sprintf( | |
| 250 | + '<label class="btcd-ck-wrp btcd-ck-wrp-%1$s"> | |
| 251 | + <span>%2$s</span> | |
| 252 | + <input type="checkbox" %3$s %4$s %5$s value="%6$s" %7$s %8$s/> | |
| 253 | + <span class="btcd-mrk ck"></span> | |
| 254 | + </label>', | |
| 255 | + $formID, | |
| 256 | + $checkBoxOption->lbl, | |
| 257 | + $checked, | |
| 258 | + $required, | |
| 259 | + $name, | |
| 260 | + $checkBoxOptionValue, | |
| 261 | + $isDisabled, | |
| 262 | + $readonly | |
| 263 | + ); | |
| 201 | 264 | } |
| 202 | 265 | |
| 203 | - return <<<CHECKBOX | |
| 204 | - <div class="no-drg fld btcd-ck-con $round"> | |
| 205 | - $options | |
| 206 | - </div> | |
| 207 | -CHECKBOX; | |
| 266 | + return sprintf( | |
| 267 | + '<div class="no-drg fld btcd-ck-con %1$s"> | |
| 268 | + %2$s | |
| 269 | + </div>', | |
| 270 | + $round, | |
| 271 | + $options | |
| 272 | + ); | |
| 208 | 273 | } |
| 209 | 274 | |
| 210 | - protected function radioBox($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 275 | + protected function radioBox($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 276 | + { | |
| 211 | 277 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 212 | 278 | $readonly = empty($field->valid->readonly) ? null : 'readonly'; |
| 213 | 279 | $round = isset($field->round) ? 'btcd-round' : ''; |
| 214 | 280 | $options = ''; |
| @@ -220,25 +286,36 @@ | ||
| 220 | 286 | $checked = ''; |
| 221 | 287 | if (isset($checkBoxOption->check) || $checkBoxOption->lbl === $value) { |
| 222 | 288 | $checked = 'checked'; |
| 223 | 289 | } |
| 224 | - $options .= <<<OPTION | |
| 225 | - <label class="btcd-ck-wrp btcd-ck-wrp-$formID"> | |
| 226 | - <span>$checkBoxOption->lbl</span> | |
| 227 | - <input type="radio" $checked $required $name value="$optionValue" $isDisabled $readonly/> | |
| 290 | + $options .= sprintf( | |
| 291 | + '<label class="btcd-ck-wrp btcd-ck-wrp-%1$s"> | |
| 292 | + <span>%2$s</span> | |
| 293 | + <input type="radio" %3$s %4$s %5$s value="%6$s" %7$s %8$s/> | |
| 228 | 294 | <span class="btcd-mrk rdo"></span> |
| 229 | - </label> | |
| 230 | -OPTION; | |
| 295 | + </label>', | |
| 296 | + $formID, | |
| 297 | + $checkBoxOption->lbl, | |
| 298 | + $checked, | |
| 299 | + $required, | |
| 300 | + $name, | |
| 301 | + $optionValue, | |
| 302 | + $isDisabled, | |
| 303 | + $readonly | |
| 304 | + ); | |
| 231 | 305 | } |
| 232 | 306 | |
| 233 | - return <<<RADIOBOX | |
| 234 | - <div class="no-drg fld btcd-ck-con $round"> | |
| 235 | - $options | |
| 236 | - </div> | |
| 237 | -RADIOBOX; | |
| 307 | + return sprintf( | |
| 308 | + '<div class="no-drg fld btcd-ck-con %1$s"> | |
| 309 | + %2$s | |
| 310 | + </div>', | |
| 311 | + $round, | |
| 312 | + $options | |
| 313 | + ); | |
| 238 | 314 | } |
| 239 | 315 | |
| 240 | - protected function decisionBox($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 316 | + protected function decisionBox($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 317 | + { | |
| 241 | 318 | $isRequired = !empty($field->valid->req) ? 'required' : ''; |
| 242 | 319 | $isChecked = !empty($field->valid->checked) ? 'checked' : ''; |
| 243 | 320 | $isDisabled = empty($field->valid->disabled) ? null : 'disabled'; |
| 244 | 321 | $readonly = empty($field->valid->readonly) ? null : 'readonly'; |
| @@ -247,40 +324,55 @@ | ||
| 247 | 324 | $size = $isRequired ? '1px' : ''; |
| 248 | 325 | |
| 249 | 326 | $lbl = !empty($field->lbl) ? wp_kses_post($field->lbl) : (isset($field->info) ? wp_kses_post($field->info->lbl) : ''); |
| 250 | 327 | |
| 251 | - return <<<DECISIONBOX | |
| 252 | - <div class="no-drg fld fld-{$formID} btcd-ck-con $round"> | |
| 328 | + return sprintf( | |
| 329 | + '<div class="no-drg fld fld-%1$s btcd-ck-con %2$s"> | |
| 253 | 330 | <input |
| 254 | - size="height: {$size}, width: {$size}" | |
| 331 | + size="height: %3$s, width: %3$s" | |
| 255 | 332 | type="checkbox" |
| 256 | - $isDisabled | |
| 257 | - $readonly | |
| 258 | - $isRequired | |
| 259 | - $isChecked | |
| 260 | - value="{$value}" | |
| 333 | + %4$s | |
| 334 | + %5$s | |
| 335 | + %6$s | |
| 336 | + %7$s | |
| 337 | + value="%8$s" | |
| 261 | 338 | /> |
| 262 | - <label class="btcd-ck-wrp btcd-ck-wrp-{$formID}"> | |
| 339 | + <label class="btcd-ck-wrp btcd-ck-wrp-%1$s"> | |
| 263 | 340 | <span class="decision-content"> |
| 264 | - {$lbl} | |
| 341 | + %9$s | |
| 265 | 342 | </span> |
| 266 | - <input type="hidden" value="{$value}" name="{$field_name}" /> | |
| 343 | + <input type="hidden" value="%8$s" name="%10$s" /> | |
| 267 | 344 | <span class="btcd-mrk ck"></span> |
| 268 | 345 | </label> |
| 269 | - </div> | |
| 270 | -DECISIONBOX; | |
| 346 | + </div>', | |
| 347 | + $formID, | |
| 348 | + $round, | |
| 349 | + $size, | |
| 350 | + $isDisabled, | |
| 351 | + $readonly, | |
| 352 | + $isRequired, | |
| 353 | + $isChecked, | |
| 354 | + $value, | |
| 355 | + $lbl, | |
| 356 | + $field_name | |
| 357 | + ); | |
| 271 | 358 | } |
| 272 | 359 | |
| 273 | - protected function html($field, $rowID, $field_name, $formID, $error = null, $value = null) { | |
| 360 | + protected function html($field, $rowID, $field_name, $formID, $error = null, $value = null) | |
| 361 | + { | |
| 274 | 362 | $isHidden = !empty($field->valid->hide) && $field->valid->hide ? 'vis-n' : null; |
| 275 | 363 | |
| 276 | 364 | $content = !empty($field->content) ? wp_kses_post($field->content) : ''; |
| 277 | 365 | |
| 278 | - return <<<HTML | |
| 279 | - <div class="btcd-fld-itm $rowID $isHidden"> | |
| 280 | - <div class="fld-wrp fld-wrp-$formID drag" btcd-fld="decision-box"> | |
| 281 | - $content | |
| 366 | + return sprintf( | |
| 367 | + '<div class="btcd-fld-itm %1$s %2$s"> | |
| 368 | + <div class="fld-wrp fld-wrp-%3$s drag" btcd-fld="decision-box"> | |
| 369 | + %4$s | |
| 282 | 370 | </div> |
| 283 | - </div> | |
| 284 | -HTML; | |
| 371 | + </div>', | |
| 372 | + $rowID, | |
| 373 | + $isHidden, | |
| 374 | + $formID, | |
| 375 | + $content | |
| 376 | + ); | |
| 285 | 377 | } |
| 286 | 378 | } |