Skip to content

Commit 9c5f6b3

Browse files
JeroenDeDauwmalberts
authored andcommitted
Add ability to add intro message to MediaWiki:Rules page
1 parent dd29e26 commit 9c5f6b3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
99
<exclude name="Generic.Files.LineLength.TooLong" />
10+
<exclude name="Generic.WhiteSpace.LanguageConstructSpacing.IncorrectSingle" />
1011
<exclude name="MediaWiki.Commenting.FunctionComment" />
1112
<exclude name="MediaWiki.Commenting.PropertyDocumentation" />
1213
<exclude name="MediaWiki.Commenting.FunctionAnnotations.UnrecognizedAnnotation" />

src/EntryPoints/RulesHooks.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ public function onShowMissingArticle( $article ): void {
4646
}
4747

4848
private function getRulesPageHtml(): string {
49-
return Html::element( 'div', [ 'id' => 'ext-rules-app' ] ) .
49+
return
50+
Html::rawElement( 'p',
51+
[ 'id' => 'ext-rules-intro' ],
52+
wfMessage( 'ext-rules-intro' )->exists() ? wfMessage( 'ext-rules-intro' )->parse() : ''
53+
) .
54+
Html::element( 'div', [ 'id' => 'ext-rules-app' ] ) .
5055
Html::rawElement( 'noscript', [], Html::noticeBox( wfMessage( 'rules-noscript-message' )->text(), '' ) );
5156
}
5257

0 commit comments

Comments
 (0)