MediaWiki REL1_35
|
A service class for getting formatted information about a block. More...
Public Member Functions | |
getMessage (AbstractBlock $block, User $user, Language $language, $ip) | |
Get a block error message. | |
Private Member Functions | |
formatBlockerLink ( $blockerName, $blockerId, Language $language) | |
Create a link to the blocker's user page. | |
formatBlockReason (CommentStoreComment $reason, Language $language) | |
Format the block reason as plain wikitext in the specified language. | |
getBlockErrorInfo (AbstractBlock $block) | |
Get a standard set of block details for building a block error message. | |
getBlockErrorMessageKey (AbstractBlock $block) | |
Determine the block error message key by examining the block. | |
getBlockErrorMessageParams (AbstractBlock $block, User $user, Language $language, $ip) | |
Get the formatted parameters needed to build the block error messages handled by getBlockErrorMessageKey. | |
getFormattedBlockErrorInfo (AbstractBlock $block, User $user, Language $language) | |
Get a standard set of block details for building a block error message, formatted for a specified user and language. | |
A service class for getting formatted information about a block.
To obtain an instance, use MediaWikiServices::getInstance()->getBlockErrorFormatter().
Definition at line 34 of file BlockErrorFormatter.php.
|
private |
Create a link to the blocker's user page.
This must be done here rather than in the message translation, because the blocker may not be a local user, in which case their page cannot be linked.
string | $blockerName | Formatted blocker name |
int | $blockerId | |
Language | $language |
Definition at line 134 of file BlockErrorFormatter.php.
References Language\embedBidi(), and User\newFromId().
Referenced by MediaWiki\Block\BlockErrorFormatter\getBlockErrorMessageParams().
|
private |
Format the block reason as plain wikitext in the specified language.
CommentStoreComment | $reason | |
Language | $language |
Definition at line 116 of file BlockErrorFormatter.php.
Referenced by MediaWiki\Block\BlockErrorFormatter\getFormattedBlockErrorInfo().
|
private |
Get a standard set of block details for building a block error message.
AbstractBlock | $block |
Definition at line 70 of file BlockErrorFormatter.php.
References MediaWiki\Block\AbstractBlock\getBy(), MediaWiki\Block\AbstractBlock\getByName(), MediaWiki\Block\AbstractBlock\getExpiry(), MediaWiki\Block\AbstractBlock\getIdentifier(), MediaWiki\Block\AbstractBlock\getReasonComment(), MediaWiki\Block\AbstractBlock\getTarget(), and MediaWiki\Block\AbstractBlock\getTimestamp().
Referenced by MediaWiki\Block\BlockErrorFormatter\getFormattedBlockErrorInfo().
|
private |
Determine the block error message key by examining the block.
AbstractBlock | $block |
Definition at line 152 of file BlockErrorFormatter.php.
References MediaWiki\Block\AbstractBlock\getType(), MediaWiki\Block\AbstractBlock\isSitewide(), and MediaWiki\Block\AbstractBlock\TYPE_AUTO.
Referenced by MediaWiki\Block\BlockErrorFormatter\getMessage().
|
private |
Get the formatted parameters needed to build the block error messages handled by getBlockErrorMessageKey.
Definition at line 186 of file BlockErrorFormatter.php.
References Language\commaList(), MediaWiki\Block\BlockErrorFormatter\formatBlockerLink(), and MediaWiki\Block\BlockErrorFormatter\getFormattedBlockErrorInfo().
Referenced by MediaWiki\Block\BlockErrorFormatter\getMessage().
|
private |
Get a standard set of block details for building a block error message, formatted for a specified user and language.
Definition at line 92 of file BlockErrorFormatter.php.
References Language\embedBidi(), MediaWiki\Block\BlockErrorFormatter\formatBlockReason(), Language\formatExpiry(), MediaWiki\Block\BlockErrorFormatter\getBlockErrorInfo(), and Language\userTimeAndDate().
Referenced by MediaWiki\Block\BlockErrorFormatter\getBlockErrorMessageParams().
MediaWiki\Block\BlockErrorFormatter::getMessage | ( | AbstractBlock | $block, |
User | $user, | ||
Language | $language, | ||
$ip | |||
) |
Get a block error message.
Different message keys are chosen depending on the block features. Message paramaters are formatted for the specified user and language.
Definition at line 46 of file BlockErrorFormatter.php.
References MediaWiki\Block\BlockErrorFormatter\getBlockErrorMessageKey(), and MediaWiki\Block\BlockErrorFormatter\getBlockErrorMessageParams().