https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112589
Revision: 112589
Author: siebrand
Date: 2012-02-28 11:56:59 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
(bug 34702) More localised parentheses. Patch contributed by Yusuke Matsubara.
Modified Paths:
--------------
trunk/phase3/CREDITS
trunk/phase3/includes/ChangesList.php
trunk/phase3/includes/Linker.php
trunk/phase3/includes/actions/HistoryAction.php
Modified: trunk/phase3/CREDITS
===================================================================
--- trunk/phase3/CREDITS 2012-02-28 11:55:58 UTC (rev 112588)
+++ trunk/phase3/CREDITS 2012-02-28 11:56:59 UTC (rev 112589)
@@ -184,6 +184,7 @@
* Ville Stadista
* Vitaliy Filippov
* William Demchick
+* Yusuke Matsubara
* Yuvaraj Pandian T
* Zachary Hauri
Modified: trunk/phase3/includes/ChangesList.php
===================================================================
--- trunk/phase3/includes/ChangesList.php 2012-02-28 11:55:58 UTC (rev
112588)
+++ trunk/phase3/includes/ChangesList.php 2012-02-28 11:56:59 UTC (rev
112589)
@@ -252,7 +252,7 @@
public function insertLog( &$s, $title, $logtype ) {
$page = new LogPage( $logtype );
$logname = $page->getName()->escaped();
- $s .= '(' . Linker::linkKnown( $title, $logname ) . ')';
+ $s .= $this->msg( 'parentheses' )->rawParams(
Linker::linkKnown( $title, $logname ) )->escaped();
}
/**
@@ -284,9 +284,9 @@
$query
);
}
- $s .= '(' . $diffLink . $this->message['pipe-separator'];
+ $diffhist = $diffLink . $this->message['pipe-separator'];
# History link
- $s .= Linker::linkKnown(
+ $diffhist .= Linker::linkKnown(
$rc->getTitle(),
$this->message['hist'],
array(),
@@ -295,7 +295,7 @@
'action' => 'history'
)
);
- $s .= ') . . ';
+ $s .= $this->msg( 'parentheses' )->rawParams( $diffhist
)->escaped() . ' . . ';
}
/**
@@ -679,7 +679,7 @@
$logtitle = SpecialPage::getTitleFor( 'Log',
$logType );
$logpage = new LogPage( $logType );
$logname = $logpage->getName()->escaped();
- $clink = '(' . Linker::linkKnown( $logtitle,
$logname ) . ')';
+ $clink = $this->msg( 'parentheses'
)->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped();
} else {
$clink = Linker::link( $rc->getTitle() );
}
@@ -852,7 +852,7 @@
$text = $userlink;
$text .= $this->getLanguage()->getDirMark();
if( $count > 1 ) {
- $text .= ' (' .
$this->getLanguage()->formatNum( $count ) . '×)';
+ $text .= ' ' . $this->msg( 'parentheses'
)->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped();
}
array_push( $users, $text );
}
@@ -894,18 +894,18 @@
}
# Total change link
$r .= ' ';
+ $logtext = '';
if( !$allLogs ) {
- $r .= '(';
if( !ChangesList::userCan( $rcObj,
Revision::DELETED_TEXT, $this->getUser() ) ) {
- $r .= $nchanges[$n];
+ $logtext .= $nchanges[$n];
} elseif( $isnew ) {
- $r .= $nchanges[$n];
+ $logtext .= $nchanges[$n];
} else {
$params = $queryParams;
$params['diff'] = $currentRevision;
$params['oldid'] = $oldid;
- $r .= Linker::link(
+ $logtext .= Linker::link(
$block[0]->getTitle(),
$nchanges[$n],
array(),
@@ -919,19 +919,24 @@
if( $allLogs ) {
// don't show history link for logs
} elseif( $namehidden || !$block[0]->getTitle()->exists() ) {
- $r .= $this->message['pipe-separator'] .
$this->message['hist'] . ')';
+ $logtext .= $this->message['pipe-separator'] .
$this->message['hist'];
} else {
$params = $queryParams;
$params['action'] = 'history';
- $r .= $this->message['pipe-separator'] .
+ $logtext .= $this->message['pipe-separator'] .
Linker::linkKnown(
$block[0]->getTitle(),
$this->message['hist'],
array(),
$params
- ) . ')';
+ );
}
+
+ if( $logtext != '' ) {
+ $r .= $this->msg( 'parentheses' )->rawParams( $logtext
)->escaped();
+ }
+
$r .= ' . . ';
# Character difference (does not apply if only log items)
@@ -1003,11 +1008,7 @@
$r .= $link . '</span>';
if ( !$type == RC_LOG || $type == RC_NEW ) {
- $r .= ' (';
- $r .= $rcObj->curlink;
- $r .= $this->message['pipe-separator'];
- $r .= $rcObj->lastlink;
- $r .= ')';
+ $r .= $this->msg( 'parentheses' )->rawParams(
$rcObj->curlink . $this->message['pipe-separator'] . $rcObj->lastlink
)->escaped();
}
$r .= ' . . ';
@@ -1126,20 +1127,19 @@
if( $logType ) {
$logtitle = SpecialPage::getTitleFor( 'Log', $logType );
$logname = LogPage::logName( $logType );
- $r .= '(' . Linker::linkKnown( $logtitle,
htmlspecialchars( $logname ) ) . ')';
+ $r .= $this->msg( 'parentheses' )->rawParams(
Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) )->escaped();
} else {
$this->insertArticleLink( $r, $rcObj,
$rcObj->unpatrolled, $rcObj->watched );
}
# Diff and hist links
if ( $type != RC_LOG ) {
- $r .= ' ('. $rcObj->difflink .
$this->message['pipe-separator'];
$query['action'] = 'history';
- $r .= Linker::linkKnown(
+ $r .= $this->msg( 'parentheses' )->rawParams(
$rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown(
$rcObj->getTitle(),
$this->message['hist'],
array(),
$query
- ) . ')';
+ ) )->escaped();
}
$r .= ' . . ';
# Character diff
Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php 2012-02-28 11:55:58 UTC (rev 112588)
+++ trunk/phase3/includes/Linker.php 2012-02-28 11:56:59 UTC (rev 112589)
@@ -995,7 +995,7 @@
wfRunHooks( 'UserToolLinksEdit', array( $userId, $userText,
&$items ) );
if ( $items ) {
- return ' <span class="mw-usertoollinks">(' .
$wgLang->pipeList( $items ) . ')</span>';
+ return ' <span class="mw-usertoollinks">' . wfMessage(
'parentheses' )->rawParams( $wgLang->pipeList( $items ) )->escaped() .
'</span>';
} else {
return '';
}
Modified: trunk/phase3/includes/actions/HistoryAction.php
===================================================================
--- trunk/phase3/includes/actions/HistoryAction.php 2012-02-28 11:55:58 UTC
(rev 112588)
+++ trunk/phase3/includes/actions/HistoryAction.php 2012-02-28 11:56:59 UTC
(rev 112589)
@@ -523,7 +523,7 @@
$histLinks = Html::rawElement(
'span',
array( 'class' => 'mw-history-histlinks' ),
- '(' . $curlink .
$this->historyPage->message['pipe-separator'] . $lastlink . ') '
+ $this->msg( 'parentheses' )->rawParams(
$curlink . $this->historyPage->message['pipe-separator'] . $lastlink
)->escaped()
);
$s = $histLinks . $diffButtons;
@@ -619,7 +619,7 @@
}
if ( $tools ) {
- $s .= ' (' . $lang->pipeList( $tools ) . ')';
+ $s .= $this->msg( 'parentheses' )->rawParams(
$lang->pipeList( $tools ) )->escaped();
}
# Tags
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs