<?php
+/**
+ * @package MediaWiki
+ */
+/**
+ * @package MediaWiki
+ */
class ChangesList {
# Called by history lists and recent changes
#
+ /** @todo document */
function ChangesList( &$skin ) {
$this->skin =& $skin;
}
- # Returns text for the start of the tabular part of RC
+ /**
+ * Returns text for the start of the tabular part of RC
+ */
function beginRecentChangesList() {
$this->rc_cache = array() ;
$this->rcMoveIndex = 0;
$r .= '<tt>' ;
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- $r .= ' ';
+ $r .= ' ';
} else {
# M, N and !
$M = wfMsg( 'minoreditletter' );
$N = wfMsg( 'newpageletter' );
if ( $rc_type == RC_NEW ) {
- $r .= $N ;
+ $r .= '<span class="newpage">' . htmlspecialchars( $N ) . '</span>';
} else {
$r .= ' ' ;
}
if ( $rc_minor ) {
- $r .= $M ;
+ $r .= '<span class="minor">' . htmlspecialchars( $M ) . '</span>';
} else {
$r .= ' ' ;
}
if ( $rcObj->unpatrolled ) {
- $r .= '!';
+ $r .= '<span class="unpatrolled">!</span>';
} else {
$r .= ' ';
}
if ( $rcObj->watched ) $link = '<strong>'.$link.'</strong>' ;
$r .= $link ;
+ if ($rcObj->notificationtimestamp) {
+ $r .= wfMsg( 'updatedmarker' );
+ }
+
# Diff
$r .= ' (' ;
$r .= $rcObj->difflink ;
$r .= $rcObj->usertalklink ;
# Comment
- if ( ($rc_comment != '' || $rc_type == RC_EDIT_COMMENT) &&
- $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
-
- $rc_comment = $this->skin->formatComment($rc_comment, $rcObj->getTitle());
-
- # If a summary comment change, we want to form the message "was ($rc_moved_to_title)
- # now ($rc_comment)".
- if ( $rc_type == RC_EDIT_COMMENT ) {
- $rc_comment = $wgContLang->emphasize( '(' . $rc_comment . ')' );
- $rc_moved_to_title = $this->skin->formatComment( $rc_moved_to_title, $rcObj->getTitle() );
- $rc_moved_to_title = $wgContLang->emphasize( '(' . $rc_moved_to_title . ')' );
- $r .= ' ' . wfMsg( 'ecrccommentformat', $rc_moved_to_title, $rc_comment );
- } else
- $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' );
+ if ( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
+ $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
+ }
+
+ if ($rcObj->numberofWatchingusers > 0) {
+ $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rcObj->numberofWatchingusers));
}
$r .= "<br />\n" ;
if ( $count > 1 ) $text .= " ({$count}×)" ;
array_push ( $users , $text ) ;
}
- $users = ' <font size="-1">['.implode('; ',$users).']</font>' ;
+ $users = ' <span class="changedby">['.implode('; ',$users).']</span>';
# Arrow
$rci = 'RCI'.$this->rcCacheIndex ;
# Main line
# M/N
$r .= '<tt>' ;
- if ( $isnew ) $r .= $N ;
- else $r .= ' ' ;
- $r .= ' ' ; # Minor
+ if ( $isnew ) {
+ $r .= '<span class="newpage">' . htmlspecialchars( $N ) . '</span>';
+ } else {
+ $r .= ' ';
+ }
+ $r .= ' '; # Minor
if ( $unpatrolled ) {
- $r .= "!";
+ $r .= '<span class="unpatrolled">!</span>';
} else {
- $r .= " ";
+ $r .= ' ';
}
# Timestamp
if ( $block[0]->watched ) $link = '<strong>'.$link.'</strong>' ;
$r .= $link ;
+ if ($block[0]->notificationtimestamp) {
+ $r .= wfMsg( 'updatedmarker' );
+ }
+
$curIdEq = 'curid=' . $block[0]->mAttribs['rc_cur_id'];
if ( $block[0]->mAttribs['rc_type'] != RC_LOG ) {
# Changes
}
$r .= $users ;
+
+ if ($block[0]->numberofWatchingusers > 0) {
+ $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($block[0]->numberofWatchingusers));
+ }
$r .= "<br />\n" ;
# Sub-entries
$r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
$r .= '<tt> ' ;
if ( $rc_new ) {
- $r .= $N ;
+ $r .= '<span class="newpage">' . htmlspecialchars( $N ) . '</span>';
} else {
$r .= ' ' ;
}
if ( $rc_minor ) {
- $r .= $M ;
+ $r .= '<span class="minoredit">' . htmlspecialchars( $M ) . '</span>';
} else {
$r .= ' ' ;
}
if ( $rcObj->unpatrolled ) {
- $r .= "!";
+ $r .= '<span class="unpatrolled">!</span>';
} else {
- $r .= " ";
+ $r .= ' ';
}
$r .= ' </tt>' ;
$r .= $rcObj->lastlink ;
$r .= ') . . '.$rcObj->userlink ;
$r .= $rcObj->usertalklink ;
- if ( $rc_comment != '' ) {
- $rc_comment=$this->skin->formatComment($rc_comment, $rcObj->getTitle());
- $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' ) ;
- }
+ $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
$r .= "<br />\n" ;
}
$r .= "</div>\n" ;
* Either returns the line, or caches it for later use
*/
function recentChangesLine( &$rc, $watched = false ) {
- global $wgUser ;
+ global $wgUser;
$usenew = $wgUser->getOption( 'usenewrc' );
if ( $usenew )
$line = $this->recentChangesLineNew ( $rc, $watched ) ;
return $line ;
}
+
function recentChangesLineOld( &$rc, $watched = false ) {
+ global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgRCSeconds, $wgUseRCPatrol,
+ $wgOnlySysopsCanPatrol, $wgSysopUserBans;
+
$fname = 'Skin::recentChangesLineOld';
wfProfileIn( $fname );
-
- global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgRCSeconds, $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
static $message;
if( !isset( $message ) ) {
$curIdEq = 'curid=' . $rc_cur_id;
# Should patrol-related stuff be shown?
- $unpatrolled = $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ $unpatrolled = $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') ) && $rc_patrolled == 0;
# Make date header if necessary
$msg = ( $rc_type == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
$s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
- } else if ( $rc_type == RC_EDIT_COMMENT ) {
- # Diff
- $s .= '(' . wfMsg( 'diff' ) . ') (';
- # History link
- $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
- $s .= ') . . ';
-
- # M and ! (minor and unpatrolled)
- if ( $rc_minor ) { $s .= '<span class="minor">'.$message["minoreditletter"].'</span> '; }
- if ( !$rc_patrolled ) { $s .= '<span class="unpatrolled">!</span> '; }
-
- # Put a link to the revision the comment is for, in a message.
- $s .= wfMsg( "eccommentchanged" ,
- $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no&oldid=' . $rc_this_oldid ) );
} elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
# Log updates, etc
$logtype = $matches[1];
$s .= ') . . ';
# M, N and ! (minor, new and unpatrolled)
- if ( $rc_minor ) { $s .= ' <span class="minor">'.$message["minoreditletter"].'</span>'; }
- if ( $rc_type == RC_NEW ) { $s .= '<span class="newpage">'.$message["newpageletter"].'</span>'; }
- if ( !$rc_patrolled ) { $s .= ' <span class="unpatrolled">!</span>'; }
+ if ( $rc_minor ) { $s .= ' <span class="minor">'.htmlspecialchars( $message["minoreditletter"] ).'</span>'; }
+ if ( $rc_type == RC_NEW ) { $s .= '<span class="newpage">'.htmlspecialchars( $message["newpageletter"] ).'</span>'; }
+ if ( $unpatrolled ) { $s .= ' <span class="unpatrolled">!</span>'; }
# Article link
# If it's a new article, there is no diff link, but if it hasn't been
if ( $watched ) {
$articleLink = '<strong>'.$articleLink.'</strong>';
}
+
+ if ($rc->notificationtimestamp) {
+ $articleLink .= wfMsg( 'updatedmarker' );
+ }
+
$s .= ' '.$articleLink;
wfProfileOut("$fname-page");
}
}
# Block link
$blockLink='';
- if ( ( 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
+ if ( ( $wgSysopUserBans || 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
$blockLinkPage = Title::makeTitle( NS_SPECIAL, 'Blockip' );
$blockLink = $this->skin->makeKnownLinkObj( $blockLinkPage,
$message['blocklink'], 'ip='.$rc_user_text );
if($userTalkLink) $s.=' ('.$userTalkLink.')';
# Add comment
- if ( (('' != $rc_comment && '*' != $rc_comment) || $rc_type == RC_EDIT_COMMENT) &&
- $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
-
- $rc_comment = $this->skin->formatComment( $rc_comment, $rc->getTitle() );
-
- # If a summary comment change, we want to form the message "was ($rc_moved_to_title)
- # now ($rc_comment)".
- if ( $rc_type == RC_EDIT_COMMENT ) {
- $rc_comment = $wgContLang->emphasize( '(' . $rc_comment . ')' );
- $rc_moved_to_title = $this->skin->formatComment( $rc_moved_to_title, $rc->getTitle() );
- $rc_moved_to_title = $wgContLang->emphasize( '(' . $rc_moved_to_title . ')' );
- $s .= ' ' . wfMsg( 'ecrccommentformat', $rc_moved_to_title, $rc_comment );
- } else
- $s .= $wgContLang->emphasize(' (' . $rc_comment . ')');
+ if ( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
+ $s .= $this->skin->commentBlock( $rc_comment, $rc->getTitle() );
+ }
+
+ if ($rc->numberofWatchingusers > 0) {
+ $s .= ' ' . wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rc->numberofWatchingusers));
}
+
$s .= "</li>\n";
wfProfileOut( "$fname-rest" );
}
function recentChangesLineNew( &$baseRC, $watched = false ) {
- global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgRCSeconds;
- global $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
+ global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgRCSeconds,
+ $wgUseRCPatrol, $wgOnlySysopsCanPatrol, $wgSysopUserBans;
static $message;
if( !isset( $message ) ) {
}
# Should patrol-related stuff be shown?
- if ( $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ if ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') )) {
$rc->unpatrolled = !$rc_patrolled;
} else {
$msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
$clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
- } else if ( $rc_type == RC_EDIT_COMMENT ) {
- # Put a link to the revision the comment is for, in a message.
- $clink = wfMsg( "eccommentchanged" ,
- $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no&oldid=' . $rc_this_oldid ) );
} elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
# Log updates, etc
$logtype = $matches[1];
$rc->watched = $watched ;
$rc->link = $clink ;
$rc->timestamp = $time;
+ $rc->notificationtimestamp = $baseRC->notificationtimestamp;
+ $rc->numberofWatchingusers = $baseRC->numberofWatchingusers;
# Make "cur" and "diff" links
$titleObj = $rc->getTitle();
} else {
$rcIdQuery = '';
}
- if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG ||
- $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ||
- $rc_type == RC_EDIT_COMMENT) {
+ if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$curLink = $message['cur'];
$diffLink = $message['diff'];
} else {
$userTalkLink = $this->skin->makeLinkObj( $userTalkPage, $talkname );
global $wgDisableAnonTalk;
- if ( ( 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
+ if ( ( $wgSysopUserBans || 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
$blockPage =& Title::makeTitle( NS_SPECIAL, 'Blockip' );
$blockLink = $this->skin->makeKnownLinkObj( $blockPage,
$message['blocklink'], 'ip='.$rc_user_text );
# Page moves go on their own line
$title = $rc->getTitle();
$secureName = $title->getPrefixedDBkey();
- if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT || $rc_type == RC_EDIT_COMMENT ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Use an @ character to prevent collision with page names
$this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
} else {
}
}
-
-
-?>
+?>
\ No newline at end of file