From: Ævar Arnfjörð Bjarmason Date: Tue, 3 May 2005 13:17:54 +0000 (+0000) Subject: * Using getFormattedNamespaces() instead of getNamespaces() for faster X-Git-Tag: 1.5.0alpha2~338 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=2147c99d93f8a469047cfae9448e7223771d27fe;p=lhc%2Fweb%2Fwiklou.git * Using getFormattedNamespaces() instead of getNamespaces() for faster development (oh noes) * Misc clenup --- 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 ) {