| 1 |
<?php |
| 2 |
|
| 3 |
namespace BitCode\BitForm\Admin\Form\InitJs; |
| 4 |
|
| 5 |
use BitCode\BitForm\Admin\Form\Helpers; |
| 6 |
|
| 7 |
class Recaptcha { |
| 8 |
public static function init($fk, $config, $contentId, $clientID = null) { |
| 9 |
$url = 'https://www.google.com/recaptcha/api.js'; |
| 10 |
$attr = [ |
| 11 |
'async' => true, |
| 12 |
'defer' => true, |
| 13 |
]; |
| 14 |
return Helpers::scriptLoader($url, "bf-recaptcha-script-{$fk}", "window.bf_globals.{$contentId}.inits['{$fk}'] = new bit_recaptcha_field(fld, {$config})", ".{$fk}-recaptcha-wrp", $attr, '', "{$contentId}"); |
| 15 |
} |
| 16 |
} |
| 17 |
|