Merge "Add 1.20 RELEASE-NOTES to HISTORY"
[lhc/web/wiklou.git] / includes / ChangesList.php
1 <?php
2 /**
3 * Classes to show lists of changes.
4 *
5 * These can be:
6 * - watchlist
7 * - related changes
8 * - recent changes
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * http://www.gnu.org/copyleft/gpl.html
24 *
25 * @file
26 */
27
28 /**
29 * @todo document
30 */
31 class RCCacheEntry extends RecentChange {
32 var $secureName, $link;
33 var $curlink , $difflink, $lastlink, $usertalklink, $versionlink;
34 var $userlink, $timestamp, $watched;
35
36 /**
37 * @param $rc RecentChange
38 * @return RCCacheEntry
39 */
40 static function newFromParent( $rc ) {
41 $rc2 = new RCCacheEntry;
42 $rc2->mAttribs = $rc->mAttribs;
43 $rc2->mExtra = $rc->mExtra;
44 return $rc2;
45 }
46 }
47
48 /**
49 * Base class for all changes lists
50 */
51 class ChangesList extends ContextSource {
52
53 /**
54 * @var Skin
55 */
56 public $skin;
57
58 protected $watchlist = false;
59
60 protected $message;
61
62 /**
63 * Changeslist contructor
64 *
65 * @param $obj Skin or IContextSource
66 */
67 public function __construct( $obj ) {
68 if ( $obj instanceof IContextSource ) {
69 $this->setContext( $obj );
70 $this->skin = $obj->getSkin();
71 } else {
72 $this->setContext( $obj->getContext() );
73 $this->skin = $obj;
74 }
75 $this->preCacheMessages();
76 }
77
78 /**
79 * Fetch an appropriate changes list class for the main context
80 * This first argument used to be an User object.
81 *
82 * @deprecated in 1.18; use newFromContext() instead
83 * @param $unused string|User Unused
84 * @return ChangesList|EnhancedChangesList|OldChangesList derivative
85 */
86 public static function newFromUser( $unused ) {
87 wfDeprecated( __METHOD__, '1.18' );
88 return self::newFromContext( RequestContext::getMain() );
89 }
90
91 /**
92 * Fetch an appropriate changes list class for the specified context
93 * Some users might want to use an enhanced list format, for instance
94 *
95 * @param $context IContextSource to use
96 * @return ChangesList|EnhancedChangesList|OldChangesList derivative
97 */
98 public static function newFromContext( IContextSource $context ) {
99 $user = $context->getUser();
100 $sk = $context->getSkin();
101 $list = null;
102 if( wfRunHooks( 'FetchChangesList', array( $user, &$sk, &$list ) ) ) {
103 $new = $context->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
104 return $new ? new EnhancedChangesList( $context ) : new OldChangesList( $context );
105 } else {
106 return $list;
107 }
108 }
109
110 /**
111 * Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag
112 * @param $value Boolean
113 */
114 public function setWatchlistDivs( $value = true ) {
115 $this->watchlist = $value;
116 }
117
118 /**
119 * As we use the same small set of messages in various methods and that
120 * they are called often, we call them once and save them in $this->message
121 */
122 private function preCacheMessages() {
123 if( !isset( $this->message ) ) {
124 foreach ( explode( ' ', 'cur diff hist last blocklink history ' .
125 'semicolon-separator pipe-separator' ) as $msg ) {
126 $this->message[$msg] = $this->msg( $msg )->escaped();
127 }
128 }
129 }
130
131 /**
132 * Returns the appropriate flags for new page, minor change and patrolling
133 * @param $flags Array Associative array of 'flag' => Bool
134 * @param $nothing String to use for empty space
135 * @return String
136 */
137 protected function recentChangesFlags( $flags, $nothing = '&#160;' ) {
138 $f = '';
139 foreach( array( 'newpage', 'minor', 'bot', 'unpatrolled' ) as $flag ){
140 $f .= isset( $flags[$flag] ) && $flags[$flag]
141 ? self::flag( $flag )
142 : $nothing;
143 }
144 return $f;
145 }
146
147 /**
148 * Provide the "<abbr>" element appropriate to a given abbreviated flag,
149 * namely the flag indicating a new page, a minor edit, a bot edit, or an
150 * unpatrolled edit. By default in English it will contain "N", "m", "b",
151 * "!" respectively, plus it will have an appropriate title and class.
152 *
153 * @param $flag String: 'newpage', 'unpatrolled', 'minor', or 'bot'
154 * @return String: Raw HTML
155 */
156 public static function flag( $flag ) {
157 static $messages = null;
158 if ( is_null( $messages ) ) {
159 $messages = array(
160 'newpage' => array( 'newpageletter', 'recentchanges-label-newpage' ),
161 'minoredit' => array( 'minoreditletter', 'recentchanges-label-minor' ),
162 'botedit' => array( 'boteditletter', 'recentchanges-label-bot' ),
163 'unpatrolled' => array( 'unpatrolledletter', 'recentchanges-label-unpatrolled' ),
164 );
165 foreach( $messages as &$value ) {
166 $value[0] = wfMessage( $value[0] )->escaped();
167 $value[1] = wfMessage( $value[1] )->escaped();
168 }
169 }
170
171 # Inconsistent naming, bleh
172 $map = array(
173 'newpage' => 'newpage',
174 'minor' => 'minoredit',
175 'bot' => 'botedit',
176 'unpatrolled' => 'unpatrolled',
177 'minoredit' => 'minoredit',
178 'botedit' => 'botedit',
179 );
180 $flag = $map[$flag];
181
182 return "<abbr class='$flag' title='" . $messages[$flag][1] . "'>" . $messages[$flag][0] . '</abbr>';
183 }
184
185 /**
186 * Returns text for the start of the tabular part of RC
187 * @return String
188 */
189 public function beginRecentChangesList() {
190 $this->rc_cache = array();
191 $this->rcMoveIndex = 0;
192 $this->rcCacheIndex = 0;
193 $this->lastdate = '';
194 $this->rclistOpen = false;
195 $this->getOutput()->addModuleStyles( 'mediawiki.special.changeslist' );
196 return '';
197 }
198
199 /**
200 * Show formatted char difference
201 * @param $old Integer: bytes
202 * @param $new Integer: bytes
203 * @param $context IContextSource context to use
204 * @return String
205 */
206 public static function showCharacterDifference( $old, $new, IContextSource $context = null ) {
207 global $wgRCChangedSizeThreshold, $wgMiserMode;
208
209 if ( !$context ) {
210 $context = RequestContext::getMain();
211 }
212
213 $new = (int)$new;
214 $old = (int)$old;
215 $szdiff = $new - $old;
216
217 $lang = $context->getLanguage();
218 $code = $lang->getCode();
219 static $fastCharDiff = array();
220 if ( !isset($fastCharDiff[$code]) ) {
221 $fastCharDiff[$code] = $wgMiserMode || $context->msg( 'rc-change-size' )->plain() === '$1';
222 }
223
224 $formattedSize = $lang->formatNum( $szdiff );
225
226 if ( !$fastCharDiff[$code] ) {
227 $formattedSize = $context->msg( 'rc-change-size', $formattedSize )->text();
228 }
229
230 if( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
231 $tag = 'strong';
232 } else {
233 $tag = 'span';
234 }
235
236 if ( $szdiff === 0 ) {
237 $formattedSizeClass = 'mw-plusminus-null';
238 }
239 if ( $szdiff > 0 ) {
240 $formattedSize = '+' . $formattedSize;
241 $formattedSizeClass = 'mw-plusminus-pos';
242 }
243 if ( $szdiff < 0 ) {
244 $formattedSizeClass = 'mw-plusminus-neg';
245 }
246
247 $formattedTotalSize = $context->msg( 'rc-change-size-new' )->numParams( $new )->text();
248
249 return Html::element( $tag,
250 array( 'dir' => 'ltr', 'class' => $formattedSizeClass, 'title' => $formattedTotalSize ),
251 $context->msg( 'parentheses', $formattedSize )->plain() ) . $lang->getDirMark();
252 }
253
254 /**
255 * Format the character difference of one or several changes.
256 *
257 * @param $old RecentChange
258 * @param $new RecentChange last change to use, if not provided, $old will be used
259 * @return string HTML fragment
260 */
261 public function formatCharacterDifference( RecentChange $old, RecentChange $new = null ) {
262 $oldlen = $old->mAttribs['rc_old_len'];
263
264 if ( $new ) {
265 $newlen = $new->mAttribs['rc_new_len'];
266 } else {
267 $newlen = $old->mAttribs['rc_new_len'];
268 }
269
270 if( $oldlen === null || $newlen === null ) {
271 return '';
272 }
273
274 return self::showCharacterDifference( $oldlen, $newlen, $this->getContext() );
275 }
276
277 /**
278 * Returns text for the end of RC
279 * @return String
280 */
281 public function endRecentChangesList() {
282 if( $this->rclistOpen ) {
283 return "</ul>\n";
284 } else {
285 return '';
286 }
287 }
288
289 public function insertDateHeader( &$s, $rc_timestamp ) {
290 # Make date header if necessary
291 $date = $this->getLanguage()->userDate( $rc_timestamp, $this->getUser() );
292 if( $date != $this->lastdate ) {
293 if( $this->lastdate != '' ) {
294 $s .= "</ul>\n";
295 }
296 $s .= Xml::element( 'h4', null, $date ) . "\n<ul class=\"special\">";
297 $this->lastdate = $date;
298 $this->rclistOpen = true;
299 }
300 }
301
302 public function insertLog( &$s, $title, $logtype ) {
303 $page = new LogPage( $logtype );
304 $logname = $page->getName()->escaped();
305 $s .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $title, $logname ) )->escaped();
306 }
307
308 /**
309 * @param $s
310 * @param $rc RecentChange
311 * @param $unpatrolled
312 */
313 public function insertDiffHist( &$s, &$rc, $unpatrolled ) {
314 # Diff link
315 if( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
316 $diffLink = $this->message['diff'];
317 } elseif ( !self::userCan( $rc, Revision::DELETED_TEXT, $this->getUser() ) ) {
318 $diffLink = $this->message['diff'];
319 } else {
320 $query = array(
321 'curid' => $rc->mAttribs['rc_cur_id'],
322 'diff' => $rc->mAttribs['rc_this_oldid'],
323 'oldid' => $rc->mAttribs['rc_last_oldid']
324 );
325
326 if( $unpatrolled ) {
327 $query['rcid'] = $rc->mAttribs['rc_id'];
328 };
329
330 $diffLink = Linker::linkKnown(
331 $rc->getTitle(),
332 $this->message['diff'],
333 array( 'tabindex' => $rc->counter ),
334 $query
335 );
336 }
337 $diffhist = $diffLink . $this->message['pipe-separator'];
338 # History link
339 $diffhist .= Linker::linkKnown(
340 $rc->getTitle(),
341 $this->message['hist'],
342 array(),
343 array(
344 'curid' => $rc->mAttribs['rc_cur_id'],
345 'action' => 'history'
346 )
347 );
348 $s .= $this->msg( 'parentheses' )->rawParams( $diffhist )->escaped() . ' <span class="mw-changeslist-separator">. .</span> ';
349 }
350
351 /**
352 * @param $s
353 * @param $rc RecentChange
354 * @param $unpatrolled
355 * @param $watched
356 */
357 public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
358 # If it's a new article, there is no diff link, but if it hasn't been
359 # patrolled yet, we need to give users a way to do so
360 $params = array();
361
362 if ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW ) {
363 $params['rcid'] = $rc->mAttribs['rc_id'];
364 }
365
366 $articlelink = Linker::linkKnown(
367 $rc->getTitle(),
368 null,
369 array( 'class' => 'mw-changeslist-title' ),
370 $params
371 );
372 if( $this->isDeleted($rc,Revision::DELETED_TEXT) ) {
373 $articlelink = '<span class="history-deleted">' . $articlelink . '</span>';
374 }
375 # To allow for boldening pages watched by this user
376 $articlelink = "<span class=\"mw-title\">{$articlelink}</span>";
377 # RTL/LTR marker
378 $articlelink .= $this->getLanguage()->getDirMark();
379
380 wfRunHooks( 'ChangesListInsertArticleLink',
381 array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched) );
382
383 $s .= " $articlelink";
384 }
385
386 /**
387 * @param $s
388 * @param $rc RecentChange
389 */
390 public function insertTimestamp( &$s, $rc ) {
391 $s .= $this->message['semicolon-separator'] . '<span class="mw-changeslist-date">' .
392 $this->getLanguage()->userTime( $rc->mAttribs['rc_timestamp'], $this->getUser() ) . '</span> <span class="mw-changeslist-separator">. .</span> ';
393 }
394
395 /**
396 * Insert links to user page, user talk page and eventually a blocking link
397 *
398 * @param &$s String HTML to update
399 * @param &$rc RecentChange
400 */
401 public function insertUserRelatedLinks( &$s, &$rc ) {
402 if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
403 $s .= ' <span class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() . '</span>';
404 } else {
405 $s .= $this->getLanguage()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'],
406 $rc->mAttribs['rc_user_text'] );
407 $s .= Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
408 }
409 }
410
411 /**
412 * Insert a formatted action
413 *
414 * @param $rc RecentChange
415 * @return string
416 */
417 public function insertLogEntry( $rc ) {
418 $formatter = LogFormatter::newFromRow( $rc->mAttribs );
419 $formatter->setContext( $this->getContext() );
420 $formatter->setShowUserToolLinks( true );
421 $mark = $this->getLanguage()->getDirMark();
422 return $formatter->getActionText() . " $mark" . $formatter->getComment();
423 }
424
425 /**
426 * Insert a formatted comment
427 * @param $rc RecentChange
428 * @return string
429 */
430 public function insertComment( $rc ) {
431 if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
432 if( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
433 return ' <span class="history-deleted">' . $this->msg( 'rev-deleted-comment' )->escaped() . '</span>';
434 } else {
435 return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
436 }
437 }
438 }
439
440 /**
441 * Check whether to enable recent changes patrol features
442 * @return Boolean
443 */
444 public static function usePatrol() {
445 global $wgUser;
446 return $wgUser->useRCPatrol();
447 }
448
449 /**
450 * Returns the string which indicates the number of watching users
451 * @return string
452 */
453 protected function numberofWatchingusers( $count ) {
454 static $cache = array();
455 if( $count > 0 ) {
456 if( !isset( $cache[$count] ) ) {
457 $cache[$count] = $this->msg( 'number_of_watching_users_RCview' )->numParams( $count )->escaped();
458 }
459 return $cache[$count];
460 } else {
461 return '';
462 }
463 }
464
465 /**
466 * Determine if said field of a revision is hidden
467 * @param $rc RCCacheEntry
468 * @param $field Integer: one of DELETED_* bitfield constants
469 * @return Boolean
470 */
471 public static function isDeleted( $rc, $field ) {
472 return ( $rc->mAttribs['rc_deleted'] & $field ) == $field;
473 }
474
475 /**
476 * Determine if the current user is allowed to view a particular
477 * field of this revision, if it's marked as deleted.
478 * @param $rc RCCacheEntry
479 * @param $field Integer
480 * @param $user User object to check, or null to use $wgUser
481 * @return Boolean
482 */
483 public static function userCan( $rc, $field, User $user = null ) {
484 if( $rc->mAttribs['rc_type'] == RC_LOG ) {
485 return LogEventsList::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
486 } else {
487 return Revision::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
488 }
489 }
490
491 /**
492 * @param $link string
493 * @param $watched bool
494 * @return string
495 */
496 protected function maybeWatchedLink( $link, $watched = false ) {
497 if( $watched ) {
498 return '<strong class="mw-watched">' . $link . '</strong>';
499 } else {
500 return '<span class="mw-rc-unwatched">' . $link . '</span>';
501 }
502 }
503
504 /** Inserts a rollback link
505 *
506 * @param $s string
507 * @param $rc RecentChange
508 */
509 public function insertRollback( &$s, &$rc ) {
510 if( $rc->mAttribs['rc_type'] != RC_NEW && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
511 $page = $rc->getTitle();
512 /** Check for rollback and edit permissions, disallow special pages, and only
513 * show a link on the top-most revision */
514 if ( $this->getUser()->isAllowed('rollback') && $rc->mAttribs['page_latest'] == $rc->mAttribs['rc_this_oldid'] )
515 {
516 $rev = new Revision( array(
517 'title' => $page,
518 'id' => $rc->mAttribs['rc_this_oldid'],
519 'user' => $rc->mAttribs['rc_user'],
520 'user_text' => $rc->mAttribs['rc_user_text'],
521 'deleted' => $rc->mAttribs['rc_deleted']
522 ) );
523 $s .= ' '.Linker::generateRollback( $rev, $this->getContext() );
524 }
525 }
526 }
527
528 /**
529 * @param $s string
530 * @param $rc RecentChange
531 * @param $classes
532 */
533 public function insertTags( &$s, &$rc, &$classes ) {
534 if ( empty($rc->mAttribs['ts_tags']) )
535 return;
536
537 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist' );
538 $classes = array_merge( $classes, $newClasses );
539 $s .= ' ' . $tagSummary;
540 }
541
542 public function insertExtra( &$s, &$rc, &$classes ) {
543 ## Empty, used for subclassers to add anything special.
544 }
545
546 protected function showAsUnpatrolled( RecentChange $rc ) {
547 $unpatrolled = false;
548 if ( !$rc->mAttribs['rc_patrolled'] ) {
549 if ( $this->getUser()->useRCPatrol() ) {
550 $unpatrolled = true;
551 } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_type'] == RC_NEW ) {
552 $unpatrolled = true;
553 }
554 }
555 return $unpatrolled;
556 }
557 }
558
559
560 /**
561 * Generate a list of changes using the good old system (no javascript)
562 */
563 class OldChangesList extends ChangesList {
564 /**
565 * Format a line using the old system (aka without any javascript).
566 *
567 * @param $rc RecentChange, passed by reference
568 * @param $watched Bool (default false)
569 * @param $linenumber Int (default null)
570 * @return string
571 */
572 public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
573 global $wgRCShowChangedSize;
574 wfProfileIn( __METHOD__ );
575
576 # Should patrol-related stuff be shown?
577 $unpatrolled = $this->showAsUnpatrolled( $rc );
578
579 $dateheader = ''; // $s now contains only <li>...</li>, for hooks' convenience.
580 $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
581
582 $s = '';
583 $classes = array();
584 // use mw-line-even/mw-line-odd class only if linenumber is given (feature from bug 14468)
585 if( $linenumber ) {
586 if( $linenumber & 1 ) {
587 $classes[] = 'mw-line-odd';
588 }
589 else {
590 $classes[] = 'mw-line-even';
591 }
592 }
593
594 // Indicate watched status on the line to allow for more
595 // comprehensive styling.
596 $classes[] = $watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
597
598 // Moved pages (very very old, not supported anymore)
599 if( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
600 // Log entries
601 } elseif( $rc->mAttribs['rc_log_type'] ) {
602 $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
603 $this->insertLog( $s, $logtitle, $rc->mAttribs['rc_log_type'] );
604 // Log entries (old format) or log targets, and special pages
605 } elseif( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
606 list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $rc->mAttribs['rc_title'] );
607 if( $name == 'Log' ) {
608 $this->insertLog( $s, $rc->getTitle(), $subpage );
609 }
610 // Regular entries
611 } else {
612 $this->insertDiffHist( $s, $rc, $unpatrolled );
613 # M, N, b and ! (minor, new, bot and unpatrolled)
614 $s .= $this->recentChangesFlags(
615 array(
616 'newpage' => $rc->mAttribs['rc_type'] == RC_NEW,
617 'minor' => $rc->mAttribs['rc_minor'],
618 'unpatrolled' => $unpatrolled,
619 'bot' => $rc->mAttribs['rc_bot']
620 ),
621 ''
622 );
623 $this->insertArticleLink( $s, $rc, $unpatrolled, $watched );
624 }
625 # Edit/log timestamp
626 $this->insertTimestamp( $s, $rc );
627 # Bytes added or removed
628 if ( $wgRCShowChangedSize ) {
629 $cd = $this->formatCharacterDifference( $rc );
630 if ( $cd !== '' ) {
631 $s .= $cd . ' <span class="mw-changeslist-separator">. .</span> ';
632 }
633 }
634
635 if ( $rc->mAttribs['rc_type'] == RC_LOG ) {
636 $s .= $this->insertLogEntry( $rc );
637 } else {
638 # User tool links
639 $this->insertUserRelatedLinks( $s, $rc );
640 # LTR/RTL direction mark
641 $s .= $this->getLanguage()->getDirMark();
642 $s .= $this->insertComment( $rc );
643 }
644
645 # Tags
646 $this->insertTags( $s, $rc, $classes );
647 # Rollback
648 $this->insertRollback( $s, $rc );
649 # For subclasses
650 $this->insertExtra( $s, $rc, $classes );
651
652 # How many users watch this page
653 if( $rc->numberofWatchingusers > 0 ) {
654 $s .= ' ' . $this->numberofWatchingusers( $rc->numberofWatchingusers );
655 }
656
657 if( $this->watchlist ) {
658 $classes[] = Sanitizer::escapeClass( 'watchlist-'.$rc->mAttribs['rc_namespace'].'-'.$rc->mAttribs['rc_title'] );
659 }
660
661 wfRunHooks( 'OldChangesListRecentChangesLine', array(&$this, &$s, $rc) );
662
663 wfProfileOut( __METHOD__ );
664 return "$dateheader<li class=\"".implode( ' ', $classes )."\">".$s."</li>\n";
665 }
666 }
667
668
669 /**
670 * Generate a list of changes using an Enhanced system (uses javascript).
671 */
672 class EnhancedChangesList extends ChangesList {
673
674 protected $rc_cache;
675
676 /**
677 * Add the JavaScript file for enhanced changeslist
678 * @return String
679 */
680 public function beginRecentChangesList() {
681 $this->rc_cache = array();
682 $this->rcMoveIndex = 0;
683 $this->rcCacheIndex = 0;
684 $this->lastdate = '';
685 $this->rclistOpen = false;
686 $this->getOutput()->addModuleStyles( 'mediawiki.special.changeslist' );
687 return '';
688 }
689 /**
690 * Format a line for enhanced recentchange (aka with javascript and block of lines).
691 *
692 * @param $baseRC RecentChange
693 * @param $watched bool
694 *
695 * @return string
696 */
697 public function recentChangesLine( &$baseRC, $watched = false ) {
698 wfProfileIn( __METHOD__ );
699
700 # Create a specialised object
701 $rc = RCCacheEntry::newFromParent( $baseRC );
702
703 $curIdEq = array( 'curid' => $rc->mAttribs['rc_cur_id'] );
704
705 # If it's a new day, add the headline and flush the cache
706 $date = $this->getLanguage()->userDate( $rc->mAttribs['rc_timestamp'], $this->getUser() );
707 $ret = '';
708 if( $date != $this->lastdate ) {
709 # Process current cache
710 $ret = $this->recentChangesBlock();
711 $this->rc_cache = array();
712 $ret .= Xml::element( 'h4', null, $date ) . "\n";
713 $this->lastdate = $date;
714 }
715
716 # Should patrol-related stuff be shown?
717 $rc->unpatrolled = $this->showAsUnpatrolled( $rc );
718
719 $showdifflinks = true;
720 # Make article link
721 $type = $rc->mAttribs['rc_type'];
722 $logType = $rc->mAttribs['rc_log_type'];
723 // Page moves, very old style, not supported anymore
724 if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
725 // New unpatrolled pages
726 } elseif( $rc->unpatrolled && $type == RC_NEW ) {
727 $clink = Linker::linkKnown( $rc->getTitle(), null, array(),
728 array( 'rcid' => $rc->mAttribs['rc_id'] ) );
729 // Log entries
730 } elseif( $type == RC_LOG ) {
731 if( $logType ) {
732 $logtitle = SpecialPage::getTitleFor( 'Log', $logType );
733 $logpage = new LogPage( $logType );
734 $logname = $logpage->getName()->escaped();
735 $clink = $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped();
736 } else {
737 $clink = Linker::link( $rc->getTitle() );
738 }
739 $watched = false;
740 // Log entries (old format) and special pages
741 } elseif( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
742 wfDebug( "Unexpected special page in recentchanges\n" );
743 $clink = '';
744 // Edits
745 } else {
746 $clink = Linker::linkKnown( $rc->getTitle() );
747 }
748
749 # Don't show unusable diff links
750 if ( !ChangesList::userCan( $rc, Revision::DELETED_TEXT, $this->getUser() ) ) {
751 $showdifflinks = false;
752 }
753
754 $time = $this->getLanguage()->userTime( $rc->mAttribs['rc_timestamp'], $this->getUser() );
755 $rc->watched = $watched;
756 $rc->link = $clink;
757 $rc->timestamp = $time;
758 $rc->numberofWatchingusers = $baseRC->numberofWatchingusers;
759
760 # Make "cur" and "diff" links. Do not use link(), it is too slow if
761 # called too many times (50% of CPU time on RecentChanges!).
762 $thisOldid = $rc->mAttribs['rc_this_oldid'];
763 $lastOldid = $rc->mAttribs['rc_last_oldid'];
764 if( $rc->unpatrolled ) {
765 $rcIdQuery = array( 'rcid' => $rc->mAttribs['rc_id'] );
766 } else {
767 $rcIdQuery = array();
768 }
769 $querycur = $curIdEq + array( 'diff' => '0', 'oldid' => $thisOldid );
770 $querydiff = $curIdEq + array( 'diff' => $thisOldid, 'oldid' =>
771 $lastOldid ) + $rcIdQuery;
772
773 if( !$showdifflinks ) {
774 $curLink = $this->message['cur'];
775 $diffLink = $this->message['diff'];
776 } elseif( in_array( $type, array( RC_NEW, RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) {
777 if ( $type != RC_NEW ) {
778 $curLink = $this->message['cur'];
779 } else {
780 $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) );
781 $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
782 }
783 $diffLink = $this->message['diff'];
784 } else {
785 $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querydiff ) );
786 $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) );
787 $diffLink = "<a href=\"$diffUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['diff']}</a>";
788 $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
789 }
790
791 # Make "last" link
792 if( !$showdifflinks || !$lastOldid ) {
793 $lastLink = $this->message['last'];
794 } elseif( in_array( $type, array( RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) {
795 $lastLink = $this->message['last'];
796 } else {
797 $lastLink = Linker::linkKnown( $rc->getTitle(), $this->message['last'],
798 array(), $curIdEq + array('diff' => $thisOldid, 'oldid' => $lastOldid) + $rcIdQuery );
799 }
800
801 # Make user links
802 if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
803 $rc->userlink = ' <span class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() . '</span>';
804 } else {
805 $rc->userlink = Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
806 $rc->usertalklink = Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
807 }
808
809 $rc->lastlink = $lastLink;
810 $rc->curlink = $curLink;
811 $rc->difflink = $diffLink;
812
813 # Put accumulated information into the cache, for later display
814 # Page moves go on their own line
815 $title = $rc->getTitle();
816 $secureName = $title->getPrefixedDBkey();
817 if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
818 # Use an @ character to prevent collision with page names
819 $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
820 } else {
821 # Logs are grouped by type
822 if( $type == RC_LOG ){
823 $secureName = SpecialPage::getTitleFor( 'Log', $logType )->getPrefixedDBkey();
824 }
825 if( !isset( $this->rc_cache[$secureName] ) ) {
826 $this->rc_cache[$secureName] = array();
827 }
828
829 array_push( $this->rc_cache[$secureName], $rc );
830 }
831
832 wfProfileOut( __METHOD__ );
833
834 return $ret;
835 }
836
837 /**
838 * Enhanced RC group
839 * @return string
840 */
841 protected function recentChangesBlockGroup( $block ) {
842 global $wgRCShowChangedSize;
843
844 wfProfileIn( __METHOD__ );
845
846 # Add the namespace and title of the block as part of the class
847 $classes = array( 'mw-collapsible', 'mw-collapsed', 'mw-enhanced-rc' );
848 if ( $block[0]->mAttribs['rc_log_type'] ) {
849 # Log entry
850 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
851 . $block[0]->mAttribs['rc_log_type'] . '-' . $block[0]->mAttribs['rc_title'] );
852 } else {
853 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns'
854 . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] );
855 }
856 $classes[] = $block[0]->watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
857 $r = Html::openElement( 'table', array( 'class' => $classes ) ) .
858 Html::openElement( 'tr' );
859
860 # Collate list of users
861 $userlinks = array();
862 # Other properties
863 $unpatrolled = false;
864 $isnew = false;
865 $allBots = true;
866 $allMinors = true;
867 $curId = $currentRevision = 0;
868 # Some catalyst variables...
869 $namehidden = true;
870 $allLogs = true;
871 foreach( $block as $rcObj ) {
872 $oldid = $rcObj->mAttribs['rc_last_oldid'];
873 if( $rcObj->mAttribs['rc_type'] == RC_NEW ) {
874 $isnew = true;
875 }
876 // If all log actions to this page were hidden, then don't
877 // give the name of the affected page for this block!
878 if( !$this->isDeleted( $rcObj, LogPage::DELETED_ACTION ) ) {
879 $namehidden = false;
880 }
881 $u = $rcObj->userlink;
882 if( !isset( $userlinks[$u] ) ) {
883 $userlinks[$u] = 0;
884 }
885 if( $rcObj->unpatrolled ) {
886 $unpatrolled = true;
887 }
888 if( $rcObj->mAttribs['rc_type'] != RC_LOG ) {
889 $allLogs = false;
890 }
891 # Get the latest entry with a page_id and oldid
892 # since logs may not have these.
893 if( !$curId && $rcObj->mAttribs['rc_cur_id'] ) {
894 $curId = $rcObj->mAttribs['rc_cur_id'];
895 }
896 if( !$currentRevision && $rcObj->mAttribs['rc_this_oldid'] ) {
897 $currentRevision = $rcObj->mAttribs['rc_this_oldid'];
898 }
899
900 if( !$rcObj->mAttribs['rc_bot'] ) {
901 $allBots = false;
902 }
903 if( !$rcObj->mAttribs['rc_minor'] ) {
904 $allMinors = false;
905 }
906
907 $userlinks[$u]++;
908 }
909
910 # Sort the list and convert to text
911 krsort( $userlinks );
912 asort( $userlinks );
913 $users = array();
914 foreach( $userlinks as $userlink => $count) {
915 $text = $userlink;
916 $text .= $this->getLanguage()->getDirMark();
917 if( $count > 1 ) {
918 $text .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped();
919 }
920 array_push( $users, $text );
921 }
922
923 $users = ' <span class="changedby">'
924 . $this->msg( 'brackets' )->rawParams(
925 implode( $this->message['semicolon-separator'], $users )
926 )->escaped() . '</span>';
927
928 $tl = '<span class="mw-collapsible-toggle mw-enhancedchanges-arrow"></span>';
929 $r .= "<td>$tl</td>";
930
931 # Main line
932 $r .= '<td class="mw-enhanced-rc">' . $this->recentChangesFlags( array(
933 'newpage' => $isnew, # show, when one have this flag
934 'minor' => $allMinors, # show only, when all have this flag
935 'unpatrolled' => $unpatrolled, # show, when one have this flag
936 'bot' => $allBots, # show only, when all have this flag
937 ) );
938
939 # Timestamp
940 $r .= '&#160;'.$block[0]->timestamp.'&#160;</td><td>';
941
942 # Article link
943 if( $namehidden ) {
944 $r .= ' <span class="history-deleted">' . $this->msg( 'rev-deleted-event' )->escaped() . '</span>';
945 } elseif( $allLogs ) {
946 $r .= $this->maybeWatchedLink( $block[0]->link, $block[0]->watched );
947 } else {
948 $this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched );
949 }
950
951 $r .= $this->getLanguage()->getDirMark();
952
953 $queryParams['curid'] = $curId;
954 # Changes message
955 $n = count($block);
956 static $nchanges = array();
957 if ( !isset( $nchanges[$n] ) ) {
958 $nchanges[$n] = $this->msg( 'nchanges' )->numParams( $n )->escaped();
959 }
960 # Total change link
961 $r .= ' ';
962 $logtext = '';
963 if( !$allLogs ) {
964 if( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
965 $logtext .= $nchanges[$n];
966 } elseif( $isnew ) {
967 $logtext .= $nchanges[$n];
968 } else {
969 $params = $queryParams;
970 $params['diff'] = $currentRevision;
971 $params['oldid'] = $oldid;
972
973 $logtext .= Linker::link(
974 $block[0]->getTitle(),
975 $nchanges[$n],
976 array(),
977 $params,
978 array( 'known', 'noclasses' )
979 );
980 }
981 }
982
983 # History
984 if( $allLogs ) {
985 // don't show history link for logs
986 } elseif( $namehidden || !$block[0]->getTitle()->exists() ) {
987 $logtext .= $this->message['pipe-separator'] . $this->message['hist'];
988 } else {
989 $params = $queryParams;
990 $params['action'] = 'history';
991
992 $logtext .= $this->message['pipe-separator'] .
993 Linker::linkKnown(
994 $block[0]->getTitle(),
995 $this->message['hist'],
996 array(),
997 $params
998 );
999 }
1000
1001 if( $logtext !== '' ) {
1002 $r .= $this->msg( 'parentheses' )->rawParams( $logtext )->escaped();
1003 }
1004
1005 $r .= ' <span class="mw-changeslist-separator">. .</span> ';
1006
1007 # Character difference (does not apply if only log items)
1008 if( $wgRCShowChangedSize && !$allLogs ) {
1009 $last = 0;
1010 $first = count($block) - 1;
1011 # Some events (like logs) have an "empty" size, so we need to skip those...
1012 while( $last < $first && $block[$last]->mAttribs['rc_new_len'] === null ) {
1013 $last++;
1014 }
1015 while( $first > $last && $block[$first]->mAttribs['rc_old_len'] === null ) {
1016 $first--;
1017 }
1018 # Get net change
1019 $chardiff = $this->formatCharacterDifference( $block[$first], $block[$last] );
1020
1021 if( $chardiff == '' ) {
1022 $r .= ' ';
1023 } else {
1024 $r .= ' ' . $chardiff. ' <span class="mw-changeslist-separator">. .</span> ';
1025 }
1026 }
1027
1028 $r .= $users;
1029 $r .= $this->numberofWatchingusers($block[0]->numberofWatchingusers);
1030
1031 # Sub-entries
1032 foreach( $block as $rcObj ) {
1033 # Classes to apply -- TODO implement
1034 $classes = array();
1035 $type = $rcObj->mAttribs['rc_type'];
1036
1037 $r .= '<tr><td></td><td class="mw-enhanced-rc">';
1038 $r .= $this->recentChangesFlags( array(
1039 'newpage' => $type == RC_NEW,
1040 'minor' => $rcObj->mAttribs['rc_minor'],
1041 'unpatrolled' => $rcObj->unpatrolled,
1042 'bot' => $rcObj->mAttribs['rc_bot'],
1043 ) );
1044 $r .= '&#160;</td><td class="mw-enhanced-rc-nested"><span class="mw-enhanced-rc-time">';
1045
1046 $params = $queryParams;
1047
1048 if( $rcObj->mAttribs['rc_this_oldid'] != 0 ) {
1049 $params['oldid'] = $rcObj->mAttribs['rc_this_oldid'];
1050 }
1051
1052 # Log timestamp
1053 if( $type == RC_LOG ) {
1054 $link = $rcObj->timestamp;
1055 # Revision link
1056 } elseif( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
1057 $link = '<span class="history-deleted">'.$rcObj->timestamp.'</span> ';
1058 } else {
1059 if ( $rcObj->unpatrolled && $type == RC_NEW) {
1060 $params['rcid'] = $rcObj->mAttribs['rc_id'];
1061 }
1062
1063 $link = Linker::linkKnown(
1064 $rcObj->getTitle(),
1065 $rcObj->timestamp,
1066 array(),
1067 $params
1068 );
1069 if( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) {
1070 $link = '<span class="history-deleted">'.$link.'</span> ';
1071 }
1072 }
1073 $r .= $link . '</span>';
1074
1075 if ( !$type == RC_LOG || $type == RC_NEW ) {
1076 $r .= ' ' . $this->msg( 'parentheses' )->rawParams( $rcObj->curlink . $this->message['pipe-separator'] . $rcObj->lastlink )->escaped();
1077 }
1078 $r .= ' <span class="mw-changeslist-separator">. .</span> ';
1079
1080 # Character diff
1081 if ( $wgRCShowChangedSize ) {
1082 $cd = $this->formatCharacterDifference( $rcObj );
1083 if ( $cd !== '' ) {
1084 $r .= $cd . ' <span class="mw-changeslist-separator">. .</span> ';
1085 }
1086 }
1087
1088 if ( $rcObj->mAttribs['rc_type'] == RC_LOG ) {
1089 $r .= $this->insertLogEntry( $rcObj );
1090 } else {
1091 # User links
1092 $r .= $rcObj->userlink;
1093 $r .= $rcObj->usertalklink;
1094 $r .= $this->insertComment( $rcObj );
1095 }
1096
1097 # Rollback
1098 $this->insertRollback( $r, $rcObj );
1099 # Tags
1100 $this->insertTags( $r, $rcObj, $classes );
1101
1102 $r .= "</td></tr>\n";
1103 }
1104 $r .= "</table>\n";
1105
1106 $this->rcCacheIndex++;
1107
1108 wfProfileOut( __METHOD__ );
1109
1110 return $r;
1111 }
1112
1113 /**
1114 * Generate HTML for an arrow or placeholder graphic
1115 * @param $dir String: one of '', 'd', 'l', 'r'
1116 * @param $alt String: text
1117 * @param $title String: text
1118 * @return String: HTML "<img>" tag
1119 */
1120 protected function arrow( $dir, $alt='', $title='' ) {
1121 global $wgStylePath;
1122 $encUrl = htmlspecialchars( $wgStylePath . '/common/images/Arr_' . $dir . '.png' );
1123 $encAlt = htmlspecialchars( $alt );
1124 $encTitle = htmlspecialchars( $title );
1125 return "<img src=\"$encUrl\" width=\"12\" height=\"12\" alt=\"$encAlt\" title=\"$encTitle\" />";
1126 }
1127
1128 /**
1129 * Generate HTML for a right- or left-facing arrow,
1130 * depending on language direction.
1131 * @return String: HTML "<img>" tag
1132 */
1133 protected function sideArrow() {
1134 $dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
1135 return $this->arrow( $dir, '+', $this->msg( 'rc-enhanced-expand' )->text() );
1136 }
1137
1138 /**
1139 * Generate HTML for a down-facing arrow
1140 * depending on language direction.
1141 * @return String: HTML "<img>" tag
1142 */
1143 protected function downArrow() {
1144 return $this->arrow( 'd', '-', $this->msg( 'rc-enhanced-hide' )->text() );
1145 }
1146
1147 /**
1148 * Generate HTML for a spacer image
1149 * @return String: HTML "<img>" tag
1150 */
1151 protected function spacerArrow() {
1152 return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // non-breaking space
1153 }
1154
1155 /**
1156 * Enhanced RC ungrouped line.
1157 *
1158 * @param $rcObj RecentChange
1159 * @return String: a HTML formatted line (generated using $r)
1160 */
1161 protected function recentChangesBlockLine( $rcObj ) {
1162 global $wgRCShowChangedSize;
1163
1164 wfProfileIn( __METHOD__ );
1165 $query['curid'] = $rcObj->mAttribs['rc_cur_id'];
1166
1167 $type = $rcObj->mAttribs['rc_type'];
1168 $logType = $rcObj->mAttribs['rc_log_type'];
1169 $classes = array( 'mw-enhanced-rc' );
1170 if( $logType ) {
1171 # Log entry
1172 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
1173 . $logType . '-' . $rcObj->mAttribs['rc_title'] );
1174 } else {
1175 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns' .
1176 $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] );
1177 }
1178 $classes[] = $rcObj->watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
1179 $r = Html::openElement( 'table', array( 'class' => $classes ) ) .
1180 Html::openElement( 'tr' );
1181
1182 $r .= '<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow mw-enhancedchanges-arrow-space"></span>';
1183 # Flag and Timestamp
1184 if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
1185 $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
1186 } else {
1187 $r .= $this->recentChangesFlags( array(
1188 'newpage' => $type == RC_NEW,
1189 'minor' => $rcObj->mAttribs['rc_minor'],
1190 'unpatrolled' => $rcObj->unpatrolled,
1191 'bot' => $rcObj->mAttribs['rc_bot'],
1192 ) );
1193 }
1194 $r .= '&#160;'.$rcObj->timestamp.'&#160;</td><td>';
1195 # Article or log link
1196 if( $logType ) {
1197 $logPage = new LogPage( $logType );
1198 $logTitle = SpecialPage::getTitleFor( 'Log', $logType );
1199 $logName = $logPage->getName()->escaped();
1200 $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logTitle, $logName ) )->escaped();
1201 } else {
1202 $this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched );
1203 }
1204 # Diff and hist links
1205 if ( $type != RC_LOG ) {
1206 $query['action'] = 'history';
1207 $r .= ' ' . $this->msg( 'parentheses' )->rawParams( $rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown(
1208 $rcObj->getTitle(),
1209 $this->message['hist'],
1210 array(),
1211 $query
1212 ) )->escaped();
1213 }
1214 $r .= ' <span class="mw-changeslist-separator">. .</span> ';
1215 # Character diff
1216 if ( $wgRCShowChangedSize ) {
1217 $cd = $this->formatCharacterDifference( $rcObj );
1218 if ( $cd !== '' ) {
1219 $r .= $cd . ' <span class="mw-changeslist-separator">. .</span> ';
1220 }
1221 }
1222
1223 if ( $type == RC_LOG ) {
1224 $r .= $this->insertLogEntry( $rcObj );
1225 } else {
1226 $r .= ' '.$rcObj->userlink . $rcObj->usertalklink;
1227 $r .= $this->insertComment( $rcObj );
1228 $this->insertRollback( $r, $rcObj );
1229 }
1230
1231 # Tags
1232 $this->insertTags( $r, $rcObj, $classes );
1233 # Show how many people are watching this if enabled
1234 $r .= $this->numberofWatchingusers($rcObj->numberofWatchingusers);
1235
1236 $r .= "</td></tr></table>\n";
1237
1238 wfProfileOut( __METHOD__ );
1239
1240 return $r;
1241 }
1242
1243 /**
1244 * If enhanced RC is in use, this function takes the previously cached
1245 * RC lines, arranges them, and outputs the HTML
1246 *
1247 * @return string
1248 */
1249 protected function recentChangesBlock() {
1250 if( count ( $this->rc_cache ) == 0 ) {
1251 return '';
1252 }
1253
1254 wfProfileIn( __METHOD__ );
1255
1256 $blockOut = '';
1257 foreach( $this->rc_cache as $block ) {
1258 if( count( $block ) < 2 ) {
1259 $blockOut .= $this->recentChangesBlockLine( array_shift( $block ) );
1260 } else {
1261 $blockOut .= $this->recentChangesBlockGroup( $block );
1262 }
1263 }
1264
1265 wfProfileOut( __METHOD__ );
1266
1267 return '<div>'.$blockOut.'</div>';
1268 }
1269
1270 /**
1271 * Returns text for the end of RC
1272 * If enhanced RC is in use, returns pretty much all the text
1273 * @return string
1274 */
1275 public function endRecentChangesList() {
1276 return $this->recentChangesBlock() . parent::endRecentChangesList();
1277 }
1278
1279 }