$this->opts['namespace'] = '';
}
+ $this->opts['nsInvert'] = (bool) $request->getVal( 'nsInvert' );
+
$this->opts['tagfilter'] = (string) $request->getVal( 'tagfilter' );
// Allows reverts to have the bot flag in recent changes. It is just here to
'month' => $this->opts['month'],
'deletedOnly' => $this->opts['deletedOnly'],
'topOnly' => $this->opts['topOnly'],
+ 'nsInvert' => $this->opts['nsInvert'],
) );
if( !$pager->getNumRows() ) {
$out->addWikiMsg( 'nocontribs', $target );
$this->opts['namespace'] = '';
}
+ if( !isset( $this->opts['nsInvert'] ) ) {
+ $this->opts['nsInvert'] = '';
+ }
+
if( !isset( $this->opts['contribs'] ) ) {
$this->opts['contribs'] = 'user';
}
$f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) );
# Add hidden params for tracking except for parameters in $skipParameters
- $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' );
+ $skipParameters = array( 'namespace', 'nsInvert', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' );
foreach ( $this->opts as $name => $value ) {
if( in_array( $name, $skipParameters ) ) {
continue;
Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
Xml::namespaceSelector( $this->opts['namespace'], '' )
) .
+ Xml::checkLabel( wfMsg('invert'), 'nsInvert', 'nsInvert', $this->opts['nsInvert'] ) . ' ' .
Xml::checkLabel( wfMsg( 'history-show-deleted' ),
'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . '<br />' .
Xml::tags( 'p', null, Xml::checkLabel( wfMsg( 'sp-contributions-toponly' ),
$this->contribs = isset( $options['contribs'] ) ? $options['contribs'] : 'users';
$this->namespace = isset( $options['namespace'] ) ? $options['namespace'] : '';
$this->tagFilter = isset( $options['tagfilter'] ) ? $options['tagfilter'] : false;
+ $this->nsInvert = isset( $options['nsInvert'] ) ? $options['nsInvert'] : false;
$this->deletedOnly = !empty( $options['deletedOnly'] );
$this->topOnly = !empty( $options['topOnly'] );
$user = $this->getUser();
$conds = array_merge( $userCond, $this->getNamespaceCond() );
+
// Paranoia: avoid brute force searches (bug 17342)
if( !$user->isAllowed( 'deletedhistory' ) ) {
$conds[] = $this->mDb->bitAnd('rev_deleted',Revision::DELETED_USER) . ' = 0';
function getNamespaceCond() {
if( $this->namespace !== '' ) {
- return array( 'page_namespace' => (int)$this->namespace );
+ if ( $this->nsInvert ) {
+ return array( 'page_namespace != ' . (int)$this->namespace );
+ } else {
+ return array( 'page_namespace' => (int)$this->namespace );
+ }
} else {
return array();
}