* Use $wgLang->commaList( array ) instead of implode( ', ', array ) where possible
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 8 Mar 2009 19:40:09 +0000 (19:40 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 8 Mar 2009 19:40:09 +0000 (19:40 +0000)
* remove a piece of commented out code in SpecialSearch.php

includes/LogPage.php
includes/OutputPage.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialListusers.php
includes/specials/SpecialSearch.php

index 89fa1c5..e4c1aa1 100644 (file)
@@ -374,11 +374,13 @@ class LogPage {
         * @return string
         */
        public static function formatBlockFlags( $flags, $forContent = false ) {
+               global $wgLang;
+
                $flags = explode( ',', trim( $flags ) );
                if( count( $flags ) > 0 ) {
                        for( $i = 0; $i < count( $flags ); $i++ )
                                $flags[$i] = self::formatBlockFlag( $flags[$i], $forContent );
-                       return '(' . implode( ', ', $flags ) . ')';
+                       return '(' . $wgLang->commaList( $flags ) . ')';
                } else {
                        return '';
                }
index a05fdbe..7f8583a 100644 (file)
@@ -1153,7 +1153,7 @@ class OutputPage {
         * @param string $permission key required
         */
        public function permissionRequired( $permission ) {
-               global $wgUser;
+               global $wgUser, $wgLang;
 
                $this->setPageTitle( wfMsg( 'badaccess' ) );
                $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
@@ -1165,7 +1165,7 @@ class OutputPage {
                        User::getGroupsWithPermission( $permission ) );
                if( $groups ) {
                        $this->addWikiMsg( 'badaccess-groups',
-                               implode( ', ', $groups ),
+                               $wgLang->commaList( $groups ),
                                count( $groups) );
                } else {
                        $this->addWikiMsg( 'badaccess-group0' );
index 6b9df58..267ef69 100644 (file)
@@ -15,7 +15,7 @@
 function wfSpecialLinkSearch( $par ) {
 
        list( $limit, $offset ) = wfCheckLimits();
-       global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode;
+       global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang;
        $target = $GLOBALS['wgRequest']->getVal( 'target', $par );
        $namespace = $GLOBALS['wgRequest']->getIntorNull( 'namespace', null );
 
@@ -48,7 +48,7 @@ function wfSpecialLinkSearch( $par ) {
 
        $self = Title::makeTitle( NS_SPECIAL, 'Linksearch' );
 
-       $wgOut->addWikiText( wfMsg( 'linksearch-text', '<nowiki>' . implode( ', ',  $wgUrlProtocols) . '</nowiki>' ) );
+       $wgOut->addWikiText( wfMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols) . '</nowiki>' ) );
        $s =    Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) .
                Xml::hidden( 'title', $self->getPrefixedDbKey() ) .
                '<fieldset>' .
index 418b9eb..aa05780 100644 (file)
@@ -123,7 +123,7 @@ class UsersPager extends AlphabeticPager {
                        $list = array();
                        foreach( self::getGroups( $row->user_id ) as $group )
                                $list[] = self::buildGroupLink( $group );
-                       $groups = implode( ', ', $list );
+                       $groups = $wgLang->commaList( $list );
                } elseif( $row->numgroups == 1 ) {
                        $groups = self::buildGroupLink( $row->singlegroup );
                } else {
index f71f678..694ab64 100644 (file)
@@ -666,7 +666,7 @@ class SpecialSearch {
        }
 
        protected function formHeader( $term ) {
-               global $wgContLang, $wgCanonicalNamespaceNames;
+               global $wgContLang, $wgCanonicalNamespaceNames, $wgLang;
 
                $sep = '&nbsp;&nbsp;&nbsp;';
                $out = Xml::openElement('div', array( 'style' => 'padding-bottom:0.5em;' ) );
@@ -680,7 +680,7 @@ class SpecialSearch {
                // search profiles headers
                $m = wfMsg( 'searchprofile-articles' );
                $tt = wfMsg( 'searchprofile-articles-tooltip', 
-                       implode( ', ', SearchEngine::namespacesAsText( SearchEngine::defaultNamespaces() ) ) );
+                       $wgLang->commaList( SearchEngine::namespacesAsText( SearchEngine::defaultNamespaces() ) ) );
                if( $this->active == 'default' ) {
                        $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );    
                } else {
@@ -697,22 +697,10 @@ class SpecialSearch {
                        $out .= $this->makeSearchLink( $imageTextForm, array( NS_FILE ) , $m, $tt );
                }
                $out .= $sep;
-               
-               /*
-               $m = wfMsg( 'searchprofile-articles-and-proj' );
-               $tt = wfMsg( 'searchprofile-project-tooltip', 
-                       implode( ', ', SearchEngine::namespacesAsText( SearchEngine::defaultAndProjectNamespaces() ) ) );
-               if( $this->active == 'withproject' ) {
-                       $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );    
-               } else {
-                       $out .= $this->makeSearchLink( $bareterm, SearchEngine::defaultAndProjectNamespaces(), $m, $tt );
-               }
-               $out .= $sep;
-               */
-               
+
                $m = wfMsg( 'searchprofile-project' );
                $tt = wfMsg( 'searchprofile-project-tooltip', 
-                       implode( ', ', SearchEngine::namespacesAsText( SearchEngine::projectNamespaces() ) ) );
+                       $wgLang->commaList( SearchEngine::namespacesAsText( SearchEngine::projectNamespaces() ) ) );
                if( $this->active == 'project' ) {
                        $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );    
                } else {