From 2147c99d93f8a469047cfae9448e7223771d27fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 3 May 2005 13:17:54 +0000 Subject: [PATCH] * Using getFormattedNamespaces() instead of getNamespaces() for faster development (oh noes) * Misc clenup --- includes/SpecialAllpages.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 2dd4907686..feef77f940 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -18,11 +18,10 @@ function wfSpecialAllpages( $par=NULL ) { $namespace = $wgRequest->getInt( 'namespace' ); $invert = $wgRequest->getBool( 'invert' ); - $names = $wgContLang->getNamespaces(); + $namespaces = array_keys($wgContLang->getNamespaces()); - if( !isset( $names[$namespace] ) ) { + if( !in_array($namespace, $namespaces) ) $namespace = 0; - } if ($invert) { $wgOut->setPagetitle( $namespace > 0 ? @@ -56,13 +55,13 @@ function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert ) { $t = Title::makeTitle( NS_SPECIAL, "Allpages" ); $namespaceselect = ''; @@ -238,10 +237,7 @@ function indexShowChunk( $namespace = NS_MAIN, $from, $invert ) { $n = 0; $out = ''; - $namespaces = $wgContLang->getNamespaces(); - foreach($namespaces as $key => $ns) { - $namespaces[$key] = str_replace('_', ' ', $namespaces[$key]); - } + $namespaces = $wgContLang->getFormattedNamespaces(); while( ($n < $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { -- 2.20.1