$this->skin =& $skin;
$this->preCacheMessages();
}
+
+ function newFromUser( &$user ) {
+ $sk =& $user->getSkin();
+ if ( $user->getOption('usenewrc') ) {
+ return new EnhancedChangesList( $sk );
+ } else {
+ return new OldChangesList( $sk );
+ }
+ }
/**
* As we use the same small set of messages in various methods and that
}
- function insertMove(&$s) {
+ function insertMove( &$s, $rc ) {
# Diff
$s .= '(' . $this->message['diff'] . ') (';
# Hist
') . . ';
# "[[x]] moved to [[y]]"
- $msg = ( $rc_type == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
+ $msg = ( $rc->mAttribs['rc_type'] == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
$s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
}
if ( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
$diffLink = $this->message['diff'];
} else {
- $rcidparam = $unpatrolled ? '&rcid='.$rc->mAttribs['rc_id'] : '';
+ $rcidparam = $unpatrolled
+ ? array( 'rcid' => $rc->mAttribs['rc_id'] )
+ : array();
$diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
- $curIdEq.'&diff='.$rc->mAttribs['rc_this_oldid'].'&oldid='.$rc->mAttribs['rc_last_oldid'].$rcidparam,
- '', '', ' tabindex="'.$rc->counter.'"');
+ wfArrayToCGI( array(
+ 'curid' => $rc->mAttribs['rc_cur_id'],
+ 'diff' => $rc->mAttribs['rc_this_oldid'],
+ 'oldid' => $rc->mAttribs['rc_last_oldid'] ),
+ $rcidparam ),
+ '', '', ' tabindex="'.$rc->counter.'"');
}
$s .= '('.$diffLink.') (';
# History link
- $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'], 'curid='.$this->mAttribs['rc_cur_id'].'&action=history' );
+ $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
+ wfArrayToCGI( array(
+ 'curid' => $rc->mAttribs['rc_cur_id'],
+ 'action' => 'history' ) ) );
$s .= ') . . ';
}
# Article link
# If it's a new article, there is no diff link, but if it hasn't been
# patrolled yet, we need to give users a way to do so
- if ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW ) {
- $articlelink .= ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'rcid='.$this->mAttribs['rc_id'] );
- } else {
- $articlelink .= ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '' );
- }
+ $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW )
+ ? 'rcid='.$rc->mAttribs['rc_id']
+ : '';
+ $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
if($watched) $articlelink = '<strong>'.$articlelink.'</strong>';
$s .= ' '.$articlelink;
# Block link
$blockLinkPage = Title::makeTitle( NS_SPECIAL, 'Blockip' );
$blockLink = $this->skin->makeKnownLinkObj( $blockLinkPage,
- htmlspecialchars( $this->message['blocklink'] ), 'ip=' . urlencode( $rc->mAttribs['user_text'] ) );
+ htmlspecialchars( $this->message['blocklink'] ), 'ip=' . urlencode( $rc->mAttribs['rc_user_text'] ) );
$s .= $blockLink;
}
* Format a line using the old system (aka without any javascript).
*/
function recentChangesLine( &$rc, $watched = false ) {
- global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol,
- $wgOnlySysopsCanPatrol, $wgSysopUserBans;
+ global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
+ global $wgOnlySysopsCanPatrol, $wgSysopUserBans;
$fname = 'ChangesList::recentChangesLineOld';
wfProfileIn( $fname );
// moved pages
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- $this->insertMove($s);
+ $this->insertMove( $s, $rc );
// log entries
} elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
$this->insertLog($s, $rc->getTitle(), $matches[1]);
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*/
function recentChangesLine( &$baseRC, $watched = false ) {
- global $wgTitle, $wgLang, $wgContLang, $wgUser,
- $wgUseRCPatrol, $wgOnlySysopsCanPatrol, $wgSysopUserBans;
+ global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
+ global $wgOnlySysopsCanPatrol, $wgSysopUserBans;
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC ) ;
} else {
$rcIdQuery = '';
}
- $query = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid";
+ $querycur = $curIdEq."&diff=0&oldid=$rc_this_oldid";
+ $querydiff = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid";
$aprops = ' tabindex="'.$baseRC->counter.'"';
- $curLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $query, '' ,'' , $aprops );
+ $curLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $querycur, '' ,'' , $aprops );
if( $rc_type == RC_NEW || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
if( $rc_type != RC_NEW ) {
$curLink = $this->message['cur'];
}
$diffLink = $this->message['diff'];
} else {
- $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $query . $rcIdQuery, '' ,'' , $aprops );
+ $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'' , $aprops );
}
# Make "last" link
$r .= ' </tt>' ;
$o = '' ;
- if ( $rc_last_oldid != 0 ) {
- $o = 'oldid='.$rc_last_oldid ;
+ if ( $rc_this_oldid != 0 ) {
+ $o = 'oldid='.$rc_this_oldid ;
}
if ( $rc_type == RC_LOG ) {
$link = $rcObj->timestamp;