2023-08-31 16:29:54 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Utilities for ResourceLoader modules used by EditCheck.
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @license MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\VisualEditor\EditCheck;
|
|
|
|
|
|
|
|
use MessageLocalizer;
|
|
|
|
|
|
|
|
class ResourceLoaderData {
|
2024-02-20 09:50:25 +00:00
|
|
|
|
2023-08-31 16:29:54 +00:00
|
|
|
/**
|
|
|
|
* Return configuration data for edit checks, fetched from an on-wiki JSON message
|
|
|
|
*
|
|
|
|
* @param MessageLocalizer $context
|
|
|
|
* @return array Configuration data for edit checks
|
|
|
|
*/
|
2024-02-20 10:27:15 +00:00
|
|
|
public static function getConfig( MessageLocalizer $context ): array {
|
2023-08-31 16:29:54 +00:00
|
|
|
$raw_config = json_decode( $context->msg( 'editcheck-config.json' )->inContentLanguage()->plain(), true );
|
|
|
|
|
2024-11-22 16:34:06 +00:00
|
|
|
return $raw_config ?? [];
|
2023-08-31 16:29:54 +00:00
|
|
|
}
|
|
|
|
}
|