2021-03-25 15:13:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare( strict_types=1 );
|
|
|
|
|
2022-03-05 15:05:22 +00:00
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks;
|
2021-03-25 15:13:51 +00:00
|
|
|
|
|
|
|
use Config;
|
2022-12-11 21:28:28 +00:00
|
|
|
use MediaWiki\ResourceLoader as RL;
|
2021-03-25 15:13:51 +00:00
|
|
|
|
2022-12-11 21:28:28 +00:00
|
|
|
class ResourceLoaderHooks {
|
2021-03-25 15:13:51 +00:00
|
|
|
/**
|
2022-12-11 21:28:28 +00:00
|
|
|
* Passes config variables to ext.confirmEdit.hCaptcha.visualEditor ResourceLoader module.
|
|
|
|
* @param RL\Context $context
|
2021-03-25 15:13:51 +00:00
|
|
|
* @param Config $config
|
2022-12-11 21:28:28 +00:00
|
|
|
* @return array
|
2021-03-25 15:13:51 +00:00
|
|
|
*/
|
2022-12-11 21:28:28 +00:00
|
|
|
public static function getHCaptchaResourceLoaderConfig(
|
|
|
|
RL\Context $context,
|
|
|
|
Config $config
|
|
|
|
) {
|
|
|
|
return [
|
|
|
|
'hCaptchaSiteKey' => $config->get( 'HCaptchaSiteKey' ),
|
|
|
|
'hCaptchaScriptURL' => 'https://js.hcaptcha.com/1/api.js',
|
|
|
|
];
|
2021-03-25 15:13:51 +00:00
|
|
|
}
|
|
|
|
}
|