Separate RequestContext.php into separate files inside of context/
[mediawiki.git] / includes / specials / SpecialContributions.php
blob38180606beb749dc76ff67d8eb3c34fef70ac36f
1 <?php
2 /**
3 * Implements Special:Contributions
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @file
21 * @ingroup SpecialPage
24 /**
25 * Special:Contributions, show user contributions in a paged list
27 * @ingroup SpecialPage
30 class SpecialContributions extends SpecialPage {
32 protected $opts;
34 public function __construct() {
35 parent::__construct( 'Contributions' );
38 public function execute( $par ) {
39 global $wgUser, $wgOut, $wgRequest;
41 $this->setHeaders();
42 $this->outputHeader();
43 $wgOut->addModuleStyles( 'mediawiki.special' );
45 $this->opts = array();
47 if( $par == 'newbies' ) {
48 $target = 'newbies';
49 $this->opts['contribs'] = 'newbie';
50 } elseif( isset( $par ) ) {
51 $target = $par;
52 } else {
53 $target = $wgRequest->getVal( 'target' );
56 // check for radiobox
57 if( $wgRequest->getVal( 'contribs' ) == 'newbie' ) {
58 $target = 'newbies';
59 $this->opts['contribs'] = 'newbie';
62 $this->opts['deletedOnly'] = $wgRequest->getBool( 'deletedOnly' );
64 if( !strlen( $target ) ) {
65 $wgOut->addHTML( $this->getForm() );
66 return;
69 $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') );
70 $this->opts['target'] = $target;
71 $this->opts['topOnly'] = $wgRequest->getBool( 'topOnly' );
73 $nt = Title::makeTitleSafe( NS_USER, $target );
74 if( !$nt ) {
75 $wgOut->addHTML( $this->getForm() );
76 return;
78 $id = User::idFromName( $nt->getText() );
80 if( $target != 'newbies' ) {
81 $target = $nt->getText();
82 $wgOut->setSubtitle( $this->contributionsSub( $nt, $id ) );
83 $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) );
84 $user = User::newFromName( $target, false );
85 if ( is_object( $user ) ) {
86 $this->getSkin()->setRelevantUser( $user );
88 } else {
89 $wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
90 $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) );
93 if( ( $ns = $wgRequest->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
94 $this->opts['namespace'] = intval( $ns );
95 } else {
96 $this->opts['namespace'] = '';
99 $this->opts['tagFilter'] = (string) $wgRequest->getVal( 'tagFilter' );
101 // Allows reverts to have the bot flag in recent changes. It is just here to
102 // be passed in the form at the top of the page
103 if( $wgUser->isAllowed( 'markbotedits' ) && $wgRequest->getBool( 'bot' ) ) {
104 $this->opts['bot'] = '1';
107 $skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev';
108 # Offset overrides year/month selection
109 if( $skip ) {
110 $this->opts['year'] = '';
111 $this->opts['month'] = '';
112 } else {
113 $this->opts['year'] = $wgRequest->getIntOrNull( 'year' );
114 $this->opts['month'] = $wgRequest->getIntOrNull( 'month' );
117 $feedType = $wgRequest->getVal( 'feed' );
118 if( $feedType ) {
119 // Maintain some level of backwards compatability
120 // If people request feeds using the old parameters, redirect to API
121 $apiParams = array(
122 'action' => 'feedcontributions',
123 'feedformat' => $feedType,
124 'user' => $target,
126 if ( $this->opts['topOnly'] ) {
127 $apiParams['toponly'] = true;
129 if ( $this->opts['deletedOnly'] ) {
130 $apiParams['deletedonly'] = true;
132 if ( $this->opts['tagFilter'] !== '' ) {
133 $apiParams['tagfilter'] = $this->opts['tagFilter'];
135 if ( $this->opts['namespace'] !== '' ) {
136 $apiParams['namespace'] = $this->opts['namespace'];
138 if ( $this->opts['year'] !== null ) {
139 $apiParams['year'] = $this->opts['year'];
141 if ( $this->opts['month'] !== null ) {
142 $apiParams['month'] = $this->opts['month'];
145 $url = wfScript( 'api' ) . '?' . wfArrayToCGI( $apiParams );
147 $wgOut->redirect( $url, '301' );
148 return;
151 // Add RSS/atom links
152 $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $target ) );
154 if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id ) ) ) {
156 $wgOut->addHTML( $this->getForm() );
158 $pager = new ContribsPager( array(
159 'target' => $target,
160 'namespace' => $this->opts['namespace'],
161 'year' => $this->opts['year'],
162 'month' => $this->opts['month'],
163 'deletedOnly' => $this->opts['deletedOnly'],
164 'topOnly' => $this->opts['topOnly'],
165 ) );
166 if( !$pager->getNumRows() ) {
167 $wgOut->addWikiMsg( 'nocontribs', $target );
168 } else {
169 # Show a message about slave lag, if applicable
170 $lag = wfGetLB()->safeGetLag( $pager->getDatabase() );
171 if( $lag > 0 )
172 $wgOut->showLagWarning( $lag );
174 $wgOut->addHTML(
175 '<p>' . $pager->getNavigationBar() . '</p>' .
176 $pager->getBody() .
177 '<p>' . $pager->getNavigationBar() . '</p>'
180 $wgOut->preventClickjacking( $pager->getPreventClickjacking() );
182 # Show the appropriate "footer" message - WHOIS tools, etc.
183 if( $target != 'newbies' ) {
184 $message = 'sp-contributions-footer';
185 if ( IP::isIPAddress( $target ) ) {
186 $message = 'sp-contributions-footer-anon';
187 } else {
188 $user = User::newFromName( $target );
189 if ( !$user || $user->isAnon() ) {
190 // No message for non-existing users
191 return;
195 if( !wfMessage( $message, $target )->isDisabled() ) {
196 $wgOut->wrapWikiMsg(
197 "<div class='mw-contributions-footer'>\n$1\n</div>",
198 array( $message, $target ) );
205 * Generates the subheading with links
206 * @param $nt Title object for the target
207 * @param $id Integer: User ID for the target
208 * @return String: appropriately-escaped HTML to be output literally
209 * @todo FIXME: Almost the same as getSubTitle in SpecialDeletedContributions.php. Could be combined.
211 protected function contributionsSub( $nt, $id ) {
212 global $wgLang, $wgUser, $wgOut;
214 $sk = $this->getSkin();
216 if ( $id === null ) {
217 $user = htmlspecialchars( $nt->getText() );
218 } else {
219 $user = $sk->link( $nt, htmlspecialchars( $nt->getText() ) );
221 $userObj = User::newFromName( $nt->getText(), /* check for username validity not needed */ false );
222 $talk = $nt->getTalkPage();
223 if( $talk ) {
224 $tools = self::getUserLinks( $nt, $talk, $userObj, $wgUser );
225 $links = $wgLang->pipeList( $tools );
227 // Show a note if the user is blocked and display the last block log entry.
228 if ( $userObj->isBlocked() ) {
229 LogEventsList::showLogExtract(
230 $wgOut,
231 'block',
232 $nt->getPrefixedText(),
234 array(
235 'lim' => 1,
236 'showIfEmpty' => false,
237 'msgKey' => array(
238 $userObj->isAnon() ?
239 'sp-contributions-blocked-notice-anon' :
240 'sp-contributions-blocked-notice',
241 $nt->getText() # Support GENDER in 'sp-contributions-blocked-notice'
243 'offset' => '' # don't use $wgRequest parameter offset
249 // Old message 'contribsub' had one parameter, but that doesn't work for
250 // languages that want to put the "for" bit right after $user but before
251 // $links. If 'contribsub' is around, use it for reverse compatibility,
252 // otherwise use 'contribsub2'.
253 if( wfEmptyMsg( 'contribsub' ) ) {
254 return wfMsgHtml( 'contribsub2', $user, $links );
255 } else {
256 return wfMsgHtml( 'contribsub', "$user ($links)" );
261 * Links to different places.
262 * @param $userpage Title: Target user page
263 * @param $talkpage Title: Talk page
264 * @param $target User: Target user object
265 * @param $subject User: The viewing user ($wgUser is still checked in some cases, like userrights page!!)
267 public static function getUserLinks( Title $userpage, Title $talkpage, User $target, User $subject ) {
269 $sk = $subject->getSkin();
270 $id = $target->getId();
271 $username = $target->getName();
273 $tools[] = $sk->link( $talkpage, wfMsgHtml( 'sp-contributions-talk' ) );
275 if( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) {
276 if( $subject->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
277 if ( $target->isBlocked() ) {
278 $tools[] = $sk->linkKnown( # Change block link
279 SpecialPage::getTitleFor( 'Block', $username ),
280 wfMsgHtml( 'change-blocklink' )
282 $tools[] = $sk->linkKnown( # Unblock link
283 SpecialPage::getTitleFor( 'Unblock', $username ),
284 wfMsgHtml( 'unblocklink' )
286 } else { # User is not blocked
287 $tools[] = $sk->linkKnown( # Block link
288 SpecialPage::getTitleFor( 'Block', $username ),
289 wfMsgHtml( 'blocklink' )
293 # Block log link
294 $tools[] = $sk->linkKnown(
295 SpecialPage::getTitleFor( 'Log', 'block' ),
296 wfMsgHtml( 'sp-contributions-blocklog' ),
297 array(),
298 array(
299 'page' => $userpage->getPrefixedText()
303 # Uploads
304 $tools[] = $sk->linkKnown(
305 SpecialPage::getTitleFor( 'Listfiles', $username ),
306 wfMsgHtml( 'sp-contributions-uploads' )
309 # Other logs link
310 $tools[] = $sk->linkKnown(
311 SpecialPage::getTitleFor( 'Log', $username ),
312 wfMsgHtml( 'sp-contributions-logs' )
315 # Add link to deleted user contributions for priviledged users
316 if( $subject->isAllowed( 'deletedhistory' ) && !$subject->isBlocked() ) {
317 $tools[] = $sk->linkKnown(
318 SpecialPage::getTitleFor( 'DeletedContributions', $username ),
319 wfMsgHtml( 'sp-contributions-deleted' )
323 # Add a link to change user rights for privileged users
324 $userrightsPage = new UserrightsPage();
325 if( $id !== null && $userrightsPage->userCanChangeRights( $target ) ) {
326 $tools[] = $sk->linkKnown(
327 SpecialPage::getTitleFor( 'Userrights', $username ),
328 wfMsgHtml( 'sp-contributions-userrights' )
332 wfRunHooks( 'ContributionsToolLinks', array( $id, $userpage, &$tools ) );
333 return $tools;
337 * Generates the namespace selector form with hidden attributes.
338 * @return String: HTML fragment
340 protected function getForm() {
341 global $wgScript, $wgMiserMode;
343 $this->opts['title'] = $this->getTitle()->getPrefixedText();
344 if( !isset( $this->opts['target'] ) ) {
345 $this->opts['target'] = '';
346 } else {
347 $this->opts['target'] = str_replace( '_' , ' ' , $this->opts['target'] );
350 if( !isset( $this->opts['namespace'] ) ) {
351 $this->opts['namespace'] = '';
354 if( !isset( $this->opts['contribs'] ) ) {
355 $this->opts['contribs'] = 'user';
358 if( !isset( $this->opts['year'] ) ) {
359 $this->opts['year'] = '';
362 if( !isset( $this->opts['month'] ) ) {
363 $this->opts['month'] = '';
366 if( $this->opts['contribs'] == 'newbie' ) {
367 $this->opts['target'] = '';
370 if( !isset( $this->opts['tagFilter'] ) ) {
371 $this->opts['tagFilter'] = '';
374 if( !isset( $this->opts['topOnly'] ) ) {
375 $this->opts['topOnly'] = false;
378 $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) );
380 # Add hidden params for tracking except for parameters in $skipParameters
381 $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' );
382 foreach ( $this->opts as $name => $value ) {
383 if( in_array( $name, $skipParameters ) ) {
384 continue;
386 $f .= "\t" . Html::hidden( $name, $value ) . "\n";
389 $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagFilter'] );
391 $fNS = ( $wgMiserMode ) ? '' :
392 Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
393 Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
394 Xml::namespaceSelector( $this->opts['namespace'], '' )
397 $f .= Xml::fieldset( wfMsg( 'sp-contributions-search' ) ) .
398 Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ),
399 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ) . '<br />' .
400 Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
401 'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ) . ' ' .
402 Html::input( 'target', $this->opts['target'], 'text', array(
403 'size' => '20',
404 'required' => ''
405 ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
406 $fNS.
407 Xml::checkLabel( wfMsg( 'history-show-deleted' ),
408 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . '<br />' .
409 Xml::tags( 'p', null, Xml::checkLabel( wfMsg( 'sp-contributions-toponly' ),
410 'topOnly', 'mw-show-top-only', $this->opts['topOnly'] ) ) .
411 ( $tagFilter ? Xml::tags( 'p', null, implode( '&#160;', $tagFilter ) ) : '' ) .
412 Html::rawElement( 'p', array( 'style' => 'white-space: nowrap' ),
413 Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' .
414 Xml::submitButton( wfMsg( 'sp-contributions-submit' ) )
415 ) . ' ';
416 $explain = wfMessage( 'sp-contributions-explain' );
417 if ( $explain->exists() ) {
418 $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
420 $f .= Xml::closeElement('fieldset' ) .
421 Xml::closeElement( 'form' );
422 return $f;
427 * Pager for Special:Contributions
428 * @ingroup SpecialPage Pager
430 class ContribsPager extends ReverseChronologicalPager {
431 public $mDefaultDirection = true;
432 var $messages, $target;
433 var $namespace = '', $mDb;
434 var $preventClickjacking = false;
436 function __construct( $options ) {
437 parent::__construct();
439 $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' );
441 foreach( $msgs as $msg ) {
442 $this->messages[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) );
445 $this->target = isset( $options['target'] ) ? $options['target'] : '';
446 $this->namespace = isset( $options['namespace'] ) ? $options['namespace'] : '';
447 $this->tagFilter = isset( $options['tagFilter'] ) ? $options['tagFilter'] : false;
449 $this->deletedOnly = !empty( $options['deletedOnly'] );
450 $this->topOnly = !empty( $options['topOnly'] );
452 $year = isset( $options['year'] ) ? $options['year'] : false;
453 $month = isset( $options['month'] ) ? $options['month'] : false;
454 $this->getDateCond( $year, $month );
456 $this->mDb = wfGetDB( DB_SLAVE, 'contributions' );
459 function getDefaultQuery() {
460 $query = parent::getDefaultQuery();
461 $query['target'] = $this->target;
462 return $query;
465 function getTitle() {
466 return SpecialPage::getTitleFor( 'Contributions' );
469 function getQueryInfo() {
470 global $wgUser;
471 list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
473 $conds = array_merge( $userCond, $this->getNamespaceCond() );
474 // Paranoia: avoid brute force searches (bug 17342)
475 if( !$wgUser->isAllowed( 'deletedhistory' ) || $wgUser->isBlocked() ) {
476 $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::DELETED_USER) . ' = 0';
477 } elseif( !$wgUser->isAllowed( 'suppressrevision' ) ) {
478 $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::SUPPRESSED_USER) .
479 ' != ' . Revision::SUPPRESSED_USER;
481 $join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' );
483 $queryInfo = array(
484 'tables' => $tables,
485 'fields' => array(
486 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect',
487 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment',
488 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted'
490 'conds' => $conds,
491 'options' => array( 'USE INDEX' => array('revision' => $index) ),
492 'join_conds' => $join_cond
495 ChangeTags::modifyDisplayQuery(
496 $queryInfo['tables'],
497 $queryInfo['fields'],
498 $queryInfo['conds'],
499 $queryInfo['join_conds'],
500 $queryInfo['options'],
501 $this->tagFilter
504 wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
505 return $queryInfo;
508 function getUserCond() {
509 $condition = array();
510 $join_conds = array();
511 if( $this->target == 'newbies' ) {
512 $tables = array( 'user_groups', 'page', 'revision' );
513 $max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ );
514 $condition[] = 'rev_user >' . (int)($max - $max / 100);
515 $condition[] = 'ug_group IS NULL';
516 $index = 'user_timestamp';
517 # @todo FIXME: Other groups may have 'bot' rights
518 $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" );
519 } else {
520 $tables = array( 'page', 'revision' );
521 $condition['rev_user_text'] = $this->target;
522 $index = 'usertext_timestamp';
524 if( $this->deletedOnly ) {
525 $condition[] = "rev_deleted != '0'";
527 if( $this->topOnly ) {
528 $condition[] = "rev_id = page_latest";
530 return array( $tables, $index, $condition, $join_conds );
533 function getNamespaceCond() {
534 global $wgMiserMode;
535 if( $this->namespace !== '' && !$wgMiserMode ) {
536 return array( 'page_namespace' => (int)$this->namespace );
537 } else {
538 return array();
542 function getIndexField() {
543 return 'rev_timestamp';
546 function getStartBody() {
547 return "<ul>\n";
550 function getEndBody() {
551 return "</ul>\n";
555 * Generates each row in the contributions list.
557 * Contributions which are marked "top" are currently on top of the history.
558 * For these contributions, a [rollback] link is shown for users with roll-
559 * back privileges. The rollback link restores the most recent version that
560 * was not written by the target user.
562 * @todo This would probably look a lot nicer in a table.
564 function formatRow( $row ) {
565 global $wgUser, $wgLang;
566 wfProfileIn( __METHOD__ );
568 $sk = $this->getSkin();
569 $rev = new Revision( $row );
570 $classes = array();
572 $page = Title::newFromRow( $row );
573 $link = $sk->link(
574 $page,
575 htmlspecialchars( $page->getPrefixedText() ),
576 array(),
577 $page->isRedirect() ? array( 'redirect' => 'no' ) : array()
579 # Mark current revisions
580 $topmarktext = '';
581 if( $row->rev_id == $row->page_latest ) {
582 $topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
583 # Add rollback link
584 if( !$row->page_is_new && $page->quickUserCan( 'rollback' )
585 && $page->quickUserCan( 'edit' ) )
587 $this->preventClickjacking();
588 $topmarktext .= ' '.$sk->generateRollback( $rev );
591 # Is there a visible previous revision?
592 if( $rev->userCan( Revision::DELETED_TEXT ) && $rev->getParentId() !== 0 ) {
593 $difftext = $sk->linkKnown(
594 $page,
595 $this->messages['diff'],
596 array(),
597 array(
598 'diff' => 'prev',
599 'oldid' => $row->rev_id
602 } else {
603 $difftext = $this->messages['diff'];
605 $histlink = $sk->linkKnown(
606 $page,
607 $this->messages['hist'],
608 array(),
609 array( 'action' => 'history' )
612 $comment = $wgLang->getDirMark() . $sk->revComment( $rev, false, true );
613 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
614 if( $rev->userCan( Revision::DELETED_TEXT ) ) {
615 $d = $sk->linkKnown(
616 $page,
617 htmlspecialchars($date),
618 array(),
619 array( 'oldid' => intval( $row->rev_id ) )
621 } else {
622 $d = htmlspecialchars( $date );
624 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
625 $d = '<span class="history-deleted">' . $d . '</span>';
628 if( $this->target == 'newbies' ) {
629 $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
630 $userlink .= ' ' . wfMsg( 'parentheses', $sk->userTalkLink( $row->rev_user, $row->rev_user_text ) ) . ' ';
631 } else {
632 $userlink = '';
635 if( $rev->getParentId() === 0 ) {
636 $nflag = ChangesList::flag( 'newpage' );
637 } else {
638 $nflag = '';
641 if( $rev->isMinor() ) {
642 $mflag = ChangesList::flag( 'minor' );
643 } else {
644 $mflag = '';
647 // Don't show useless link to people who cannot hide revisions
648 $canHide = $wgUser->isAllowed( 'deleterevision' );
649 if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) {
650 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
651 $del = $this->mSkin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
652 } else {
653 $query = array(
654 'type' => 'revision',
655 'target' => $page->getPrefixedDbkey(),
656 'ids' => $rev->getId()
658 $del = $this->mSkin->revDeleteLink( $query,
659 $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide );
661 $del .= ' ';
662 } else {
663 $del = '';
666 $diffHistLinks = '(' . $difftext . $this->messages['pipe-separator'] . $histlink . ')';
667 $ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}";
669 # Denote if username is redacted for this edit
670 if( $rev->isDeleted( Revision::DELETED_USER ) ) {
671 $ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>";
674 # Tags, if any.
675 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'contributions' );
676 $classes = array_merge( $classes, $newClasses );
677 $ret .= " $tagSummary";
679 // Let extensions add data
680 wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret, $row ) );
682 $classes = implode( ' ', $classes );
683 $ret = "<li class=\"$classes\">$ret</li>\n";
684 wfProfileOut( __METHOD__ );
685 return $ret;
689 * Get the Database object in use
691 * @return DatabaseBase
693 public function getDatabase() {
694 return $this->mDb;
698 * Overwrite Pager function and return a helpful comment
700 function getSqlComment() {
701 if ( $this->namespace || $this->deletedOnly ) {
702 return 'contributions page filtered for namespace or RevisionDeleted edits'; // potentially slow, see CR r58153
703 } else {
704 return 'contributions page unfiltered';
708 protected function preventClickjacking() {
709 $this->preventClickjacking = true;
712 public function getPreventClickjacking() {
713 return $this->preventClickjacking;