$this->opts['namespace'] = '';
}
+ $this->opts['deletedOnly'] = ( $wgRequest->getVal( 'deletedOnly' ) == '1' );
+
$this->opts['tagfilter'] = (string) $wgRequest->getVal( 'tagfilter' );
// Allows reverts to have the bot flag in recent changes. It is just here to
$wgOut->addHTML( $this->getForm() );
- $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], $this->opts['month'] );
+ $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'],
+ $this->opts['month'], false, $this->opts['deletedOnly'] );
if( !$pager->getNumRows() ) {
$wgOut->addWikiMsg( 'nocontribs', $target );
} else {
}
$f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
- # Add hidden params for tracking
+
+ # Add hidden params for tracking except for parameters in $skipParameters
+ $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month' );
foreach ( $this->opts as $name => $value ) {
- if( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month' ) ) ) {
+ if( in_array( $name, $skipParameters ) ) {
continue;
}
$f .= "\t" . Xml::hidden( $name, $value ) . "\n";
Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
Xml::namespaceSelector( $this->opts['namespace'], '' ) .
'</span>' .
+ Xml::checkLabel( wfMsg( 'history-show-deleted' ),
+ 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) .
( $tagFilter ? Xml::tags( 'p', null, implode( ' ', $tagFilter ) ) : '' ) .
Xml::openElement( 'p' ) .
'<span style="white-space: nowrap">' .
$target = $this->opts['target'] == 'newbies' ? 'newbies' : $nt->getText();
$pager = new ContribsPager( $target, $this->opts['namespace'],
- $this->opts['year'], $this->opts['month'], $this->opts['tagfilter'] );
+ $this->opts['year'], $this->opts['month'], $this->opts['tagfilter'], $this->opts['deletedOnly'] );
$pager->mLimit = min( $this->opts['limit'], $wgFeedLimit );
var $messages, $target;
var $namespace = '', $mDb;
- function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false ) {
+ function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false, $deletedOnly = false ) {
parent::__construct();
$msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' );
$this->target = $target;
$this->namespace = $namespace;
$this->tagFilter = $tagFilter;
+ $this->deletedOnly = $deletedOnly;
$this->getDateCond( $year, $month );
$condition['rev_user_text'] = $this->target;
$index = 'usertext_timestamp';
}
+ if ( $this->deletedOnly ) {
+ $condition[] = "rev_deleted != '0'";
+ }
return array( $tables, $index, $condition, $join_conds );
}
return $this->mDb;
}
+ /**
+ * Overwrite Pager function and return a helpful comment
+ */
+ function getSqlComment() {
+ if ( $this->namespace || $this->deletedOnly ) {
+ return 'contributions page filtered for namespace or RevisionDeleted edits'; // potentially slow, see CR r58153
+ } else {
+ return 'contributions page unfiltered';
+ }
+ }
+
}