PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.0
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 / RecaptchaV2Field.php

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

33 lines 1.3 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\Integration\IntegrationHandler;
6
7 class RecaptchaV2Field {
8 public static function init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) {
9 $integrationHandler = new IntegrationHandler(0);
10 $allFormIntegrations = $integrationHandler->getAllIntegration('app', 'gReCaptcha');
11 $siteKey = json_decode($allFormIntegrations[0]->integration_details)->siteKey;
12 return self::field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $siteKey, $error = null, $value = null);
13 }
14
15 private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $siteKey, $error = null, $value = null) {
16 $fieldHelpers = new FieldHelpers($field, $rowID, $form_atomic_Cls_map);
17 $theme = $field->config->theme;
18 $size = $field->config->size;
19
20 return <<<RECAPTCHAV2FIELD
21 <div
22 class="{$fieldHelpers->getAtomicCls('fld-wrp')} {$fieldHelpers->getCustomClasses('fld-wrp')}"
23 {$fieldHelpers->getCustomAttributes('fld-wrp')}
24 >
25 <div class="$rowID-recaptcha-wrp">
26 <div class="g-recaptcha" data-theme="{$theme}" data-size="{$size}" data-sitekey="$siteKey">
27 </div>
28 </div>
29 </div>
30 RECAPTCHAV2FIELD;
31 }
32 }
33