mediawiki-extensions-RSS/RSSUtils.php
Umherirrender 901329cb18 Move RSSUtils to own file
Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: If3313f598589a48b7ad5bae65aed8536de48c0e8
2017-12-21 22:14:55 +01:00

23 lines
747 B
PHP

<?php
class RSSUtils {
/**
* Output an error message, all wraped up nicely.
* @param String $errorMessageName The system message that this error is
* @param String|Array $param Error parameter (or parameters)
* @return String Html that is the error.
*/
public static function RSSError( $errorMessageName, $param = false ) {
// Anything from a parser tag should use Content lang for message,
// since the cache doesn't vary by user language: use ->inContentLanguage()
// The ->parse() part makes everything safe from an escaping standpoint.
return Html::rawElement( 'span', [ 'class' => 'error' ],
"Extension:RSS -- Error: " . wfMessage( $errorMessageName )
->inContentLanguage()->params( $param )->parse()
);
}
}