38 $params = parent::getMessageParameters();
40 $title = $this->entry->getTarget();
41 if ( substr( $title->getText(), 0, 1 ) ===
'#' ) {
43 $params[2] = $title->getText();
47 $username = $title->getText();
50 $targetUser = User::newFromName( $username,
false );
52 $params[3] = $username;
55 $subtype = $this->entry->getSubtype();
56 if ( $subtype ===
'block' || $subtype ===
'reblock' ) {
57 if ( !isset( $params[4] ) ) {
59 $params[4] =
'infinity';
66 $durationTooltip =
'‎' . htmlspecialchars( $params[4] );
67 $blockExpiry = $this->context->getLanguage()->translateBlockExpiry(
69 $this->context->getUser(),
70 (
int)
wfTimestamp( TS_UNIX, $this->entry->getTimestamp() )
72 if ( $this->plaintext ) {
77 "<span class=\"blockExpiry\" title=\"$durationTooltip\">" .
79 htmlspecialchars( $blockExpiry ) .
83 $params[5] = isset( $params[5] ) ?
87 if ( isset( $params[6] ) ) {
88 $pages = $params[6][
'pages'] ?? [];
90 foreach ( $pages as $page ) {
91 $pageLinks[] = $this->
makePageLink( Title::newFromText( $page ) );
94 $rawNamespaces = $params[6][
'namespaces'] ?? [];
96 foreach ( $rawNamespaces as $ns ) {
98 ? $this->
msg(
'blanknamespace' )->escaped()
99 : htmlspecialchars( $this->context->getLanguage()->getFormattedNsText( $ns ) );
100 if ( $this->plaintext ) {
104 $namespaces[] = $text;
107 SpecialPage::getTitleFor(
'Allpages' ),
108 [
'namespace' => $ns ],
114 $rawActions = $params[6][
'actions'] ?? [];
116 foreach ( $rawActions as $action ) {
117 $actions[] = $this->
msg(
'ipb-action-' . $action )->escaped();
122 $restrictions[] = $this->
msg(
'logentry-partialblock-block-page' )
123 ->numParams( count( $pageLinks ) )
124 ->rawParams( $this->context->getLanguage()->listToText( $pageLinks ) )->escaped();
128 $restrictions[] = $this->
msg(
'logentry-partialblock-block-ns' )
129 ->numParams( count( $namespaces ) )
130 ->rawParams( $this->context->getLanguage()->listToText( $namespaces ) )->escaped();
132 $enablePartialActionBlocks = $this->context->getConfig()
133 ->get( MainConfigNames::EnablePartialActionBlocks );
134 if ( $actions && $enablePartialActionBlocks ) {
135 $restrictions[] = $this->
msg(
'logentry-partialblock-block-action' )
136 ->numParams( count( $actions ) )
137 ->rawParams( $this->context->getLanguage()->listToText( $actions ) )->escaped();
140 $params[6] =
Message::rawParam( $this->context->getLanguage()->listToText( $restrictions ) );
148 $params = parent::extractParameters();
150 if ( $this->entry->isLegacy() && isset( $params[3] ) ) {
151 if ( isset( $params[4] ) ) {
152 $params[5] = $params[4];
154 $params[4] = $params[3];
161 $title = $this->entry->getTarget();
164 if ( substr( $title->getText(), 0, 1 ) !==
'#' && $title->canExist() ) {
165 $preload[] = $title->getTalkPage();
169 if ( isset( $params[6][
'pages'] ) ) {
170 foreach ( $params[6][
'pages'] as $page ) {
171 $preload[] = Title::newFromText( $page );
178 $subtype = $this->entry->getSubtype();
181 || !( $subtype ===
'block' || $subtype ===
'reblock' )
182 || !$this->context->getAuthority()->isAllowed(
'block' )
188 $title = $this->entry->getTarget();
190 $linkRenderer->makeKnownLink(
191 SpecialPage::getTitleFor(
'Unblock', $title->getDBkey() ),
192 $this->msg(
'unblocklink' )->text()
194 $linkRenderer->makeKnownLink(
195 SpecialPage::getTitleFor(
'Block', $title->getDBkey() ),
196 $this->msg(
'change-blocklink' )->text()
200 return $this->
msg(
'parentheses' )->rawParams(
201 $this->context->getLanguage()->pipeList( $links ) )->escaped();
213 $flags = trim( $flags );
214 if ( $flags ===
'' ) {
217 $flags = explode(
',', $flags );
218 $flagsCount = count( $flags );
220 for ( $i = 0; $i < $flagsCount; $i++ ) {
224 return wfMessage(
'parentheses' )->inLanguage( $lang )
225 ->rawParams( $lang->
commaList( $flags ) )->escaped();
236 static $messages = [];
238 if ( !isset( $messages[$flag] ) ) {
239 $messages[$flag] = htmlspecialchars( $flag );
249 $msg =
wfMessage(
'block-log-flags-' . $flag )->inLanguage( $lang );
251 if ( $msg->exists() ) {
252 $messages[$flag] = $msg->escaped();
256 return $messages[$flag];
268 '6::flags' =>
'6:array:flags',
271 foreach ( $map as $index => $key ) {
272 if ( isset( $params[$index] ) ) {
273 $params[$key] = $params[$index];
274 unset( $params[$index] );
281 if ( $subtype ===
'block' || $subtype ===
'reblock' ) {
284 '5::duration' =>
'infinity',
285 '6:array:flags' => [],
288 if ( !is_array( $params[
'6:array:flags'] ) ) {
290 $params[
'6:array:flags'] = $params[
'6:array:flags'] ===
''
292 : explode(
',', $params[
'6:array:flags'] );
297 $params[
'5::duration'] =
'infinity';
300 $expiry = strtotime( $params[
'5::duration'], $ts );
301 if ( $expiry !==
false && $expiry > 0 ) {
302 $params[
':timestamp:expiry'] = $expiry;
315 $ret = parent::formatParametersForApi();
316 if ( isset( $ret[
'flags'] ) ) {
320 if ( isset( $ret[
'restrictions'][
'pages'] ) ) {
321 $ret[
'restrictions'][
'pages'] = array_map(
function ( $title ) {
323 }, $ret[
'restrictions'][
'pages'] );
327 if ( isset( $ret[
'restrictions'][
'namespaces'] ) ) {
336 $type = $this->entry->getType();
337 $subtype = $this->entry->getSubtype();
338 $sitewide = $this->entry->getParameters()[
'sitewide'] ??
true;
340 $key =
"logentry-$type-$subtype";
341 if ( ( $subtype ===
'block' || $subtype ===
'reblock' ) && !$sitewide ) {
345 $params = parent::getMessageParameters();
348 if ( isset( $params[6] ) ) {
349 $key =
"logentry-partial$type-$subtype";
351 $key =
"logentry-non-editing-$type-$subtype";
wfIsInfinity( $str)
Determine input string is represents as infinity.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Base class for language-specific code.
commaList(array $list)
Take a list of strings and build a locale-friendly comma-separated list, using the local comma-separa...
A class containing constants representing the names of configuration variables.
Parent class for all special pages.
getParameters()
Get the extra parameters stored for this message.
getTimestamp()
Get the timestamp when the action was executed.
getSubtype()
The log subtype.