*/
class SpecialPrefixindex extends SpecialAllpages {
// Inherit $maxPerPage
-
+
function __construct(){
parent::__construct( 'Prefixindex' );
}
-
+
/**
* Entry point : initialise variables and call subfunctions.
* @param $par String: becomes "FOO" when called like Special:Prefixindex/FOO (default null)
$this->setHeaders();
$this->outputHeader();
+ $wgOut->addModuleStyles( 'mediawiki.special' );
# GET values
$from = $wgRequest->getVal( 'from', '' );
: wfMsg( 'prefixindex' )
);
- if( isset( $par ) ){
- $this->showPrefixChunk( $namespace, $par, $from );
- } elseif( $prefix != '' ){
- $this->showPrefixChunk( $namespace, $prefix, $from );
- } elseif( $from != '' ){
- $this->showPrefixChunk( $namespace, $from, $from );
+ $showme = '';
+ if ( $this->including() && $par == '' ) {
+ // Bug 27864: if transcluded, show all pages instead of the form
+ } elseif( isset( $par ) ) {
+ $showme = $par;
+ } elseif( $prefix != '' ) {
+ $showme = $prefix;
+ } elseif( $from != '' ) {
+ // For back-compat with Special:Allpages
+ $showme = $from;
+ }
+ if ( $showme != '' || $namespace ) {
+ $this->showPrefixChunk( $namespace, $showme, $from );
} else {
$wgOut->addHTML( $this->namespacePrefixForm( $namespace, null ) );
}
}
-
+
/**
* HTML for the top form
* @param $namespace Integer: a namespace constant (default NS_MAIN).
$namespaces = $wgContLang->getNamespaces();
if ( !$prefixList || !$fromList ) {
- $out = wfMsgWikiHtml( 'allpagesbadtitle' );
+ $out = wfMsgExt( 'allpagesbadtitle', 'parse' );
} elseif ( !in_array( $namespace, array_keys( $namespaces ) ) ) {
// Show errormessage and reset to NS_MAIN
$out = wfMsgExt( 'allpages-bad-ns', array( 'parseinline' ), $namespace );
list( $namespace, $prefixKey, $prefix ) = $prefixList;
list( /* $fromNS */, $fromKey, ) = $fromList;
- ### FIXME: should complain if $fromNs != $namespace
+ ### @todo FIXME: Should complain if $fromNs != $namespace
$dbr = wfGetDB( DB_SLAVE );
)
);
- ### FIXME: side link to previous
+ ### @todo FIXME: Side link to previous
$n = 0;
if( $res->numRows() > 0 ) {
$out = Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-prefixindex-list-table' ) );
-
+
while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
$t = Title::makeTitle( $s->page_namespace, $s->page_title );
if( $t ) {
<td>' .
$nsForm .
'</td>
- <td id="mw-prefixindex-nav-form">' .
- $sk->linkKnown( $self, wfMsgHtml( 'allpages' ) );
+ <td id="mw-prefixindex-nav-form">';
if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
$query = array(