* (bug 7691) Show relevant lines from the deletion log when viewing
a non-existent article or re-creating a previously-deleted article
* Added variables 'wgRestrictionEdit' and 'wgRestrictionMove' for JS to header
+* (bug 9898) Allow viewing all namespaces in Special:Newpages
== Bugfixes since 1.10 ==
}
}
+ private function makeNamespaceWhere() {
+ return $this->namespace !== 'all'
+ ? ' AND rc_namespace = ' . intval( $this->namespace )
+ : '';
+ }
+
function getSQL() {
global $wgUser, $wgUseRCPatrol;
$usepatrol = ( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) ? 1 : 0;
$dbr = wfGetDB( DB_SLAVE );
list( $recentchanges, $page ) = $dbr->tableNamesN( 'recentchanges', 'page' );
+ $nsfilter = $this->makeNamespaceWhere();
$uwhere = $this->makeUserWhere( $dbr );
# FIXME: text will break with compression
page_latest as rev_id
FROM $recentchanges,$page
WHERE rc_cur_id=page_id AND rc_new=1
- AND rc_namespace=" . $this->namespace . " AND page_is_redirect=0
+ {$nsfilter}
+ AND page_is_redirect = 0
{$uwhere}";
}
$form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
# Namespace selector
$form .= '<table><tr><td align="right">' . Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '</td>';
- $form .= '<td>' . Xml::namespaceSelector( $this->namespace ) . '</td></tr>';
+ $form .= '<td>' . Xml::namespaceSelector( $this->namespace, 'all' ) . '</td></tr>';
# Username filter
$form .= '<tr><td align="right">' . Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) . '</td>';
$form .= '<td>' . Xml::input( 'username', 30, $this->username, array( 'id' => 'mw-np-username' ) ) . '</td></tr>';
}
}
} else {
- if( $ns = $wgRequest->getInt( 'namespace', 0 ) )
+ if( $ns = $wgRequest->getText( 'namespace', NS_MAIN ) )
$namespace = $ns;
if( $un = $wgRequest->getText( 'username' ) )
$username = $un;
*/
public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {
global $wgContLang;
- if( $selected !== '' ) {
- if( is_null( $selected ) ) {
- // No namespace selected; let exact match work without hitting Main
- $selected = '';
- } else {
- // Let input be numeric strings without breaking the empty match.
- $selected = intval( $selected );
- }
- }
+ if( is_null( $selected ) )
+ $selected = '';
$s = "\n<select id='namespace' name='namespace' class='namespaceselector'>\n";
$arr = $wgContLang->getFormattedNamespaces();
if( !is_null($allnamespaces) ) {