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