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