$namespace = (int)$ns; // if no namespace given, use 0 (NS_MAIN).
$namespaces = $wgContLang->getNamespaces();
- $out->setPagetitle(
+ $out->setPageTitle(
( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) )
- ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) )
- : wfMsg( 'prefixindex' )
+ ? $this->msg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) )
+ : $this->msg( 'prefixindex' )
);
$showme = '';
$showme = $par;
} elseif( $prefix != '' ) {
$showme = $prefix;
- } elseif( $from != '' ) {
+ } elseif( $from != '' && $ns === null ) {
// For back-compat with Special:Allpages
+ // Don't do this if namespace is passed, so paging works when doing NS views.
$showme = $from;
}
}
}
+ $footer = '';
if ( $this->including() ) {
$out2 = '';
} else {
<td>' .
$nsForm .
'</td>
- <td id="mw-prefixindex-nav-form">';
+ <td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
$query = array(
'prefix' => $prefix
);
- if( $namespace ) {
+ if( $namespace || ($prefix == '')) {
+ // Keep the namespace even if it's 0 for empty prefixes.
+ // This tells us we're not just a holdover from old links.
$query['namespace'] = $namespace;
}
-
- $out2 = $this->getLang()->pipeList( array(
- $out2,
- Linker::linkKnown(
+ $nextLink = Linker::linkKnown(
$self,
wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ),
array(),
$query
- )
- ) );
+ );
+ $out2 .= $nextLink;
+
+ $footer = "\n" . Html::element( "hr" )
+ . Html::rawElement( "div", array( "class" => "mw-prefixindex-nav" ), $nextLink );
}
$out2 .= "</td></tr>" .
Xml::closeElement( 'table' );
}
- $this->getOutput()->addHTML( $out2 . $out );
+ $this->getOutput()->addHTML( $out2 . $out . $footer );
}
}