private function preCacheMessages() {
if ( !isset( $this->message ) ) {
foreach ( array(
- 'cur', 'diff', 'hist', 'last', 'blocklink', 'history',
+ 'cur', 'diff', 'hist', 'enhancedrc-history', 'last', 'blocklink', 'history',
'semicolon-separator', 'pipe-separator' ) as $msg
) {
$this->message[$msg] = $this->msg( $msg )->escaped();
$r .= $this->getLanguage()->getDirMark();
$queryParams['curid'] = $curId;
+
# Changes message
- $n = count( $block );
static $nchanges = array();
+ static $sinceLastVisitMsg = array();
+
+ $n = count( $block );
if ( !isset( $nchanges[$n] ) ) {
$nchanges[$n] = $this->msg( 'nchanges' )->numParams( $n )->escaped();
}
+
+ $sinceLast = 0;
+ $unvisitedOldid = null;
+ foreach ( $block as $rcObj ) {
+ // Same logic as below inside main foreach
+ if ( $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched ) {
+ $sinceLast++;
+ $unvisitedOldid = $rcObj->mAttribs['rc_last_oldid'];
+ }
+ }
+ if ( !isset( $sinceLastVisitMsg[$sinceLast] ) ) {
+ $sinceLastVisitMsg[$sinceLast] =
+ $this->msg( 'enhancedrc-since-last-visit' )->numParams( $sinceLast )->escaped();
+ }
+
# Total change link
$r .= ' ';
$logtext = '';
} elseif ( $isnew ) {
$logtext .= $nchanges[$n];
} else {
- $params = $queryParams;
- $params['diff'] = $currentRevision;
- $params['oldid'] = $oldid;
-
$logtext .= Linker::link(
$block[0]->getTitle(),
$nchanges[$n],
array(),
- $params,
+ $queryParams + array(
+ 'diff' => $currentRevision,
+ 'oldid' => $oldid,
+ ),
array( 'known', 'noclasses' )
);
+ if ( $sinceLast > 0 && $sinceLast < $n ) {
+ $logtext .= $this->message['pipe-separator'] . Linker::link(
+ $block[0]->getTitle(),
+ $sinceLastVisitMsg[$sinceLast],
+ array(),
+ $queryParams + array(
+ 'diff' => $currentRevision,
+ 'oldid' => $unvisitedOldid,
+ ),
+ array( 'known', 'noclasses' )
+ );
+ }
}
}
if ( $allLogs ) {
// don't show history link for logs
} elseif ( $namehidden || !$block[0]->getTitle()->exists() ) {
- $logtext .= $this->message['pipe-separator'] . $this->message['hist'];
+ $logtext .= $this->message['pipe-separator'] . $this->message['enhancedrc-history'];
} else {
$params = $queryParams;
$params['action'] = 'history';
$logtext .= $this->message['pipe-separator'] .
Linker::linkKnown(
$block[0]->getTitle(),
- $this->message['hist'],
+ $this->message['enhancedrc-history'],
array(),
$params
);
'action-editmyprivateinfo' => '{{doc-action|editmyprivateinfo}}',
# Recent changes
-'nchanges' => 'Appears on the [[Special:RecentChanges]] special page in brackets after pages having more than one change on that date. $1 is the number of changes on that day.',
+'nchanges' => 'Appears on enhanced watchlist and recent changes when page has more than one change on given date, linking to a diff of the changes.
+$1 is the number of changes on that day (2 or more).
+Three messages are shown side-by-side: ({{msg-mw|nchanges}} | {{msg-mw|enhancedrc-since-last-visit}} | {{msg-mw|enhancedrc-history}}).',
+'enhancedrc-since-last-visit' => 'Appears on enhanced watchlist and recent changes when page has more than one change on given date and at least one that the user hasn\'t seen yet, linking to a diff of the unviewed changes.
+$1 is the number of unviewed changes (1 or more).
+Three messages are shown side-by-side: ({{msg-mw|nchanges}} | {{msg-mw|enhancedrc-since-last-visit}} | {{msg-mw|enhancedrc-history}}).',
+'enhancedrc-history' => 'Appears on enhanced watchlist and recent changes when page has more than one change on given date, linking to its history.
+This is the same as {{msg-mw|hist}}, but not abbreviated.
+Three messages are shown side-by-side: ({{msg-mw|nchanges}} | {{msg-mw|enhancedrc-since-last-visit}} | {{msg-mw|enhancedrc-history}}).',
'recentchanges' => 'The text of the link in sidebar going to the special page [[Special:RecentChanges]]. Also the page title of that special page.
See also: