39 $params = parent::getMessageParameters();
41 $title = $this->entry->getTarget();
42 if ( substr( $title->getText(), 0, 1 ) ===
'#' ) {
48 $username = $title->getText();
51 $targetUser = User::newFromName( $username,
false );
52 $params[2] = Message::rawParam( $this->
makeUserLink( $targetUser, Linker::TOOL_LINKS_NOBLOCK ) );
56 $subtype = $this->entry->getSubtype();
57 if ( $subtype ===
'block' || $subtype ===
'reblock' ) {
67 $durationTooltip =
'‎' . htmlspecialchars(
$params[4] );
68 $blockExpiry = $this->context->getLanguage()->translateBlockExpiry(
70 $this->context->getUser(),
71 (
int)
wfTimestamp( TS_UNIX, $this->entry->getTimestamp() )
73 if ( $this->plaintext ) {
75 $params[4] = Message::rawParam( $blockExpiry );
78 "<span class=\"blockExpiry\" title=\"$durationTooltip\">" .
80 htmlspecialchars( $blockExpiry ) .
85 self::formatBlockFlags(
$params[5], $this->context->getLanguage() ) :
'';
89 $pages =
$params[6][
'pages'] ?? [];
91 foreach ( $pages as $page ) {
92 $pageLinks[] = $this->
makePageLink( Title::newFromText( $page ) );
95 $rawNamespaces =
$params[6][
'namespaces'] ?? [];
97 foreach ( $rawNamespaces as $ns ) {
99 ? $this->
msg(
'blanknamespace' )->escaped()
100 : htmlspecialchars( $this->context->getLanguage()->getFormattedNsText( $ns ) );
101 if ( $this->plaintext ) {
105 $namespaces[] = $text;
108 SpecialPage::getTitleFor(
'Allpages' ),
109 [
'namespace' => $ns ],
115 $rawActions =
$params[6][
'actions'] ?? [];
117 foreach ( $rawActions as $action ) {
118 $actions[] = $this->
msg(
'ipb-action-' . $action )->escaped();
123 $restrictions[] = $this->
msg(
'logentry-partialblock-block-page' )
124 ->numParams( count( $pageLinks ) )
125 ->rawParams( $this->context->getLanguage()->listToText( $pageLinks ) )->escaped();
129 $restrictions[] = $this->
msg(
'logentry-partialblock-block-ns' )
130 ->numParams( count( $namespaces ) )
131 ->rawParams( $this->context->getLanguage()->listToText( $namespaces ) )->escaped();
133 $enablePartialActionBlocks = $this->context->getConfig()
134 ->get( MainConfigNames::EnablePartialActionBlocks );
135 if ( $actions && $enablePartialActionBlocks ) {
136 $restrictions[] = $this->
msg(
'logentry-partialblock-block-action' )
137 ->numParams( count( $actions ) )
138 ->rawParams( $this->context->getLanguage()->listToText( $actions ) )->escaped();
141 $params[6] = Message::rawParam( $this->context->getLanguage()->listToText( $restrictions ) );
162 $title = $this->entry->getTarget();
165 if ( substr( $title->getText(), 0, 1 ) !==
'#' && $title->canExist() ) {
166 $preload[] = $title->getTalkPage();
170 if ( isset(
$params[6][
'pages'] ) ) {
171 foreach (
$params[6][
'pages'] as $page ) {
172 $preload[] = Title::newFromText( $page );
179 $subtype = $this->entry->getSubtype();
181 if ( $this->entry->isDeleted( LogPage::DELETED_ACTION )
182 || !( $subtype ===
'block' || $subtype ===
'reblock' )
183 || !$this->context->getAuthority()->isAllowed(
'block' )
189 $title = $this->entry->getTarget();
191 $linkRenderer->makeKnownLink(
192 SpecialPage::getTitleFor(
'Unblock', $title->getDBkey() ),
193 $this->msg(
'unblocklink' )->text()
195 $linkRenderer->makeKnownLink(
196 SpecialPage::getTitleFor(
'Block', $title->getDBkey() ),
197 $this->msg(
'change-blocklink' )->text()
201 return $this->
msg(
'parentheses' )->rawParams(
202 $this->context->getLanguage()->pipeList( $links ) )->escaped();
214 $flags = trim( $flags );
215 if ( $flags ===
'' ) {
218 $flags = explode(
',', $flags );
219 $flagsCount = count( $flags );
221 for ( $i = 0; $i < $flagsCount; $i++ ) {
222 $flags[$i] = self::formatBlockFlag( $flags[$i], $lang );
225 return wfMessage(
'parentheses' )->inLanguage( $lang )
226 ->rawParams( $lang->commaList( $flags ) )->escaped();
237 static $messages = [];
239 if ( !isset( $messages[$flag] ) ) {
240 $messages[$flag] = htmlspecialchars( $flag );
250 $msg =
wfMessage(
'block-log-flags-' . $flag )->inLanguage( $lang );
252 if ( $msg->exists() ) {
253 $messages[$flag] = $msg->escaped();
257 return $messages[$flag];