Sync contributionsSub from SpecialContributions.php and getSubTitle in SpecialDeleted...
[lhc/web/wiklou.git] / includes / specials / SpecialContributions.php
1 <?php
2 /**
3 * Special:Contributions, show user contributions in a paged list
4 * @file
5 * @ingroup SpecialPage
6 */
7
8 class SpecialContributions extends SpecialPage {
9
10 public function __construct() {
11 parent::__construct( 'Contributions' );
12 }
13
14 public function execute( $par ) {
15 global $wgUser, $wgOut, $wgLang, $wgRequest;
16
17 $this->setHeaders();
18 $this->outputHeader();
19
20 $this->opts = array();
21
22 if( $par == 'newbies' ) {
23 $target = 'newbies';
24 $this->opts['contribs'] = 'newbie';
25 } elseif( isset( $par ) ) {
26 $target = $par;
27 } else {
28 $target = $wgRequest->getVal( 'target' );
29 }
30
31 // check for radiobox
32 if( $wgRequest->getVal( 'contribs' ) == 'newbie' ) {
33 $target = 'newbies';
34 $this->opts['contribs'] = 'newbie';
35 }
36
37 if( !strlen( $target ) ) {
38 $wgOut->addHTML( $this->getForm() );
39 return;
40 }
41
42 $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') );
43 $this->opts['target'] = $target;
44
45 $nt = Title::makeTitleSafe( NS_USER, $target );
46 if( !$nt ) {
47 $wgOut->addHTML( $this->getForm() );
48 return;
49 }
50 $id = User::idFromName( $nt->getText() );
51
52 if( $target != 'newbies' ) {
53 $target = $nt->getText();
54 $wgOut->setSubtitle( $this->contributionsSub( $nt, $id ) );
55 $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) );
56 } else {
57 $wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
58 $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) );
59 }
60
61 if( ( $ns = $wgRequest->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
62 $this->opts['namespace'] = intval( $ns );
63 } else {
64 $this->opts['namespace'] = '';
65 }
66
67 $this->opts['tagfilter'] = (string) $wgRequest->getVal( 'tagfilter' );
68
69 // Allows reverts to have the bot flag in recent changes. It is just here to
70 // be passed in the form at the top of the page
71 if( $wgUser->isAllowed( 'markbotedits' ) && $wgRequest->getBool( 'bot' ) ) {
72 $this->opts['bot'] = '1';
73 }
74
75 $skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev';
76 # Offset overrides year/month selection
77 if( $skip ) {
78 $this->opts['year'] = '';
79 $this->opts['month'] = '';
80 } else {
81 $this->opts['year'] = $wgRequest->getIntOrNull( 'year' );
82 $this->opts['month'] = $wgRequest->getIntOrNull( 'month' );
83 }
84
85 // Add RSS/atom links
86 $this->setSyndicated();
87 $feedType = $wgRequest->getVal( 'feed' );
88 if( $feedType ) {
89 return $this->feed( $feedType );
90 }
91
92 wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id );
93
94 $wgOut->addHTML( $this->getForm() );
95
96 $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], $this->opts['month'] );
97 if( !$pager->getNumRows() ) {
98 $wgOut->addWikiMsg( 'nocontribs', $target );
99 } else {
100 # Show a message about slave lag, if applicable
101 if( ( $lag = $pager->getDatabase()->getLag() ) > 0 )
102 $wgOut->showLagWarning( $lag );
103
104 $wgOut->addHTML(
105 '<p>' . $pager->getNavigationBar() . '</p>' .
106 $pager->getBody() .
107 '<p>' . $pager->getNavigationBar() . '</p>'
108 );
109 }
110
111
112 # Show the appropriate "footer" message - WHOIS tools, etc.
113 if( $target != 'newbies' ) {
114 $message = 'sp-contributions-footer';
115 if ( IP::isIPAddress( $target ) ) {
116 $message = 'sp-contributions-footer-anon';
117 } else {
118 $user = User::newFromName( $target );
119 if ( !$user || $user->isAnon() ) {
120 // No message for non-existing users
121 return;
122 }
123 }
124
125 $text = wfMsgNoTrans( $message, $target );
126 if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {
127 $wgOut->wrapWikiMsg(
128 "<div class='mw-contributions-footer'>\n$1\n</div>",
129 array( $message, $target ) );
130 }
131 }
132 }
133
134 protected function setSyndicated() {
135 global $wgOut;
136 $queryParams = array(
137 'namespace' => $this->opts['namespace'],
138 'target' => $this->opts['target']
139 );
140 $wgOut->setSyndicated( true );
141 $wgOut->setFeedAppendQuery( wfArrayToCGI( $queryParams ) );
142 }
143
144 /**
145 * Generates the subheading with links
146 * @param Title $nt @see Title object for the target
147 * @param integer $id User ID for the target
148 * @return String: appropriately-escaped HTML to be output literally
149 * @fixme Almost the same as getSubTitle in SpecialDeletedContributions.php. Could be combined.
150 */
151 protected function contributionsSub( $nt, $id ) {
152 global $wgSysopUserBans, $wgLang, $wgUser, $wgOut;
153
154 $sk = $wgUser->getSkin();
155
156 if ( 0 == $id ) {
157 $user = htmlspecialchars( $nt->getText() );
158 } else {
159 $user = $sk->link( $nt, htmlspecialchars( $nt->getText() ) );
160 }
161 $userObj = User::newFromName( $nt->getText(), /* check for username validity not needed */ false );
162 $talk = $nt->getTalkPage();
163 if( $talk ) {
164 # Talk page link
165 $tools[] = $sk->link( $talk, wfMsgHtml( 'sp-contributions-talk' ) );
166 if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) {
167 if( $wgUser->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
168 if ( $userObj->isBlocked() ) {
169 $tools[] = $sk->linkKnown( # Change block link
170 SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
171 wfMsgHtml( 'change-blocklink' )
172 );
173 $tools[] = $sk->linkKnown( # Unblock link
174 SpecialPage::getTitleFor( 'BlockList' ),
175 wfMsgHtml( 'unblocklink' ),
176 array(),
177 array(
178 'action' => 'unblock',
179 'ip' => $nt->getDBkey()
180 )
181 );
182 }
183 else { # User is not blocked
184 $tools[] = $sk->linkKnown( # Block link
185 SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
186 wfMsgHtml( 'blocklink' )
187 );
188 }
189 }
190 # Block log link
191 $tools[] = $sk->linkKnown(
192 SpecialPage::getTitleFor( 'Log' ),
193 wfMsgHtml( 'sp-contributions-blocklog' ),
194 array(),
195 array(
196 'type' => 'block',
197 'page' => $nt->getPrefixedText()
198 )
199 );
200 }
201 # Other logs link
202 $tools[] = $sk->linkKnown(
203 SpecialPage::getTitleFor( 'Log' ),
204 wfMsgHtml( 'sp-contributions-logs' ),
205 array(),
206 array( 'user' => $nt->getText() )
207 );
208
209 # Add link to deleted user contributions for priviledged users
210 if( $wgUser->isAllowed( 'deletedhistory' ) ) {
211 $tools[] = $sk->linkKnown(
212 SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ),
213 wfMsgHtml( 'sp-contributions-deleted' )
214 );
215 }
216
217 # Add a link to change user rights for privileged users
218 $userrightsPage = new UserrightsPage();
219 if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
220 $tools[] = $sk->linkKnown(
221 SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
222 wfMsgHtml( 'sp-contributions-userrights' )
223 );
224 }
225
226 wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
227
228 $links = $wgLang->pipeList( $tools );
229
230 // Show a note if the user is blocked and display the last block log entry.
231 if ( $userObj->isBlocked() ) {
232 LogEventsList::showLogExtract(
233 $wgOut,
234 'block',
235 $nt->getPrefixedText(),
236 '',
237 array(
238 'lim' => 1,
239 'showIfEmpty' => false,
240 'msgKey' => array(
241 'sp-contributions-blocked-notice',
242 $nt->getText() # Support GENDER in 'sp-contributions-blocked-notice'
243 ),
244 'offset' => '' # don't use $wgRequest parameter offset
245 )
246 );
247 }
248 }
249
250 // Old message 'contribsub' had one parameter, but that doesn't work for
251 // languages that want to put the "for" bit right after $user but before
252 // $links. If 'contribsub' is around, use it for reverse compatibility,
253 // otherwise use 'contribsub2'.
254 if( wfEmptyMsg( 'contribsub', wfMsg( 'contribsub' ) ) ) {
255 return wfMsgHtml( 'contribsub2', $user, $links );
256 } else {
257 return wfMsgHtml( 'contribsub', "$user ($links)" );
258 }
259 }
260
261 /**
262 * Generates the namespace selector form with hidden attributes.
263 * @param $this->opts Array: the options to be included.
264 */
265 protected function getForm() {
266 global $wgScript;
267
268 $this->opts['title'] = $this->getTitle()->getPrefixedText();
269 if( !isset( $this->opts['target'] ) ) {
270 $this->opts['target'] = '';
271 } else {
272 $this->opts['target'] = str_replace( '_' , ' ' , $this->opts['target'] );
273 }
274
275 if( !isset( $this->opts['namespace'] ) ) {
276 $this->opts['namespace'] = '';
277 }
278
279 if( !isset( $this->opts['contribs'] ) ) {
280 $this->opts['contribs'] = 'user';
281 }
282
283 if( !isset( $this->opts['year'] ) ) {
284 $this->opts['year'] = '';
285 }
286
287 if( !isset( $this->opts['month'] ) ) {
288 $this->opts['month'] = '';
289 }
290
291 if( $this->opts['contribs'] == 'newbie' ) {
292 $this->opts['target'] = '';
293 }
294
295 if( !isset( $this->opts['tagfilter'] ) ) {
296 $this->opts['tagfilter'] = '';
297 }
298
299 $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
300 # Add hidden params for tracking
301 foreach ( $this->opts as $name => $value ) {
302 if( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month' ) ) ) {
303 continue;
304 }
305 $f .= "\t" . Xml::hidden( $name, $value ) . "\n";
306 }
307
308 $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] );
309
310 $f .= '<fieldset>' .
311 Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) .
312 Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ),
313 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '<br />' .
314 Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
315 'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ? true : false ) . ' ' .
316 Html::input( 'target', $this->opts['target'], 'text', array(
317 'size' => '20',
318 'required' => ''
319 ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
320 '<span style="white-space: nowrap">' .
321 Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
322 Xml::namespaceSelector( $this->opts['namespace'], '' ) .
323 '</span>' .
324 ( $tagFilter ? Xml::tags( 'p', null, implode( '&nbsp;', $tagFilter ) ) : '' ) .
325 Xml::openElement( 'p' ) .
326 '<span style="white-space: nowrap">' .
327 Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) .
328 '</span>' . ' ' .
329 Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) .
330 Xml::closeElement( 'p' );
331
332 $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' );
333 if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) )
334 $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
335
336 $f .= '</fieldset>' .
337 Xml::closeElement( 'form' );
338 return $f;
339 }
340
341 /**
342 * Output a subscription feed listing recent edits to this page.
343 * @param string $type
344 */
345 protected function feed( $type ) {
346 global $wgRequest, $wgFeed, $wgFeedClasses, $wgFeedLimit;
347
348 if( !$wgFeed ) {
349 global $wgOut;
350 $wgOut->addWikiMsg( 'feed-unavailable' );
351 return;
352 }
353
354 if( !isset( $wgFeedClasses[$type] ) ) {
355 global $wgOut;
356 $wgOut->addWikiMsg( 'feed-invalid' );
357 return;
358 }
359
360 $feed = new $wgFeedClasses[$type](
361 $this->feedTitle(),
362 wfMsgExt( 'tagline', 'parsemag' ),
363 $this->getTitle()->getFullUrl() . "/" . urlencode($this->opts['target'])
364 );
365
366 // Already valid title
367 $nt = Title::makeTitleSafe( NS_USER, $this->opts['target'] );
368 $target = $this->opts['target'] == 'newbies' ? 'newbies' : $nt->getText();
369
370 $pager = new ContribsPager( $target, $this->opts['namespace'],
371 $this->opts['year'], $this->opts['month'], $this->opts['tagfilter'] );
372
373 $pager->mLimit = min( $this->opts['limit'], $wgFeedLimit );
374
375 $feed->outHeader();
376 if( $pager->getNumRows() > 0 ) {
377 while( $row = $pager->mResult->fetchObject() ) {
378 $feed->outItem( $this->feedItem( $row ) );
379 }
380 }
381 $feed->outFooter();
382 }
383
384 protected function feedTitle() {
385 global $wgContLanguageCode, $wgSitename;
386 $page = SpecialPage::getPage( 'Contributions' );
387 $desc = $page->getDescription();
388 return "$wgSitename - $desc [$wgContLanguageCode]";
389 }
390
391 protected function feedItem( $row ) {
392 $title = Title::MakeTitle( intval( $row->page_namespace ), $row->page_title );
393 if( $title ) {
394 $date = $row->rev_timestamp;
395 $comments = $title->getTalkPage()->getFullURL();
396 $revision = Revision::newFromTitle( $title, $row->rev_id );
397
398 return new FeedItem(
399 $title->getPrefixedText(),
400 $this->feedItemDesc( $revision ),
401 $title->getFullURL(),
402 $date,
403 $this->feedItemAuthor( $revision ),
404 $comments
405 );
406 } else {
407 return NULL;
408 }
409 }
410
411 protected function feedItemAuthor( $revision ) {
412 return $revision->getUserText();
413 }
414
415 protected function feedItemDesc( $revision ) {
416 if( $revision ) {
417 return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) .
418 htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
419 "</p>\n<hr />\n<div>" .
420 nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
421 }
422 return '';
423 }
424 }
425
426 /**
427 * Pager for Special:Contributions
428 * @ingroup SpecialPage Pager
429 */
430 class ContribsPager extends ReverseChronologicalPager {
431 public $mDefaultDirection = true;
432 var $messages, $target;
433 var $namespace = '', $mDb;
434
435 function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false ) {
436 parent::__construct();
437
438 $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' );
439
440 foreach( $msgs as $msg ) {
441 $this->messages[$msg] = wfMsgExt( $msg, array( 'escape' ) );
442 }
443
444 $this->target = $target;
445 $this->namespace = $namespace;
446 $this->tagFilter = $tagFilter;
447
448 $this->getDateCond( $year, $month );
449
450 $this->mDb = wfGetDB( DB_SLAVE, 'contributions' );
451 }
452
453 function getDefaultQuery() {
454 $query = parent::getDefaultQuery();
455 $query['target'] = $this->target;
456 return $query;
457 }
458
459 function getQueryInfo() {
460 global $wgUser;
461 list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
462
463 $conds = array_merge( $userCond, $this->getNamespaceCond() );
464 // Paranoia: avoid brute force searches (bug 17342)
465 if( !$wgUser->isAllowed( 'deletedhistory' ) ) {
466 $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::DELETED_USER) . ' = 0';
467 } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
468 $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::SUPPRESSED_USER) .
469 ' != ' . Revision::SUPPRESSED_USER;
470 }
471 $join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' );
472
473 $queryInfo = array(
474 'tables' => $tables,
475 'fields' => array(
476 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect',
477 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment',
478 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted'
479 ),
480 'conds' => $conds,
481 'options' => array( 'USE INDEX' => array('revision' => $index) ),
482 'join_conds' => $join_cond
483 );
484
485 ChangeTags::modifyDisplayQuery(
486 $queryInfo['tables'],
487 $queryInfo['fields'],
488 $queryInfo['conds'],
489 $queryInfo['join_conds'],
490 $queryInfo['options'],
491 $this->tagFilter
492 );
493
494 wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
495 return $queryInfo;
496 }
497
498 function getUserCond() {
499 $condition = array();
500 $join_conds = array();
501 if( $this->target == 'newbies' ) {
502 $tables = array( 'user_groups', 'page', 'revision' );
503 $max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ );
504 $condition[] = 'rev_user >' . (int)($max - $max / 100);
505 $condition[] = 'ug_group IS NULL';
506 $index = 'user_timestamp';
507 # FIXME: other groups may have 'bot' rights
508 $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" );
509 } else {
510 $tables = array( 'page', 'revision' );
511 $condition['rev_user_text'] = $this->target;
512 $index = 'usertext_timestamp';
513 }
514 return array( $tables, $index, $condition, $join_conds );
515 }
516
517 function getNamespaceCond() {
518 if( $this->namespace !== '' ) {
519 return array( 'page_namespace' => (int)$this->namespace );
520 } else {
521 return array();
522 }
523 }
524
525 function getIndexField() {
526 return 'rev_timestamp';
527 }
528
529 function getStartBody() {
530 return "<ul>\n";
531 }
532
533 function getEndBody() {
534 return "</ul>\n";
535 }
536
537 /**
538 * Generates each row in the contributions list.
539 *
540 * Contributions which are marked "top" are currently on top of the history.
541 * For these contributions, a [rollback] link is shown for users with roll-
542 * back privileges. The rollback link restores the most recent version that
543 * was not written by the target user.
544 *
545 * @todo This would probably look a lot nicer in a table.
546 */
547 function formatRow( $row ) {
548 global $wgUser, $wgLang, $wgContLang;
549 wfProfileIn( __METHOD__ );
550
551 $sk = $this->getSkin();
552 $rev = new Revision( $row );
553 $classes = array();
554
555 $page = Title::newFromRow( $row );
556 $page->resetArticleId( $row->rev_page ); // use process cache
557 $link = $sk->link(
558 $page,
559 htmlspecialchars( $page->getPrefixedText() ),
560 array(),
561 $page->isRedirect() ? array( 'redirect' => 'no' ) : array()
562 );
563 # Mark current revisions
564 $difftext = $topmarktext = '';
565 if( $row->rev_id == $row->page_latest ) {
566 $topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
567 # Add rollback link
568 if( !$row->page_is_new && $page->quickUserCan( 'rollback' ) && $page->quickUserCan( 'edit' ) ) {
569 $topmarktext .= ' '.$sk->generateRollback( $rev );
570 }
571 }
572 # Is there a visible previous revision?
573 if( !$rev->isDeleted( Revision::DELETED_TEXT ) && $rev->getParentId() !== 0 ) {
574 $difftext = $this->messages['pipe-separator'] . $sk->linkKnown(
575 $page,
576 $this->messages['diff'],
577 array(),
578 array(
579 'diff' => 'prev',
580 'oldid' => $row->rev_id
581 )
582 ) . ')';
583 } else {
584 $difftext = $this->messages['pipe-separator'] . $this->messages['diff'] . ')';
585 }
586 $histlink = '('.$sk->linkKnown(
587 $page,
588 $this->messages['hist'],
589 array(),
590 array( 'action' => 'history' )
591 );
592
593 $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
594 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
595 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
596 $d = '<span class="history-deleted">' . $date . '</span>';
597 } else {
598 $d = $sk->linkKnown(
599 $page,
600 htmlspecialchars($date),
601 array(),
602 array( 'oldid' => intval( $row->rev_id ) )
603 );
604 }
605
606 if( $this->target == 'newbies' ) {
607 $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
608 $userlink .= ' ' . wfMsg( 'parentheses', $sk->userTalkLink( $row->rev_user, $row->rev_user_text ) ) . ' ';
609 } else {
610 $userlink = '';
611 }
612
613 if( $rev->getParentId() === 0 ) {
614 $nflag = ChangesList::flag( 'newpage' );
615 } else {
616 $nflag = '';
617 }
618
619 if( $rev->isMinor() ) {
620 $mflag = ChangesList::flag( 'minor' );
621 } else {
622 $mflag = '';
623 }
624
625 // Don't show useless link to people who cannot hide revisions
626 $canHide = $wgUser->isAllowed( 'deleterevision' );
627 if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) {
628 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
629 $del = $this->mSkin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
630 } else {
631 $query = array(
632 'type' => 'revision',
633 'target' => $page->getPrefixedDbkey(),
634 'ids' => $rev->getId()
635 );
636 $del = $this->mSkin->revDeleteLink( $query,
637 $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide );
638 }
639 $del .= ' ';
640 } else {
641 $del = '';
642 }
643
644 $ret = "{$del}{$d} {$histlink}{$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}";
645
646 # Denote if username is redacted for this edit
647 if( $rev->isDeleted( Revision::DELETED_USER ) ) {
648 $ret .= " <strong>" . wfMsgHtml('rev-deleted-user') . "</strong>";
649 }
650
651 # Tags, if any.
652 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'contributions' );
653 $classes = array_merge( $classes, $newClasses );
654 $ret .= " $tagSummary";
655
656 // Let extensions add data
657 wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret, $row ) );
658
659 $classes = implode( ' ', $classes );
660 $ret = "<li class=\"$classes\">$ret</li>\n";
661 wfProfileOut( __METHOD__ );
662 return $ret;
663 }
664
665 /**
666 * Get the Database object in use
667 *
668 * @return Database
669 */
670 public function getDatabase() {
671 return $this->mDb;
672 }
673
674 }