63 if ( $this->parsedParametersDeleteLog !==
null ) {
64 return $this->parsedParametersDeleteLog;
67 $params = parent::getMessageParameters();
68 $subtype = $this->entry->getSubtype();
69 if ( in_array( $subtype, [
'event',
'revision' ] ) ) {
75 ( $subtype ===
'event' && count( $params ) === 6 )
77 $subtype ===
'revision' && isset( $params[3] ) && count( $params ) === 7
78 && in_array( $params[3], [
'revision',
'archive',
'oldimage',
'filearchive' ] )
82 $paramStart = $subtype ===
'revision' ? 4 : 3;
89 foreach ( $hid as $v ) {
90 $changes[] = $this->
msg(
"$v-hid" )->plain();
94 foreach ( $unhid as $v ) {
95 $changes[] = $this->
msg(
"$v-unhid" )->plain();
97 foreach ( $extra as $v ) {
98 $changes[] = $this->
msg( $v )->plain();
100 $changeText = $this->context->getLanguage()->listToText( $changes );
102 $newParams = array_slice( $params, 0, 3 );
103 $newParams[3] = $changeText;
104 $ids = is_array( $params[$paramStart] )
105 ? $params[$paramStart]
106 : explode(
',', $params[$paramStart] );
107 $newParams[4] = $this->context->getLanguage()->formatNum( count( $ids ) );
109 $this->parsedParametersDeleteLog = $newParams;
110 return $this->parsedParametersDeleteLog;
112 $this->parsedParametersDeleteLog = array_slice( $params, 0, 3 );
113 return $this->parsedParametersDeleteLog;
115 } elseif ( $subtype ===
'restore' ) {
116 $rawParams = $this->entry->getParameters();
117 if ( isset( $rawParams[
':assoc:count'] ) ) {
119 foreach ( $rawParams[
':assoc:count'] as
$type => $count ) {
122 $countList[] = $this->context->msg(
'restore-count-' .
$type )
123 ->numParams( $count )->plain();
126 $params[3] = $this->context->getLanguage()->listToText( $countList );
130 $this->parsedParametersDeleteLog = $params;
131 return $this->parsedParametersDeleteLog;
147 if ( !$this->context->getAuthority()->isAllowed(
'deletedhistory' )
153 switch ( $this->entry->getSubtype() ) {
156 case 'delete_redir2':
157 if ( $this->context->getAuthority()->isAllowed(
'undelete' ) ) {
158 $message =
'undeletelink';
160 $message =
'undeleteviewlink';
162 $revert = $linkRenderer->makeKnownLink(
164 $this->
msg( $message )->text(),
166 [
'target' => $this->entry->getTarget()->getPrefixedDBkey() ]
169 return $this->
msg(
'parentheses' )->rawParams( $revert )->escaped();
173 if ( !isset( $params[3] ) || !isset( $params[4] ) ) {
180 $ids = is_array( $params[4] )
182 : explode(
',', $params[4] );
187 if ( count( $ids ) == 1 ) {
189 if ( $key ==
'oldid' || $key ==
'revision' ) {
190 $links[] = $linkRenderer->makeKnownLink(
191 $this->entry->getTarget(),
192 $this->msg(
'diff' )->text(),
195 'diff' => intval( $ids[0] ),
200 } elseif ( $key ==
'artimestamp' || $key ==
'archive' ) {
201 $links[] = $linkRenderer->makeKnownLink(
203 $this->
msg(
'diff' )->text(),
206 'target' => $this->entry->getTarget()->getPrefixedDBkey(),
208 'timestamp' => $ids[0]
215 $links[] = $linkRenderer->makeKnownLink(
217 $this->
msg(
'revdel-restore' )->text(),
220 'target' => $this->entry->getTarget()->getPrefixedText(),
222 'ids' => implode(
',', $ids ),
226 return $this->
msg(
'parentheses' )->rawParams(
227 $this->context->getLanguage()->pipeList( $links ) )->escaped();
231 if ( !isset( $params[3] ) ) {
236 if ( is_array( $query ) ) {
237 $query = implode(
',', $query );
240 $revert = $linkRenderer->makeKnownLink(
242 $this->
msg(
'revdel-restore' )->text(),
245 'target' => $this->entry->getTarget()->getPrefixedText(),
251 return $this->
msg(
'parentheses' )->rawParams( $revert )->escaped();
262 if ( in_array( $subtype, [
'event',
'revision' ] ) ) {
264 if ( $subtype ===
'event' ) {
265 array_unshift( $rawParams,
'logging' );
273 '4::ids' =>
'5::ids',
274 '5::ofield' =>
'6::ofield',
275 '6::nfield' =>
'7::nfield',
277 foreach ( $map as $index => $key ) {
278 if ( isset( $rawParams[$index] ) ) {
279 $rawParams[$key] = $rawParams[$index];
280 unset( $rawParams[$index] );
284 if ( !is_array( $rawParams[
'5::ids'] ) ) {
285 $rawParams[
'5::ids'] = explode(
',', $rawParams[
'5::ids'] );
289 '::type' => $rawParams[
'4::type'],
290 ':array:ids' => $rawParams[
'5::ids'],
294 RevisionRecord::DELETED_TEXT =>
'content',
295 RevisionRecord::DELETED_COMMENT =>
'comment',
296 RevisionRecord::DELETED_USER =>
'user',
297 RevisionRecord::DELETED_RESTRICTED =>
'restricted',
300 if ( isset( $rawParams[
'6::ofield'] ) ) {
302 $params[
':assoc:old'] = [
'bitmask' => $old ];
303 foreach ( $fields as $bit => $key ) {
304 $params[
':assoc:old'][$key] = (bool)( $old & $bit );
307 if ( isset( $rawParams[
'7::nfield'] ) ) {
309 $params[
':assoc:new'] = [
'bitmask' => $new ];
310 foreach ( $fields as $bit => $key ) {
311 $params[
':assoc:new'][$key] = (bool)( $new & $bit );
314 } elseif ( $subtype ===
'restore' ) {
316 if ( isset( $rawParams[
':assoc:count'] ) ) {
317 $params[
':assoc:count'] = $rawParams[
':assoc:count'];