mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-18 17:21:25 +00:00
d806186810
This lets us encapsulate everything about a check in its JS definition, which makes it much simpler for other extensions or gadgets to create checks. Change-Id: Ica23fc26a576d55addb001e4baf78b3702927208
28 lines
634 B
PHP
28 lines
634 B
PHP
<?php
|
|
/**
|
|
* Utilities for ResourceLoader modules used by EditCheck.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @license MIT
|
|
*/
|
|
|
|
namespace MediaWiki\Extension\VisualEditor\EditCheck;
|
|
|
|
use MessageLocalizer;
|
|
|
|
class ResourceLoaderData {
|
|
|
|
/**
|
|
* Return configuration data for edit checks, fetched from an on-wiki JSON message
|
|
*
|
|
* @param MessageLocalizer $context
|
|
* @return array Configuration data for edit checks
|
|
*/
|
|
public static function getConfig( MessageLocalizer $context ): array {
|
|
$raw_config = json_decode( $context->msg( 'editcheck-config.json' )->inContentLanguage()->plain(), true );
|
|
|
|
return $raw_config ?? [];
|
|
}
|
|
}
|