Hi,
It's seem not too complicated to add , i have done it on my site (for the form_builder addon)
tested on 3.8.10 but should work exacly the same in 5.X
-
install and publish the plugin from https://data2site.com/extensions/hcaptcha
set it as default captcha as hcaptcha in Joomla > Global Configuration Site
-
make an override of the form_builder in your template templates/{your_template}/sppagebuilder/addons/form_builder
-
copy the original file site.php and admin.php
-
modify admin.php to add the choise of hcaptcha
-
modify site.php to manage the hcaptcha
admin.php line 436
add the line with //sbou and make an override in your language to have the right name
'values' => array(
'default' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_DEFAULT'),
'gcaptcha' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_GCHAPTCHA'),
'igcaptcha' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_INVISIBLE_GCHAPTCHA'),
'hcaptcha' => JText::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_HCAPTCHA'),//sbou
),
site.php
2 changes
line 312 add the line between //sbou .... //end sbou
elseif ($enable_captcha && $captcha_type == 'igcaptcha')
{
PluginHelper::importPlugin('captcha', 'recaptcha_invisible');
Factory::getApplication()->triggerEvent('onInit', ['invisible_recaptcha_' . $this->addon->id]);
$recaptcha = Factory::getApplication()->triggerEvent('onDisplay', array(null, 'invisible_recaptcha_' . $this->addon->id, 'sppb-dynamic-recaptcha'));
$output .= (isset($recaptcha[0])) ? $recaptcha[0] : '<p class="sppb-text-danger">' . Text::_('COM_SPPAGEBUILDER_ADDON_AJAX_CONTACT_INVISIBLE_CAPTCHA_NOT_INSTALLED') . '</p>';
}
//sbou
elseif ($enable_captcha && $captcha_type == 'hcaptcha')
{
PluginHelper::importPlugin('captcha', 'hcaptcha');
Factory::getApplication()->triggerEvent('onInit');
$recaptcha = Factory::getApplication()->triggerEvent('onDisplay', array(null, 'hcaptcha_' . $this->addon->id, 'sppb-dynamic-hcaptcha'));
$output .= (isset($recaptcha[0])) ? $recaptcha[0] : '<p class="sppb-text-danger">' . Text::_('COM_SPPAGEBUILDER_ADDON_AJAX_CONTACT_HCAPTCHA_NOT_INSTALLED') . '</p>';
}
//end sbou
$output .= '<input type="hidden" name="captcha_type" value="' . $captcha_type . '">';
ligne 566
if ($captcha_type == 'igcaptcha')
{
PluginHelper::importPlugin('captcha', 'recaptcha_invisible');
$output['gcaptchaId'] = 'invisible_recaptcha_' . $addon_id;
$output['gcaptchaType'] = 'invisible';
}
elseif ($captcha_type == 'hcaptcha')//sbou
{
PluginHelper::importPlugin('captcha', 'hcaptcha');
$output['gcaptchaId'] = 'hcaptcha_' . $addon_id;
$output['gcaptchaType'] = 'dynamic';
}
else
{
PluginHelper::importPlugin('captcha', 'recaptcha');
$output['gcaptchaId'] = 'dynamic_recaptcha_' . $addon_id;
$output['gcaptchaType'] = 'dynamic';
}
Stéphane
faboba.com