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
21 * @ingroup SpecialPage
25 * Special:Contributions, show user contributions in a paged list
27 * @ingroup SpecialPage
30 class SpecialContributions
extends SpecialPage
{
34 public function __construct() {
35 parent
::__construct( 'Contributions' );
38 public function execute( $par ) {
40 $this->outputHeader();
41 $out = $this->getOutput();
42 $out->addModuleStyles( 'mediawiki.special' );
44 $this->opts
= array();
45 $request = $this->getRequest();
47 if( $par == 'newbies' ) {
49 $this->opts
['contribs'] = 'newbie';
50 } elseif( $par !== null ) {
53 $target = $request->getVal( 'target' );
57 if( $request->getVal( 'contribs' ) == 'newbie' ) {
59 $this->opts
['contribs'] = 'newbie';
61 $this->opts
['contribs'] = 'user';
64 $this->opts
['deletedOnly'] = $request->getBool( 'deletedOnly' );
66 if( !strlen( $target ) ) {
67 $out->addHTML( $this->getForm() );
71 $user = $this->getUser();
73 $this->opts
['limit'] = $request->getInt( 'limit', $user->getOption('rclimit') );
74 $this->opts
['target'] = $target;
75 $this->opts
['topOnly'] = $request->getBool( 'topOnly' );
77 $nt = Title
::makeTitleSafe( NS_USER
, $target );
79 $out->addHTML( $this->getForm() );
82 $id = User
::idFromName( $nt->getText() );
84 if( $this->opts
['contribs'] != 'newbie' ) {
85 $target = $nt->getText();
86 $out->addSubtitle( $this->contributionsSub( $nt, $id ) );
87 $out->setHTMLTitle( $this->msg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ), $target ) ) );
88 $userObj = User
::newFromName( $target, false );
89 if ( is_object( $userObj ) ) {
90 $this->getSkin()->setRelevantUser( $userObj );
93 $out->addSubtitle( $this->msg( 'sp-contributions-newbies-sub') );
94 $out->setHTMLTitle( $this->msg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) );
97 if( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
98 $this->opts
['namespace'] = intval( $ns );
100 $this->opts
['namespace'] = '';
103 $this->opts
['nsInvert'] = (bool) $request->getVal( 'nsInvert' );
105 $this->opts
['tagfilter'] = (string) $request->getVal( 'tagfilter' );
107 // Allows reverts to have the bot flag in recent changes. It is just here to
108 // be passed in the form at the top of the page
109 if( $user->isAllowed( 'markbotedits' ) && $request->getBool( 'bot' ) ) {
110 $this->opts
['bot'] = '1';
113 $skip = $request->getText( 'offset' ) ||
$request->getText( 'dir' ) == 'prev';
114 # Offset overrides year/month selection
116 $this->opts
['year'] = '';
117 $this->opts
['month'] = '';
119 $this->opts
['year'] = $request->getIntOrNull( 'year' );
120 $this->opts
['month'] = $request->getIntOrNull( 'month' );
123 $feedType = $request->getVal( 'feed' );
125 // Maintain some level of backwards compatability
126 // If people request feeds using the old parameters, redirect to API
128 'action' => 'feedcontributions',
129 'feedformat' => $feedType,
132 if ( $this->opts
['topOnly'] ) {
133 $apiParams['toponly'] = true;
135 if ( $this->opts
['deletedOnly'] ) {
136 $apiParams['deletedonly'] = true;
138 if ( $this->opts
['tagfilter'] !== '' ) {
139 $apiParams['tagfilter'] = $this->opts
['tagfilter'];
141 if ( $this->opts
['namespace'] !== '' ) {
142 $apiParams['namespace'] = $this->opts
['namespace'];
144 if ( $this->opts
['year'] !== null ) {
145 $apiParams['year'] = $this->opts
['year'];
147 if ( $this->opts
['month'] !== null ) {
148 $apiParams['month'] = $this->opts
['month'];
151 $url = wfScript( 'api' ) . '?' . wfArrayToCGI( $apiParams );
153 $out->redirect( $url, '301' );
157 // Add RSS/atom links
158 $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $target ) );
160 if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id ) ) ) {
162 $out->addHTML( $this->getForm() );
164 $pager = new ContribsPager( array(
166 'contribs' => $this->opts
['contribs'],
167 'namespace' => $this->opts
['namespace'],
168 'year' => $this->opts
['year'],
169 'month' => $this->opts
['month'],
170 'deletedOnly' => $this->opts
['deletedOnly'],
171 'topOnly' => $this->opts
['topOnly'],
172 'nsInvert' => $this->opts
['nsInvert'],
174 if( !$pager->getNumRows() ) {
175 $out->addWikiMsg( 'nocontribs', $target );
177 # Show a message about slave lag, if applicable
178 $lag = wfGetLB()->safeGetLag( $pager->getDatabase() );
180 $out->showLagWarning( $lag );
183 '<p>' . $pager->getNavigationBar() . '</p>' .
185 '<p>' . $pager->getNavigationBar() . '</p>'
188 $out->preventClickjacking( $pager->getPreventClickjacking() );
190 # Show the appropriate "footer" message - WHOIS tools, etc.
191 if( $this->opts
['contribs'] != 'newbie' ) {
192 $message = 'sp-contributions-footer';
193 if ( IP
::isIPAddress( $target ) ) {
194 $message = 'sp-contributions-footer-anon';
196 $userObj = User
::newFromName( $target );
197 if ( !$userObj ||
$userObj->isAnon() ) {
198 // No message for non-existing users
203 if( !wfMessage( $message, $target )->isDisabled() ) {
205 "<div class='mw-contributions-footer'>\n$1\n</div>",
206 array( $message, $target ) );
213 * Generates the subheading with links
214 * @param $nt Title object for the target
215 * @param $id Integer: User ID for the target
216 * @return String: appropriately-escaped HTML to be output literally
217 * @todo FIXME: Almost the same as getSubTitle in SpecialDeletedContributions.php. Could be combined.
219 protected function contributionsSub( $nt, $id ) {
220 if ( $id === null ) {
221 $user = htmlspecialchars( $nt->getText() );
223 $user = Linker
::link( $nt, htmlspecialchars( $nt->getText() ) );
225 $userObj = User
::newFromName( $nt->getText(), /* check for username validity not needed */ false );
226 $talk = $nt->getTalkPage();
228 $tools = self
::getUserLinks( $nt, $talk, $userObj, $this->getUser() );
229 $links = $this->getLang()->pipeList( $tools );
231 // Show a note if the user is blocked and display the last block log entry.
232 if ( $userObj->isBlocked() ) {
233 $out = $this->getOutput(); // showLogExtract() wants first parameter by reference
234 LogEventsList
::showLogExtract(
241 'showIfEmpty' => false,
244 'sp-contributions-blocked-notice-anon' :
245 'sp-contributions-blocked-notice',
246 $nt->getText() # Support GENDER in 'sp-contributions-blocked-notice'
248 'offset' => '' # don't use WebRequest parameter offset
254 // Old message 'contribsub' had one parameter, but that doesn't work for
255 // languages that want to put the "for" bit right after $user but before
256 // $links. If 'contribsub' is around, use it for reverse compatibility,
257 // otherwise use 'contribsub2'.
258 $oldMsg = $this->msg( 'contribsub' );
259 if ( $oldMsg->exists() ) {
260 return $oldMsg->rawParams( "$user ($links)" );
262 return $this->msg( 'contribsub2' )->rawParams( $user, $links );
267 * Links to different places.
268 * @param $userpage Title: Target user page
269 * @param $talkpage Title: Talk page
270 * @param $target User: Target user object
271 * @param $subject User: The viewing user ($wgUser might be still checked in some cases)
273 public static function getUserLinks( Title
$userpage, Title
$talkpage, User
$target, User
$subject ) {
275 $id = $target->getId();
276 $username = $target->getName();
278 $tools[] = Linker
::link( $talkpage, wfMsgHtml( 'sp-contributions-talk' ) );
280 if( ( $id !== null ) ||
( $id === null && IP
::isIPAddress( $username ) ) ) {
281 if( $subject->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
282 if ( $target->isBlocked() ) {
283 $tools[] = Linker
::linkKnown( # Change block link
284 SpecialPage
::getTitleFor( 'Block', $username ),
285 wfMsgHtml( 'change-blocklink' )
287 $tools[] = Linker
::linkKnown( # Unblock link
288 SpecialPage
::getTitleFor( 'Unblock', $username ),
289 wfMsgHtml( 'unblocklink' )
291 } else { # User is not blocked
292 $tools[] = Linker
::linkKnown( # Block link
293 SpecialPage
::getTitleFor( 'Block', $username ),
294 wfMsgHtml( 'blocklink' )
299 $tools[] = Linker
::linkKnown(
300 SpecialPage
::getTitleFor( 'Log', 'block' ),
301 wfMsgHtml( 'sp-contributions-blocklog' ),
304 'page' => $userpage->getPrefixedText()
309 $tools[] = Linker
::linkKnown(
310 SpecialPage
::getTitleFor( 'Listfiles', $username ),
311 wfMsgHtml( 'sp-contributions-uploads' )
315 $tools[] = Linker
::linkKnown(
316 SpecialPage
::getTitleFor( 'Log', $username ),
317 wfMsgHtml( 'sp-contributions-logs' )
320 # Add link to deleted user contributions for priviledged users
321 if( $subject->isAllowed( 'deletedhistory' ) ) {
322 $tools[] = Linker
::linkKnown(
323 SpecialPage
::getTitleFor( 'DeletedContributions', $username ),
324 wfMsgHtml( 'sp-contributions-deleted' )
328 # Add a link to change user rights for privileged users
329 $userrightsPage = new UserrightsPage();
330 $userrightsPage->getContext()->setUser( $subject );
331 if( $id !== null && $userrightsPage->userCanChangeRights( $target ) ) {
332 $tools[] = Linker
::linkKnown(
333 SpecialPage
::getTitleFor( 'Userrights', $username ),
334 wfMsgHtml( 'sp-contributions-userrights' )
338 wfRunHooks( 'ContributionsToolLinks', array( $id, $userpage, &$tools ) );
343 * Generates the namespace selector form with hidden attributes.
344 * @return String: HTML fragment
346 protected function getForm() {
349 $this->opts
['title'] = $this->getTitle()->getPrefixedText();
350 if( !isset( $this->opts
['target'] ) ) {
351 $this->opts
['target'] = '';
353 $this->opts
['target'] = str_replace( '_' , ' ' , $this->opts
['target'] );
356 if( !isset( $this->opts
['namespace'] ) ) {
357 $this->opts
['namespace'] = '';
360 if( !isset( $this->opts
['nsInvert'] ) ) {
361 $this->opts
['nsInvert'] = '';
364 if( !isset( $this->opts
['contribs'] ) ) {
365 $this->opts
['contribs'] = 'user';
368 if( !isset( $this->opts
['year'] ) ) {
369 $this->opts
['year'] = '';
372 if( !isset( $this->opts
['month'] ) ) {
373 $this->opts
['month'] = '';
376 if( $this->opts
['contribs'] == 'newbie' ) {
377 $this->opts
['target'] = '';
380 if( !isset( $this->opts
['tagfilter'] ) ) {
381 $this->opts
['tagfilter'] = '';
384 if( !isset( $this->opts
['topOnly'] ) ) {
385 $this->opts
['topOnly'] = false;
388 $f = Xml
::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) );
390 # Add hidden params for tracking except for parameters in $skipParameters
391 $skipParameters = array( 'namespace', 'nsInvert', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' );
392 foreach ( $this->opts
as $name => $value ) {
393 if( in_array( $name, $skipParameters ) ) {
396 $f .= "\t" . Html
::hidden( $name, $value ) . "\n";
399 $tagFilter = ChangeTags
::buildTagFilterSelector( $this->opts
['tagfilter'] );
401 $f .= Xml
::fieldset( wfMsg( 'sp-contributions-search' ) ) .
402 Xml
::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ),
403 'contribs', 'newbie' , 'newbie', $this->opts
['contribs'] == 'newbie' ) . '<br />' .
404 Xml
::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
405 'contribs' , 'user', 'user', $this->opts
['contribs'] == 'user' ) . ' ' .
406 Html
::input( 'target', $this->opts
['target'], 'text', array(
409 ) +
( $this->opts
['target'] ?
array() : array( 'autofocus' ) ) ) . ' '.
410 Html
::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
411 Xml
::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
412 Xml
::namespaceSelector( $this->opts
['namespace'], '' )
414 Xml
::checkLabel( wfMsg('invert'), 'nsInvert', 'nsInvert', $this->opts
['nsInvert'] ) . ' ' .
415 Xml
::checkLabel( wfMsg( 'history-show-deleted' ),
416 'deletedOnly', 'mw-show-deleted-only', $this->opts
['deletedOnly'] ) . '<br />' .
417 Xml
::tags( 'p', null, Xml
::checkLabel( wfMsg( 'sp-contributions-toponly' ),
418 'topOnly', 'mw-show-top-only', $this->opts
['topOnly'] ) ) .
419 ( $tagFilter ? Xml
::tags( 'p', null, implode( ' ', $tagFilter ) ) : '' ) .
420 Html
::rawElement( 'p', array( 'style' => 'white-space: nowrap' ),
421 Xml
::dateMenu( $this->opts
['year'], $this->opts
['month'] ) . ' ' .
422 Xml
::submitButton( wfMsg( 'sp-contributions-submit' ) )
424 $explain = wfMessage( 'sp-contributions-explain' );
425 if ( $explain->exists() ) {
426 $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
428 $f .= Xml
::closeElement('fieldset' ) .
429 Xml
::closeElement( 'form' );
435 * Pager for Special:Contributions
436 * @ingroup SpecialPage Pager
438 class ContribsPager
extends ReverseChronologicalPager
{
439 public $mDefaultDirection = true;
440 var $messages, $target;
441 var $namespace = '', $mDb;
442 var $preventClickjacking = false;
444 function __construct( $options ) {
445 parent
::__construct();
447 $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' );
449 foreach( $msgs as $msg ) {
450 $this->messages
[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) );
453 $this->target
= isset( $options['target'] ) ?
$options['target'] : '';
454 $this->contribs
= isset( $options['contribs'] ) ?
$options['contribs'] : 'users';
455 $this->namespace = isset( $options['namespace'] ) ?
$options['namespace'] : '';
456 $this->tagFilter
= isset( $options['tagfilter'] ) ?
$options['tagfilter'] : false;
457 $this->nsInvert
= isset( $options['nsInvert'] ) ?
$options['nsInvert'] : false;
459 $this->deletedOnly
= !empty( $options['deletedOnly'] );
460 $this->topOnly
= !empty( $options['topOnly'] );
462 $year = isset( $options['year'] ) ?
$options['year'] : false;
463 $month = isset( $options['month'] ) ?
$options['month'] : false;
464 $this->getDateCond( $year, $month );
466 $this->mDb
= wfGetDB( DB_SLAVE
, 'contributions' );
469 function getDefaultQuery() {
470 $query = parent
::getDefaultQuery();
471 $query['target'] = $this->target
;
475 function getQueryInfo() {
476 list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
478 $user = $this->getUser();
479 $conds = array_merge( $userCond, $this->getNamespaceCond() );
481 // Paranoia: avoid brute force searches (bug 17342)
482 if( !$user->isAllowed( 'deletedhistory' ) ) {
483 $conds[] = $this->mDb
->bitAnd('rev_deleted',Revision
::DELETED_USER
) . ' = 0';
484 } elseif( !$user->isAllowed( 'suppressrevision' ) ) {
485 $conds[] = $this->mDb
->bitAnd('rev_deleted',Revision
::SUPPRESSED_USER
) .
486 ' != ' . Revision
::SUPPRESSED_USER
;
489 # Don't include orphaned revisions
490 $join_cond['page'] = Revision
::pageJoinCond();
491 # Get the current user name for accounts
492 $join_cond['user'] = Revision
::userJoinCond();
496 'fields' => array_merge(
497 Revision
::selectFields(),
498 Revision
::selectUserFields(),
499 array( 'page_namespace', 'page_title', 'page_is_new',
500 'page_latest', 'page_is_redirect', 'page_len' )
503 'options' => array( 'USE INDEX' => array( 'revision' => $index ) ),
504 'join_conds' => $join_cond
507 ChangeTags
::modifyDisplayQuery(
508 $queryInfo['tables'],
509 $queryInfo['fields'],
511 $queryInfo['join_conds'],
512 $queryInfo['options'],
516 wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
520 function getUserCond() {
521 $condition = array();
522 $join_conds = array();
523 $tables = array( 'revision', 'page', 'user' );
524 if( $this->contribs
== 'newbie' ) {
525 $tables[] = 'user_groups';
526 $max = $this->mDb
->selectField( 'user', 'max(user_id)', false, __METHOD__
);
527 $condition[] = 'rev_user >' . (int)($max - $max / 100);
528 $condition[] = 'ug_group IS NULL';
529 $index = 'user_timestamp';
530 # @todo FIXME: Other groups may have 'bot' rights
531 $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" );
533 if ( IP
::isIPAddress( $this->target
) ) {
534 $condition['rev_user_text'] = $this->target
;
535 $index = 'usertext_timestamp';
537 $condition['rev_user'] = User
::idFromName( $this->target
);
538 $index = 'user_timestamp';
541 if( $this->deletedOnly
) {
542 $condition[] = "rev_deleted != '0'";
544 if( $this->topOnly
) {
545 $condition[] = "rev_id = page_latest";
547 return array( $tables, $index, $condition, $join_conds );
550 function getNamespaceCond() {
551 if( $this->namespace !== '' ) {
552 if ( $this->nsInvert
) {
553 return array( 'page_namespace != ' . (int)$this->namespace );
555 return array( 'page_namespace' => (int)$this->namespace );
562 function getIndexField() {
563 return 'rev_timestamp';
566 function doBatchLookups() {
567 $this->mResult
->rewind();
569 foreach ( $this->mResult
as $row ) {
570 $revIds[] = $row->rev_parent_id
;
572 $this->mParentLens
= $this->getParentLengths( $revIds );
573 $this->mResult
->rewind(); // reset
575 if ( $this->contribs
=== 'newbie' ) { // multiple users
576 # Do a link batch query
577 $this->mResult
->seek( 0 );
578 $batch = new LinkBatch();
579 # Give some pointers to make (last) links
580 foreach ( $this->mResult
as $row ) {
581 $batch->addObj( Title
::makeTitleSafe( NS_USER
, $row->user_name
) );
582 $batch->addObj( Title
::makeTitleSafe( NS_USER_TALK
, $row->user_name
) );
585 $this->mResult
->seek( 0 );
590 * Do a batched query to get the parent revision lengths
592 private function getParentLengths( array $revIds ) {
595 return $revLens; // empty
597 wfProfileIn( __METHOD__
);
598 $res = $this->getDatabase()->select( 'revision',
599 array( 'rev_id', 'rev_len' ),
600 array( 'rev_id' => $revIds ),
602 foreach( $res as $row ) {
603 $revLens[$row->rev_id
] = $row->rev_len
;
605 wfProfileOut( __METHOD__
);
609 function getStartBody() {
613 function getEndBody() {
618 * Generates each row in the contributions list.
620 * Contributions which are marked "top" are currently on top of the history.
621 * For these contributions, a [rollback] link is shown for users with roll-
622 * back privileges. The rollback link restores the most recent version that
623 * was not written by the target user.
625 * @todo This would probably look a lot nicer in a table.
627 function formatRow( $row ) {
628 wfProfileIn( __METHOD__
);
630 $rev = new Revision( $row );
633 $page = Title
::newFromRow( $row );
634 $link = Linker
::link(
636 htmlspecialchars( $page->getPrefixedText() ),
638 $page->isRedirect() ?
array( 'redirect' => 'no' ) : array()
640 # Mark current revisions
642 if( $row->rev_id
== $row->page_latest
) {
643 $topmarktext .= '<span class="mw-uctop">' . $this->messages
['uctop'] . '</span>';
645 if( !$row->page_is_new
&& $page->quickUserCan( 'rollback' )
646 && $page->quickUserCan( 'edit' ) )
648 $this->preventClickjacking();
649 $topmarktext .= ' '.Linker
::generateRollback( $rev );
652 $user = $this->getUser();
653 # Is there a visible previous revision?
654 if( $rev->userCan( Revision
::DELETED_TEXT
, $user ) && $rev->getParentId() !== 0 ) {
655 $difftext = Linker
::linkKnown(
657 $this->messages
['diff'],
661 'oldid' => $row->rev_id
665 $difftext = $this->messages
['diff'];
667 $histlink = Linker
::linkKnown(
669 $this->messages
['hist'],
671 array( 'action' => 'history' )
674 if ( isset( $this->mParentLens
[$row->rev_parent_id
] ) ) {
675 $chardiff = ' . . ' . ChangesList
::showCharacterDifference(
676 $this->mParentLens
[$row->rev_parent_id
], $row->rev_len
) . ' . . ';
681 $comment = $this->getLang()->getDirMark() . Linker
::revComment( $rev, false, true );
682 $date = $this->getLang()->timeanddate( wfTimestamp( TS_MW
, $row->rev_timestamp
), true );
683 if( $rev->userCan( Revision
::DELETED_TEXT
, $user ) ) {
684 $d = Linker
::linkKnown(
686 htmlspecialchars($date),
688 array( 'oldid' => intval( $row->rev_id
) )
691 $d = htmlspecialchars( $date );
693 if( $rev->isDeleted( Revision
::DELETED_TEXT
) ) {
694 $d = '<span class="history-deleted">' . $d . '</span>';
697 # Show user names for /newbies as there may be different users.
698 # Note that we already excluded rows with hidden user names.
699 if( $this->contribs
== 'newbie' ) {
700 $userlink = ' . . ' . Linker
::userLink( $rev->getUser(), $rev->getUserText() );
701 $userlink .= ' ' . wfMsg( 'parentheses',
702 Linker
::userTalkLink( $rev->getUser(), $rev->getUserText() ) ) . ' ';
707 if( $rev->getParentId() === 0 ) {
708 $nflag = ChangesList
::flag( 'newpage' );
713 if( $rev->isMinor() ) {
714 $mflag = ChangesList
::flag( 'minor' );
719 // Don't show useless link to people who cannot hide revisions
720 $canHide = $user->isAllowed( 'deleterevision' );
721 if( $canHide ||
($rev->getVisibility() && $user->isAllowed('deletedhistory')) ) {
722 if( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
723 $del = Linker
::revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
726 'type' => 'revision',
727 'target' => $page->getPrefixedDbkey(),
728 'ids' => $rev->getId()
730 $del = Linker
::revDeleteLink( $query,
731 $rev->isDeleted( Revision
::DELETED_RESTRICTED
), $canHide );
738 $diffHistLinks = '(' . $difftext . $this->messages
['pipe-separator'] . $histlink . ')';
739 $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}";
741 # Denote if username is redacted for this edit
742 if( $rev->isDeleted( Revision
::DELETED_USER
) ) {
743 $ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>";
747 list($tagSummary, $newClasses) = ChangeTags
::formatSummaryRow( $row->ts_tags
, 'contributions' );
748 $classes = array_merge( $classes, $newClasses );
749 $ret .= " $tagSummary";
751 // Let extensions add data
752 wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret, $row ) );
754 $classes = implode( ' ', $classes );
755 $ret = "<li class=\"$classes\">$ret</li>\n";
756 wfProfileOut( __METHOD__
);
761 * Get the Database object in use
763 * @return DatabaseBase
765 public function getDatabase() {
770 * Overwrite Pager function and return a helpful comment
772 function getSqlComment() {
773 if ( $this->namespace ||
$this->deletedOnly
) {
774 return 'contributions page filtered for namespace or RevisionDeleted edits'; // potentially slow, see CR r58153
776 return 'contributions page unfiltered';
780 protected function preventClickjacking() {
781 $this->preventClickjacking
= true;
784 public function getPreventClickjacking() {
785 return $this->preventClickjacking
;