* @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 '';
}
* @param string $permission key required
*/
public function permissionRequired( $permission ) {
- global $wgUser;
+ global $wgUser, $wgLang;
$this->setPageTitle( wfMsg( 'badaccess' ) );
$this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
User::getGroupsWithPermission( $permission ) );
if( $groups ) {
$this->addWikiMsg( 'badaccess-groups',
- implode( ', ', $groups ),
+ $wgLang->commaList( $groups ),
count( $groups) );
} else {
$this->addWikiMsg( 'badaccess-group0' );
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 );
$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>' .
$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 {
}
protected function formHeader( $term ) {
- global $wgContLang, $wgCanonicalNamespaceNames;
+ global $wgContLang, $wgCanonicalNamespaceNames, $wgLang;
$sep = ' ';
$out = Xml::openElement('div', array( 'style' => 'padding-bottom:0.5em;' ) );
// 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 {
$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 {