<?php
-/**
- * Contain class to show various lists of change:
- * - what's link here
- * - related changes
- * - recent changes
- */
/**
* @todo document
var $curlink , $difflink, $lastlink , $usertalklink , $versionlink ;
var $userlink, $timestamp, $watched;
- function newFromParent( $rc ) {
+ static function newFromParent( $rc ) {
$rc2 = new RCCacheEntry;
$rc2->mAttribs = $rc->mAttribs;
$rc2->mExtra = $rc->mExtra;
} ;
/**
+ * Class to show various lists of changes:
+ * - what links here
+ * - related changes
+ * - recent changes
*/
class ChangesList {
# Called by history lists and recent changes
// Precache various messages
if( !isset( $this->message ) ) {
foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last '.
- 'blocklink changes history boteditletter' ) as $msg ) {
+ 'blocklink history boteditletter' ) as $msg ) {
$this->message[$msg] = wfMsgExt( $msg, array( 'escape') );
}
}
? 'rcid='.$rc->mAttribs['rc_id']
: '';
$articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
- if($watched) $articlelink = '<strong>'.$articlelink.'</strong>';
+ if( $watched )
+ $articlelink = "<strong class=\"mw-watched\">{$articlelink}</strong>";
global $wgContLang;
$articlelink .= $wgContLang->getDirMark();
*/
function usePatrol() {
global $wgUseRCPatrol, $wgUser;
- return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) );
+ return( $wgUseRCPatrol && ($wgUser->isAllowed('patrol') || $wgUser->isAllowed('patrolmarks')) );
}
/**
* Enhanced RC group
*/
function recentChangesBlockGroup( $block ) {
- global $wgContLang, $wgRCShowChangedSize;
+ global $wgLang, $wgContLang, $wgRCShowChangedSize;
$r = '';
# Collate list of users
$currentRevision = $block[0]->mAttribs['rc_this_oldid'];
if( $block[0]->mAttribs['rc_type'] != RC_LOG ) {
# Changes
- $r .= ' ('.count($block).' ';
+
+ $n = count($block);
+ static $nchanges = array();
+ if ( !isset( $nchanges[$n] ) ) {
+ $nchanges[$n] = wfMsgExt( 'nchanges', array( 'parsemag', 'escape'),
+ $wgLang->formatNum( $n ) );
+ }
+
+ $r .= ' (';
if( $isnew ) {
- $r .= $this->message['changes'];
+ $r .= $nchanges[$n];
} else {
$r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
- $this->message['changes'], $curIdEq."&diff=$currentRevision&oldid=$oldid" );
+ $nchanges[$n], $curIdEq."&diff=$currentRevision&oldid=$oldid" );
}
$r .= ') . . ';
- # Character difference
- $chardiff = $rcObj->getCharacterDifference( $block[ count( $block ) - 1 ]->mAttribs['rc_old_len'],
- $block[0]->mAttribs['rc_new_len'] );
- if( $chardiff == '' ) {
- $r .= ' (';
- } else {
- $r .= ' ' . $chardiff. ' . . (';
- }
-
+ if( $wgRCShowChangedSize ) {
+ # Character difference
+ $chardiff = $rcObj->getCharacterDifference( $block[ count( $block ) - 1 ]->mAttribs['rc_old_len'],
+ $block[0]->mAttribs['rc_new_len'] );
+ if( $chardiff == '' ) {
+ $r .= ' (';
+ } else {
+ $r .= ' ' . $chardiff. ' . . ';
+ }
+ }
# History
- $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
+ $r .= '(' . $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
$this->message['history'], $curIdEq.'&action=history' );
$r .= ')';
}
function maybeWatchedLink( $link, $watched=false ) {
if( $watched ) {
// FIXME: css style might be more appropriate
- return '<strong>' . $link . '</strong>';
+ return '<strong class="mw-watched">' . $link . '</strong>';
} else {
return $link;
}
}
}
-?>
+