* Using the new getFormattedNamespaces() instead of getNamespaces()
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 3 May 2005 12:58:42 +0000 (12:58 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 3 May 2005 12:58:42 +0000 (12:58 +0000)
* Changed 0 to NS_MAIN which has a lower potential for breaking something in
  the future.

includes/SpecialContributions.php

index 8e9eced..000f4d2 100644 (file)
@@ -221,15 +221,13 @@ function namespaceForm ( $target, $hideminor, $namespace, $invert ) {
 
        $namespaceselect = '<select name="namespace">';
        $namespaceselect .= '<option value="" '.(is_null($namespace) ? ' selected="selected"' : '').'>'.wfMsg( 'contributionsall' ).'</option>';
-       $arr = $wgContLang->getNamespaces();
-       foreach( array_keys( $arr ) as $i ) {
-               if( $i < 0 ) {
+       $arr = $wgContLang->getFormattedNamespaces();
+       foreach( $arr as $ns => $name ) {
+               if( $ns < NS_MAIN )
                        continue;
-               }
-               $namespacename = str_replace ( '_', ' ', $arr[$i] );
-               $n = ($i == 0) ? wfMsg ( 'blanknamespace' ) : $namespacename;
-               $sel = ($i === $namespace) ? ' selected="selected"' : '';
-               $namespaceselect .= "<option value='{$i}'{$sel}>{$n}</option>";
+               $n = $ns == 0 ? wfMsg ( 'blanknamespace' ) : $name;
+               $sel = $namespace === $ns ? ' selected="selected"' : '';
+               $namespaceselect .= "<option value='$ns'$sel>$n</option>";
        }
        $namespaceselect .= '</select>';