| @@ -56,12 +56,12 @@ | ||
| 56 | 56 | $honeypodFldName = Helpers::honeypotEncryptedToken("_bitforms_{$this->getFormID()}_{$time}_"); |
| 57 | 57 | $honeypotInput = ''; |
| 58 | 58 | if (Helpers::property_exists_nested($this->_formContents, 'additional->enabled->honeypot', true)) { |
| 59 | 59 | $honeypotInput = |
| 60 | - ' | |
| 61 | - <input type="text" class="d-none" name="b_h_t" value="' . $honeypodFldName . '"> | |
| 62 | - <input type="text" class="d-none" name="' . $honeypodFldName . '" required> | |
| 63 | - '; | |
| 60 | + <<<HTMLa | |
| 61 | + <input type="text" class="d-none" name="b_h_t" value="{$honeypodFldName}"> | |
| 62 | + <input type="text" class="d-none" name="{$honeypodFldName}" required> | |
| 63 | +HTMLa; | |
| 64 | 64 | return $honeypotInput; |
| 65 | 65 | } |
| 66 | 66 | return $honeypotInput; |
| 67 | 67 | } |
| @@ -122,9 +122,9 @@ | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | public function fields($rowID) |
| 125 | 125 | { |
| 126 | - return $this->_fields->{$rowID} ?? null; | |
| 126 | + return $this->_fields->{$rowID}; | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | public function getNestedLayout($rowID) |
| 130 | 130 | { |
| @@ -178,9 +178,9 @@ | ||
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | $conversationNavigationHtml = $conversationalHelper->getNavigationView(); |
| 181 | 181 | |
| 182 | - // $confMsg = $this->_form->getSuccessMessageMarkups(); | |
| 182 | + $confMsg = $this->_form->getSuccessMessageMarkups(); | |
| 183 | 183 | $abandonmentMsg = $this->_form->getFormAbandonmentMessage(); |
| 184 | 184 | |
| 185 | 185 | // if (!empty($this->_buttons)) { |
| 186 | 186 | // $this->_buttons->name = $formIdentifier; |
| @@ -188,36 +188,35 @@ | ||
| 188 | 188 | // $subBtn = $this->_themeDetails->getField($this->_buttons, $buttonClass, ''); |
| 189 | 189 | // } |
| 190 | 190 | |
| 191 | 191 | if (!empty($msg)) { |
| 192 | - $restrictionMsg = | |
| 193 | - ' | |
| 194 | - <div class="' . $this->_form->getAtomicCls("_frm-ovrly-b{$formID}") . '"> | |
| 195 | - <p class="' . $this->_form->getAtomicCls("_frm-ovrly-msg-b{$formID}") . '"> | |
| 196 | - ' . $msg . ' | |
| 192 | + $restrictionMsg = <<<MSG | |
| 193 | + <div class="{$this->_form->getAtomicCls("_frm-ovrly-b{$formID}")}"> | |
| 194 | + <p class="{$this->_form->getAtomicCls("_frm-ovrly-msg-b{$formID}")}"> | |
| 195 | + $msg | |
| 197 | 196 | </p> |
| 198 | 197 | </div> |
| 199 | - '; | |
| 198 | +MSG; | |
| 200 | 199 | } |
| 201 | 200 | $formHTML = |
| 202 | - ' | |
| 203 | - <div id="' . $formIdentifier . '" class="b' . $formID . '-bit-form ' . $this->_form->getAtomicCls("_frm-bg-b{$formID}") . ' bit-form bf-form-wrapper"> | |
| 204 | - ' . $restrictionMsg . ' | |
| 205 | - <form novalidate id="form-' . $formIdentifier . '" class="_frm-bc' . $formID . ' bf-form" ' . $file_upload_tag . ' method=\'post\'> | |
| 206 | - <input type="text" class="d-none" name="csrf" value="' . $this->_tokens['csrf'] . '"> | |
| 207 | - <input type="text" class="d-none" name="t_identity" value="' . $this->_tokens['t_identity'] . '"> | |
| 208 | - ' . $this->honeypotField() . ' | |
| 209 | - <input type="text" class="d-none" name="bitforms_id" value="bitforms_' . $this->_form->getFormID() . '"> | |
| 210 | - <div class="bc' . $formID . '-steps-container"> | |
| 211 | - ' . $welcomePageHtml . ' | |
| 212 | - ' . $fieldHtml . ' | |
| 213 | - ' . $conversationNavigationHtml . ' | |
| 201 | + <<<HTMLa | |
| 202 | + <div id="{$formIdentifier}" class="bit-form {$this->_form->getAtomicCls("_frm-bg-b{$formID}")}"> | |
| 203 | + $restrictionMsg | |
| 204 | + <form novalidate id="form-{$formIdentifier}" class="_frm-bc{$formID}" $file_upload_tag method='post'> | |
| 205 | + <input type="text" class="d-none" name="csrf" value="{$this->_tokens['csrf']}"> | |
| 206 | + <input type="text" class="d-none" name="t_identity" value="{$this->_tokens['t_identity']}"> | |
| 207 | + {$this->honeypotField()} | |
| 208 | + <input type="text" class="d-none" name="bitforms_id" value="bitforms_{$this->_form->getFormID()}"> | |
| 209 | + <div class="bc{$formID}-steps-container"> | |
| 210 | + $welcomePageHtml | |
| 211 | + $fieldHtml | |
| 214 | 212 | </div> |
| 215 | 213 | </form> |
| 216 | - <div id=\'bc-form-msg-wrp-' . $formIdentifier . '\' class="bc-form-msg-wrp"></div> | |
| 217 | - ' . $abandonmentMsg . ' | |
| 214 | + <div id='bc-form-msg-wrp-{$formIdentifier}' class="bc-form-msg-wrp"></div> | |
| 215 | + $abandonmentMsg | |
| 216 | + $conversationNavigationHtml | |
| 218 | 217 | </div> |
| 219 | -'; | |
| 218 | +HTMLa; | |
| 220 | 219 | |
| 221 | 220 | return $formHTML; |
| 222 | 221 | } |
| 223 | 222 | |
| @@ -243,43 +242,32 @@ | ||
| 243 | 242 | $fieldHtml .= $this->getLayoutHtml($layouts); |
| 244 | 243 | } else { |
| 245 | 244 | $formViewHelper = new FormViewHelper($this->_form, $this->_formContents); |
| 246 | 245 | |
| 247 | - $fieldHtml .= | |
| 248 | - ' | |
| 249 | - <div class=\'' . $this->_form->getAtomicCls("_frm-b{$formID}-stp-cntnr") . ' _frm-b-stp-cntnr\'> | |
| 250 | - ' . $formViewHelper->getStepHeaderHtml() . ' | |
| 251 | - <div class=\'' . $this->_form->getAtomicCls("_frm-b{$formID}-stp-wrpr") . ' _frm-b-stp-wrpr\'> | |
| 252 | - ' . $formViewHelper->getProgressBarMarkup() . ' | |
| 253 | - <div class=\'' . $this->_form->getAtomicCls("_frm-b{$formID}-stp-cntnt-wrpr") . ' _frm-b-stp-cntnt-wrpr\'> | |
| 254 | -'; | |
| 246 | + $fieldHtml .= <<<STEPWRPR | |
| 247 | + <div class='{$this->_form->getAtomicCls("_frm-b{$formID}-stp-cntnr")}'> | |
| 248 | + {$formViewHelper->getStepHeaderHtml()} | |
| 249 | + <div class='{$this->_form->getAtomicCls("_frm-b{$formID}-stp-wrpr")}'> | |
| 250 | + {$formViewHelper->getProgressBarMarkup()} | |
| 251 | + <div class='{$this->_form->getAtomicCls("_frm-b{$formID}-stp-cntnt-wrpr")}'> | |
| 252 | +STEPWRPR; | |
| 255 | 253 | foreach ($layouts as $key => $lay) { |
| 256 | 254 | $hideOtherSteps = $key > 0 ? 'deactive' : ''; |
| 257 | 255 | $step = $key + 1; |
| 258 | - $ariaHidden = $key > 0 ? 'aria-hidden="true"' : ''; | |
| 259 | - $fieldHtml .= | |
| 260 | - ' | |
| 261 | - <div | |
| 262 | - class="' . $this->_form->getAtomicCls("_frm-b{$formID}-stp-cntnt") . ' _frm-b-stp-cntnt ' . $hideOtherSteps . '" | |
| 263 | - data-step="' . $step . '" | |
| 264 | - role="tabpanel" | |
| 265 | - id="step-' . $formID . '-' . $step . '-panel" | |
| 266 | - aria-labelledby="step-' . $formID . '-' . $step . '-tab" | |
| 267 | - ' . $ariaHidden . ' | |
| 268 | - > | |
| 269 | - <div class="_frm-b' . $formID . ' _frm-b"> | |
| 270 | - ' . $this->getLayoutHtml($lay->layout) . ' | |
| 256 | + $fieldHtml .= <<<HTMLa | |
| 257 | + <div class="{$this->_form->getAtomicCls("_frm-b{$formID}-stp-cntnt")} $hideOtherSteps" data-step="{$step}"> | |
| 258 | + <div class="_frm-b{$formID}"> | |
| 259 | + {$this->getLayoutHtml($lay->layout)} | |
| 271 | 260 | </div> |
| 272 | - ' . $formViewHelper->getStepButtonMarkup() . ' | |
| 261 | + {$formViewHelper->getStepButtonMarkup()} | |
| 273 | 262 | </div> |
| 274 | -'; | |
| 263 | +HTMLa; | |
| 275 | 264 | } |
| 276 | - $fieldHtml .= | |
| 277 | - ' | |
| 265 | + $fieldHtml .= <<<CLOSINGTAG | |
| 278 | 266 | </div> |
| 279 | 267 | </div> |
| 280 | 268 | </div> |
| 281 | -'; | |
| 269 | +CLOSINGTAG; | |
| 282 | 270 | } |
| 283 | 271 | |
| 284 | 272 | $confMsg = $this->_form->getSuccessMessageMarkups(); |
| 285 | 273 | $abandonmentMsg = $this->_form->getFormAbandonmentMessage(); |
| @@ -290,42 +278,31 @@ | ||
| 290 | 278 | $subBtn = $this->_themeDetails->getField($this->_buttons, $buttonClass, ''); |
| 291 | 279 | } |
| 292 | 280 | |
| 293 | 281 | if (!empty($msg)) { |
| 294 | - $restrictionMsg = | |
| 295 | - ' | |
| 296 | - <div class="' . $this->_form->getAtomicCls("_frm-ovrly-b{$formID}") . '"> | |
| 297 | - <p class="' . $this->_form->getAtomicCls("_frm-ovrly-msg-b{$formID}") . '"> | |
| 298 | - ' . $msg . ' | |
| 282 | + $restrictionMsg = <<<MSG | |
| 283 | + <div class="{$this->_form->getAtomicCls("_frm-ovrly-b{$formID}")}"> | |
| 284 | + <p class="{$this->_form->getAtomicCls("_frm-ovrly-msg-b{$formID}")}"> | |
| 285 | + $msg | |
| 299 | 286 | </p> |
| 300 | 287 | </div> |
| 301 | -'; | |
| 288 | +MSG; | |
| 302 | 289 | } |
| 303 | 290 | $formHTML = |
| 304 | - ' | |
| 305 | - <div id="' . $formIdentifier . '" class="b' . $formID . '-bit-form ' . $this->_form->getAtomicCls("_frm-bg-b{$formID}") . ' bit-form bf-form-wrapper"> | |
| 306 | - ' . $restrictionMsg . ' | |
| 307 | - <form novalidate id="form-' . $formIdentifier . '" class="' . $this->_form->getAtomicCls("_frm-b{$formID}") . ' bf-form" ' . $file_upload_tag . ' method=\'post\'> | |
| 308 | - <input type="text" class="d-none" name="csrf" value="' . $this->_tokens['csrf'] . '"> | |
| 309 | - <input type="text" class="d-none" name="t_identity" value="' . $this->_tokens['t_identity'] . '"> | |
| 310 | - ' . $this->honeypotField() . ' | |
| 311 | - <input type="text" class="d-none" name="bitforms_id" value="bitforms_' . $this->_form->getFormID() . '"> | |
| 312 | - ' . $fieldHtml . ' | |
| 291 | + <<<HTMLa | |
| 292 | + <div id="{$formIdentifier}" class="bit-form {$this->_form->getAtomicCls("_frm-bg-b{$formID}")}"> | |
| 293 | + $restrictionMsg | |
| 294 | + <form novalidate id="form-{$formIdentifier}" class="{$this->_form->getAtomicCls("_frm-b{$formID}")}" $file_upload_tag method='post'> | |
| 295 | + <input type="text" class="d-none" name="csrf" value="{$this->_tokens['csrf']}"> | |
| 296 | + <input type="text" class="d-none" name="t_identity" value="{$this->_tokens['t_identity']}"> | |
| 297 | + {$this->honeypotField()} | |
| 298 | + <input type="text" class="d-none" name="bitforms_id" value="bitforms_{$this->_form->getFormID()}"> | |
| 299 | + $fieldHtml | |
| 313 | 300 | </form> |
| 314 | - ' . $abandonmentMsg . ' | |
| 315 | - <div id=\'bf-form-msg-wrp-' . $formIdentifier . '\'></div> | |
| 316 | - <!-- | |
| 317 | - Live Region for Screen Reader Announcements (Accessibility) | |
| 318 | - --> | |
| 319 | - <div | |
| 320 | - class="bf-live-region" | |
| 321 | - role="status" | |
| 322 | - aria-live="polite" | |
| 323 | - aria-atomic="true" | |
| 324 | - style="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;" | |
| 325 | - ></div> | |
| 326 | - ' . $confMsg . ' | |
| 301 | + $abandonmentMsg | |
| 302 | + <div id='bf-form-msg-wrp-{$formIdentifier}'></div> | |
| 303 | + $confMsg | |
| 327 | 304 | </div> |
| 328 | -'; | |
| 305 | +HTMLa; | |
| 329 | 306 | return $formHTML; |
| 330 | 307 | } |
| 331 | 308 | } |