sepiariver / recaptchav2

Google's ReCaptcha V2 + V3 for MODX CMS: https://sepiariver.com/modx/recaptchav2-supports-recaptchav3/
https://sepiariver.com/
GNU General Public License v2.0
21 stars 15 forks source link

Passing in submit button value through snippet parameters #47

Closed ghost closed 5 years ago

ghost commented 5 years ago

I've run into this issue where i have 18 some odd templates for each of the times I use this snippet just to change the value that shows up on the button. Is there a way (or could one be made) to optionally pass in a value for the button otherwise use 'submit'? It would save a bunch of templates for me personally

ghost commented 5 years ago

I took a crack at it and changed line 39-44 to

$recaptcha_html = $modx->getChunk($tpl, array(
    'site_key' => $site_key,
    'lang' => $lang,
    'form_id' => $form_id,
    'btn_text' => $btn_text ? $btn_text : 'Login'
    ));

which works for me, I don't have the ability to do a proper pr from work though I figured it out from my work computer.