X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderContext.php;h=3ceb915d2768f17167aa77db71ff623a1096eb6f;hb=8c9a6867fe53ab0c254d41de4b236317a5f04c17;hp=c4e9884a1ee9be8da6ca336e1284ae068eac4b60;hpb=1ef3e79ea405a8be28ed269e0ee64ae9d5ea6027;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index c4e9884a1e..3ceb915d27 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -226,7 +226,7 @@ class ResourceLoaderContext implements MessageLocalizer { * @return Message */ public function msg( $key ) { - return call_user_func_array( 'wfMessage', func_get_args() ) + return wfMessage( ...func_get_args() ) ->inLanguage( $this->getLanguage() ) // Use a dummy title because there is no real title // for this endpoint, and the cache won't vary on it @@ -341,6 +341,22 @@ class ResourceLoaderContext implements MessageLocalizer { return $this->imageObj; } + /** + * Return the replaced-content mapping callback + * + * When editing a page that's used to generate the scripts or styles of a + * ResourceLoaderWikiModule, a preview should use the to-be-saved version of + * the page rather than the current version in the database. A context + * supporting such previews should return a callback to return these + * mappings here. + * + * @since 1.32 + * @return callable|null Signature is `Content|null func( Title $t )` + */ + public function getContentOverrideCallback() { + return null; + } + /** * @return bool */