summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialPrefixindex.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialPrefixindex.php')
-rw-r--r--includes/specials/SpecialPrefixindex.php54
1 files changed, 41 insertions, 13 deletions
diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php
index 8b5f0c93..09e7734c 100644
--- a/includes/specials/SpecialPrefixindex.php
+++ b/includes/specials/SpecialPrefixindex.php
@@ -1,7 +1,29 @@
<?php
+/**
+ * Implements Special:Prefixindex
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ */
/**
- * implements Special:Prefixindex
+ * Implements Special:Prefixindex
+ *
* @ingroup SpecialPage
*/
class SpecialPrefixindex extends SpecialAllpages {
@@ -22,7 +44,7 @@ class SpecialPrefixindex extends SpecialAllpages {
$this->outputHeader();
# GET values
- $from = $wgRequest->getVal( 'from' );
+ $from = $wgRequest->getVal( 'from', '' );
$prefix = $wgRequest->getVal( 'prefix', '' );
$namespace = $wgRequest->getInt( 'namespace' );
$namespaces = $wgContLang->getNamespaces();
@@ -32,12 +54,17 @@ class SpecialPrefixindex extends SpecialAllpages {
: wfMsg( 'prefixindex' )
);
+ $showme = '';
if( isset( $par ) ){
- $this->showPrefixChunk( $namespace, $par, $from );
- } elseif( isset( $prefix ) ){
- $this->showPrefixChunk( $namespace, $prefix, $from );
- } elseif( isset( $from ) ){
- $this->showPrefixChunk( $namespace, $from, $from );
+ $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 ) );
}
@@ -45,8 +72,8 @@ class SpecialPrefixindex extends SpecialAllpages {
/**
* HTML for the top form
- * @param integer $namespace A namespace constant (default NS_MAIN).
- * @param string $from dbKey we are starting listing at.
+ * @param $namespace Integer: a namespace constant (default NS_MAIN).
+ * @param $from String: dbKey we are starting listing at.
*/
function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) {
global $wgScript;
@@ -54,7 +81,7 @@ class SpecialPrefixindex extends SpecialAllpages {
$out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
$out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
- $out .= Xml::hidden( 'title', $t->getPrefixedText() );
+ $out .= Html::hidden( 'title', $t->getPrefixedText() );
$out .= Xml::openElement( 'fieldset' );
$out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
$out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
@@ -83,8 +110,9 @@ class SpecialPrefixindex extends SpecialAllpages {
}
/**
- * @param integer $namespace (Default NS_MAIN)
- * @param string $from list all pages from this name (default FALSE)
+ * @param $namespace Integer, default NS_MAIN
+ * @param $prefix String
+ * @param $from String: list all pages from this name (default FALSE)
*/
function showPrefixChunk( $namespace = NS_MAIN, $prefix, $from = null ) {
global $wgOut, $wgUser, $wgContLang, $wgLang;
@@ -105,7 +133,7 @@ class SpecialPrefixindex extends SpecialAllpages {
$namespace = NS_MAIN;
} else {
list( $namespace, $prefixKey, $prefix ) = $prefixList;
- list( /* $fromNs */, $fromKey, $from ) = $fromList;
+ list( /* $fromNS */, $fromKey, ) = $fromList;
### FIXME: should complain if $fromNs != $namespace