58 $user = $this->context->getUser();
65 $cacheEntry->watched = $cacheEntry->mAttribs[
'rc_type'] ==
RC_LOG ? false : $watched;
66 $cacheEntry->numberofWatchingusers = $baseRC->numberofWatchingusers;
68 $cacheEntry->link = $this->
buildCLink( $cacheEntry );
75 $cacheEntry->difflink = $this->
buildDiffLink( $cacheEntry, $showDiffLinks );
76 $cacheEntry->curlink = $this->
buildCurLink( $cacheEntry, $showDiffLinks );
77 $cacheEntry->lastlink = $this->
buildLastLink( $cacheEntry, $showDiffLinks );
80 $cacheEntry->userlink = $this->
getUserLink( $cacheEntry );
84 $cacheEntry->mAttribs[
'rc_user'],
85 $cacheEntry->mAttribs[
'rc_user_text'],
116 $type = $cacheEntry->mAttribs[
'rc_type'];
119 if ( $cacheEntry->unpatrolled &&
$type ==
RC_NEW ) {
120 $clink = $this->linkRenderer->makeKnownLink( $cacheEntry->
getTitle() );
123 $logType = $cacheEntry->mAttribs[
'rc_log_type'];
128 wfDebugLog(
'recentchanges',
'Unexpected log entry with no log type in recent changes' );
129 $clink = $this->linkRenderer->makeLink( $cacheEntry->
getTitle() );
132 } elseif ( $cacheEntry->mAttribs[
'rc_namespace'] ==
NS_SPECIAL ) {
133 wfDebugLog(
'recentchanges',
'Unexpected special page in recentchanges' );
137 $clink = $this->linkRenderer->makeKnownLink( $cacheEntry->
getTitle() );
144 $logtitle = SpecialPage::getTitleFor(
'Log', $logType );
145 $logpage =
new LogPage( $logType );
146 $logname = $logpage->getName()->text();
148 $logLink = $this->context->msg(
'parentheses' )
150 $this->linkRenderer->makeKnownLink( $logtitle, $logname )
162 return $this->context->getLanguage()->userTime(
163 $cacheEntry->mAttribs[
'rc_timestamp'],
164 $this->context->getUser()
175 'curid' => $recentChange->mAttribs[
'rc_cur_id'],
177 'oldid' => $recentChange->mAttribs[
'rc_this_oldid']
192 if ( !$showDiffLinks || in_array( $cacheEntry->mAttribs[
'rc_type'], $logTypes ) ) {
193 $curLink = $curMessage;
195 $curUrl = htmlspecialchars( $cacheEntry->
getTitle()->getLinkURL( $queryParams ) );
196 $curLink =
"<a class=\"mw-changeslist-diff-cur\" href=\"$curUrl\">$curMessage</a>";
209 'curid' => $recentChange->mAttribs[
'rc_cur_id'],
210 'diff' => $recentChange->mAttribs[
'rc_this_oldid'],
211 'oldid' => $recentChange->mAttribs[
'rc_last_oldid']
226 if ( !$showDiffLinks ) {
227 $diffLink = $diffMessage;
228 } elseif ( in_array( $cacheEntry->mAttribs[
'rc_type'], $logTypes ) ) {
229 $diffLink = $diffMessage;
232 $pageTitle = Title::newFromID( $rcCurId );
233 if ( $pageTitle ===
null ) {
234 wfDebugLog(
'RCCacheEntryFactory',
'Could not get Title for rc_cur_id: ' . $rcCurId );
237 $diffUrl = htmlspecialchars( $pageTitle->getLinkURL( $queryParams ) );
238 $diffLink =
"<a class=\"mw-changeslist-diff\" href=\"$diffUrl\">$diffMessage</a>";
240 $diffUrl = htmlspecialchars( $cacheEntry->
getTitle()->getLinkURL( $queryParams ) );
241 $diffLink =
"<a class=\"mw-changeslist-diff\" href=\"$diffUrl\">$diffMessage</a>";
256 $lastOldid = $cacheEntry->mAttribs[
'rc_last_oldid'];
258 $type = $cacheEntry->mAttribs[
'rc_type'];
262 if ( !$showDiffLinks || !$lastOldid || in_array(
$type, $logTypes ) ) {
263 $lastLink = $lastMessage;
265 $lastLink = $this->linkRenderer->makeKnownLink(
268 [
'class' =>
'mw-changeslist-diff' ],
283 $userLink =
' <span class="history-deleted">' .
284 $this->context->msg(
'rev-deleted-user' )->escaped() .
'</span>';
287 $cacheEntry->mAttribs[
'rc_user'],
288 $cacheEntry->mAttribs[
'rc_user_text'],
302 return $this->messages[$key];
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
static userCan( $rc, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this revision,...
static isUnpatrolled( $rc, User $user)
static isDeleted( $rc, $field)
Determine if said field of a revision is hidden.
static getLocal( $username)
Get local part of the user name.
Marks HTML that shouldn't be escaped.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null, $useParentheses=true)
Generate standard user tool links (talk, contributions, block link, etc.)
Class to simplify the use of log pages.
LinkRenderer $linkRenderer
buildCLink(RCCacheEntry $cacheEntry)
buildCurQueryParams(RecentChange $recentChange)
buildDiffLink(RecentChange $cacheEntry, $showDiffLinks)
buildLastLink(RecentChange $cacheEntry, $showDiffLinks)
Builds the link to the previous version.
buildTimestamp(RecentChange $cacheEntry)
getUserLink(RecentChange $cacheEntry)
buildDiffQueryParams(RecentChange $recentChange)
showDiffLinks(RecentChange $cacheEntry, User $user)
buildCurLink(RecentChange $cacheEntry, $showDiffLinks)
newFromRecentChange(RecentChange $baseRC, $watched)
__construct(IContextSource $context, $messages, LinkRenderer $linkRenderer)
static newFromParent( $rc)
Utility class for creating new RC entries.
getAttribute( $name)
Get an attribute value.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Interface for objects which can provide a MediaWiki context on request.