Last commit to fix this issue. Related commits are r47028, r47040, r47044. Originally committed as r40953, which was reverted in r40977, because if was too verbose. Language::pipeList, and Language::commaList should have resolved that.
* (bug 17190) User ID on preference page no longer has delimeters
* (bug 17341) "Powered by MediaWiki" should be on the left on RTL wikis
* (bug 17404) "userrights-interwiki" right was missing in User::$mCoreRights
+* (bug 7509) Separation strings should be configurable
== API changes in 1.15 ==
* (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
* @return string
*/
private function buildRemoveLine( $title, $redirect, $skin ) {
+ global $wgLang;
+
$link = $skin->makeLinkObj( $title );
if( $redirect )
$link = '<span class="watchlistredir">' . $link . '</span>';
}
return "<li>"
. Xml::check( 'titles[]', false, array( 'value' => $title->getPrefixedText() ) )
- . $link . " (" . implode( ' | ', $tools ) . ")" . "</li>\n";
+ . $link . " (" . $wgLang->pipeList( $tools ) . ")" . "</li>\n";
}
/**
* @return string
*/
public static function buildTools( $skin ) {
+ global $wgLang;
+
$tools = array();
$modes = array( 'view' => false, 'edit' => 'edit', 'raw' => 'raw' );
foreach( $modes as $mode => $subpage ) {
$tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Watchlist', $subpage ), wfMsgHtml( "watchlisttools-{$mode}" ) );
}
- return implode( ' | ', $tools );
+ return $wgLang->pipeList( $tools );
}
}
*/
function wfSpecialAllmessages() {
global $wgOut, $wgRequest, $wgMessageCache, $wgTitle;
- global $wgUseDatabaseMessages;
+ global $wgUseDatabaseMessages, $wgLang;
# The page isn't much use if the MediaWiki namespace is not being used
if( !$wgUseDatabaseMessages ) {
$wgOut->addScriptFile( 'allmessages.js' );
if ( $ot == 'php' ) {
$navText .= wfAllMessagesMakePhp( $messages );
- $wgOut->addHTML( 'PHP | <a href="' . $wgTitle->escapeLocalUrl( 'ot=html' ) . '">HTML</a> | ' .
+ $wgOut->addHTML( $wgLang->pipeList( array(
+ 'PHP',
+ '<a href="' . $wgTitle->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
'<a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
- '<pre>' . htmlspecialchars( $navText ) . '</pre>' );
+ '<pre>' . htmlspecialchars( $navText ) . '</pre>'
+ ) ) );
} else if ( $ot == 'xml' ) {
$wgOut->disable();
header( 'Content-type: text/xml' );
echo wfAllMessagesMakeXml( $messages );
} else {
- $wgOut->addHTML( '<a href="' . $wgTitle->escapeLocalUrl( 'ot=php' ) . '">PHP</a> | ' .
- 'HTML | <a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' );
+ $wgOut->addHTML( $wgLang->pipeList( array(
+ '<a href="' . $wgTitle->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
+ 'HTML',
+ '<a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
+ ) ) );
$wgOut->addWikiText( $navText );
$wgOut->addHTML( wfAllMessagesMakeHTMLText( $messages ) );
}
* @param string $to list all pages to this name (default FALSE)
*/
function showChunk( $namespace = NS_MAIN, $from = false, $to = false ) {
- global $wgOut, $wgUser, $wgContLang;
+ global $wgOut, $wgUser, $wgContLang, $wgLang;
$sk = $wgUser->getSkin();
. ( $namespace ? '&namespace=' . $namespace : '' );
$prevLink = $sk->makeKnownLinkObj( $self,
wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), $q );
- $out2 .= ' | ' . $prevLink;
+ $out2 = $wgLang->pipeList( array( $out2, $prevLink ) );
}
if( $n == $this->maxPerPage && $s = $res->fetchObject() ) {
. ( $namespace ? '&namespace=' . $namespace : '' );
$nextLink = $sk->makeKnownLinkObj( $self,
wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), $q );
- $out2 .= ' | ' . $nextLink;
+ $out2 = $wgLang->pipeList( array( $out2, $nextLink ) );
}
$out2 .= "</td></tr></table>";
}
$wgOut->addHTML( $prevLink );
}
if( isset( $prevLink ) && isset( $nextLink ) ) {
- $wgOut->addHTML( ' | ' );
+ $wgOut->addHTML( wfMsgExt( 'pipe-separator' , 'escapenoentities' ) );
}
if( isset( $nextLink ) ) {
$wgOut->addHTML( $nextLink );
* @return string
*/
private function getConvenienceLinks() {
- global $wgUser;
+ global $wgUser, $wgLang;
$skin = $wgUser->getSkin();
if( $this->BlockAddress )
$links[] = $this->getContribsLink( $skin );
$links[] = $this->getUnblockLink( $skin );
$links[] = $this->getBlockListLink( $skin );
$links[] = $skin->makeLink ( 'MediaWiki:Ipbreason-dropdown', wfMsgHtml( 'ipb-edit-dropdown' ) );
- return '<p class="mw-ipb-conveniencelinks">' . implode( ' | ', $links ) . '</p>';
+ return '<p class="mw-ipb-conveniencelinks">' . $wgLang->pipeList( $links ) . '</p>';
}
/**
wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
- $links = implode( ' | ', $tools );
+ $links = $wgLang->pipeList( $tools );
}
// Old message 'contribsub' had one parameter, but that doesn't work for
}
protected function filterLinks() {
- global $wgGroupPermissions, $wgUser;
+ global $wgGroupPermissions, $wgUser, $wgLang;
// show/hide links
$showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
$links[$key] = wfMsgHtml( $msg, $link );
}
- return implode( ' | ', $links );
+ return $wgLang->pipeList( $links );
}
protected function form() {
$this->tableRow(
wfMsgExt( 'prefs-memberingroups', array( 'parseinline' ), count( $userEffectiveGroupsArray ) ),
$wgLang->commaList( $userEffectiveGroupsArray ) .
- '<br />(' . implode( ' | ', $toolLinks ) . ')'
+ '<br />(' . $wgLang->pipeList( $toolLinks ) . ')'
) .
$this->tableRow(
* @param string $from list all pages from this name (default FALSE)
*/
function showPrefixChunk( $namespace = NS_MAIN, $prefix, $from = null ) {
- global $wgOut, $wgUser, $wgContLang;
+ global $wgOut, $wgUser, $wgContLang, $wgLang;
$sk = $wgUser->getSkin();
wfMsg ( 'allpages' ) );
if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
$namespaceparam = $namespace ? "&namespace=$namespace" : "";
- $out2 .= " | " . $sk->makeKnownLinkObj(
- $self,
- wfMsgHtml( 'nextpage', htmlspecialchars( $s->page_title ) ),
- "from=" . wfUrlEncode( $s->page_title ) .
- "&prefix=" . wfUrlEncode( $prefix ) . $namespaceparam );
+ $out2 = $wgLang->pipeList( array(
+ $out2,
+ $sk->makeKnownLinkObj(
+ $self,
+ wfMsgHtml( 'nextpage', htmlspecialchars( $s->page_title ) ),
+ "from=" . wfUrlEncode( $s->page_title ) .
+ "&prefix=" . wfUrlEncode( $prefix ) . $namespaceparam )
+ ) );
}
$out2 .= "</td></tr></table>";
}
$cl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ) ;
}
- $cl = implode( ' | ', $cl );
+ $cl = $wgLang->pipeList( $cl );
// day links, reset 'from' to none
foreach( $wgRCLinkDays as $value ) {
$dl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ) ;
}
- $dl = implode( ' | ', $dl );
+ $dl = $wgLang->pipeList( $dl );
// show/hide links
if( $wgUser->useRCPatrol() )
$links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
$links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
- $hl = implode( ' | ', $links );
+ $hl = $wgLang->pipeList( $links );
// show from this onward link
$now = $wgLang->timeanddate( wfTimestampNow(), true );
* @return string
*/
function makeLanguageSelector() {
+ global $wgLang;
+
$msg = wfMsgForContent( 'loginlanguagelinks' );
if( $msg != '' && !wfEmptyMsg( 'loginlanguagelinks', $msg ) ) {
$langs = explode( "\n", $msg );
$links[] = $this->makeLanguageSelectorLink( $parts[0], $parts[1] );
}
}
- return count( $links ) > 0 ? wfMsgHtml( 'loginlanguagelabel', implode( ' | ', $links ) ) : '';
+ return count( $links ) > 0 ? wfMsgHtml( 'loginlanguagelabel', $wgLang->pipeList( $links ) ) : '';
} else {
return '';
}
# Namespace filter and put the whole form together.
$form .= $wlInfo;
$form .= $cutofflinks;
- $form .= implode( ' | ', $links );
+ $form .= $wgLang->pipeList( $links );
$form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $thisTitle->getLocalUrl() ) );
$form .= '<hr /><p>';
$form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ';
* Returns html
*/
function wlCutoffLinks( $days, $page = 'Watchlist', $options = array() ) {
+ global $wgLang;
+
$hours = array( 1, 2, 6, 12 );
$days = array( 1, 3, 7 );
$i = 0;
}
return wfMsgExt('wlshowlast',
array('parseinline', 'replaceafter'),
- implode(' | ', $hours),
- implode(' | ', $days),
+ $wgLang->pipeList( $hours ),
+ $wgLang->pipeList( $days ),
wlDaysLink( 0, $page, $options ) );
}
$limitLinks[] = $this->makeSelfLink( $prettyLimit, wfArrayToCGI( $overrides, $changed ) );
}
- $nums = implode ( ' | ', $limitLinks );
+ $nums = $wgLang->pipeList( $limitLinks );
return wfMsgHtml( 'viewprevnext', $prev, $next, $nums );
}