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