58 $user = $this->context->getUser();
63 $cacheEntry->unpatrolled = ChangesList::isUnpatrolled( $baseRC, $user );
65 $cacheEntry->watched = $cacheEntry->mAttribs[
'rc_type'] ==
RC_LOG ? false : $watched;
66 $cacheEntry->numberofWatchingusers = $baseRC->numberofWatchingusers;
67 $cacheEntry->watchlistExpiry = $baseRC->watchlistExpiry;
69 $cacheEntry->link = $this->
buildCLink( $cacheEntry );
76 $cacheEntry->difflink = $this->
buildDiffLink( $cacheEntry, $showDiffLinks );
77 $cacheEntry->curlink = $this->
buildCurLink( $cacheEntry, $showDiffLinks );
78 $cacheEntry->lastlink = $this->
buildLastLink( $cacheEntry, $showDiffLinks );
81 $cacheEntry->userlink = $this->
getUserLink( $cacheEntry );
83 if ( !ChangesList::isDeleted( $cacheEntry, RevisionRecord::DELETED_USER ) ) {
85 $cacheEntry->mAttribs[
'rc_user'],
86 $cacheEntry->mAttribs[
'rc_user_text'],
108 return ChangesList::userCan( $cacheEntry, RevisionRecord::DELETED_TEXT, $user );
117 $type = $cacheEntry->mAttribs[
'rc_type'];
120 if ( $cacheEntry->unpatrolled &&
$type ==
RC_NEW ) {
121 $clink = $this->linkRenderer->makeKnownLink( $cacheEntry->
getTitle() );
124 $logType = $cacheEntry->mAttribs[
'rc_log_type'];
129 wfDebugLog(
'recentchanges',
'Unexpected log entry with no log type in recent changes' );
130 $clink = $this->linkRenderer->makeLink( $cacheEntry->
getTitle() );
133 } elseif ( $cacheEntry->mAttribs[
'rc_namespace'] ==
NS_SPECIAL ) {
134 wfDebugLog(
'recentchanges',
'Unexpected special page in recentchanges' );
138 $clink = $this->linkRenderer->makeKnownLink( $cacheEntry->
getTitle() );
146 $logpage =
new LogPage( $logType );
147 $logname = $logpage->getName()->text();
149 $logLink = $this->context->msg(
'parentheses' )
151 $this->linkRenderer->makeKnownLink( $logtitle, $logname )
163 return $this->context->getLanguage()->userTime(
164 $cacheEntry->mAttribs[
'rc_timestamp'],
165 $this->context->getUser()
176 'curid' => $recentChange->mAttribs[
'rc_cur_id'],
178 'oldid' => $recentChange->mAttribs[
'rc_this_oldid']
193 if ( !$showDiffLinks || in_array( $cacheEntry->mAttribs[
'rc_type'], $logTypes ) ) {
194 $curLink = $curMessage;
196 $curUrl = htmlspecialchars( $cacheEntry->
getTitle()->getLinkURL( $queryParams ) );
197 $curLink =
"<a class=\"mw-changeslist-diff-cur\" href=\"$curUrl\">$curMessage</a>";
210 'curid' => $recentChange->mAttribs[
'rc_cur_id'],
211 'diff' => $recentChange->mAttribs[
'rc_this_oldid'],
212 'oldid' => $recentChange->mAttribs[
'rc_last_oldid']
227 if ( !$showDiffLinks ) {
228 $diffLink = $diffMessage;
229 } elseif ( in_array( $cacheEntry->mAttribs[
'rc_type'], $logTypes ) ) {
230 $diffLink = $diffMessage;
233 $pageTitle = Title::newFromID( $rcCurId );
234 if ( $pageTitle ===
null ) {
235 wfDebugLog(
'RCCacheEntryFactory',
'Could not get Title for rc_cur_id: ' . $rcCurId );
238 $diffUrl = htmlspecialchars( $pageTitle->getLinkURL( $queryParams ) );
239 $diffLink =
"<a class=\"mw-changeslist-diff\" href=\"$diffUrl\">$diffMessage</a>";
241 $diffUrl = htmlspecialchars( $cacheEntry->
getTitle()->getLinkURL( $queryParams ) );
242 $diffLink =
"<a class=\"mw-changeslist-diff\" href=\"$diffUrl\">$diffMessage</a>";
257 $lastOldid = $cacheEntry->mAttribs[
'rc_last_oldid'];
259 $type = $cacheEntry->mAttribs[
'rc_type'];
263 if ( !$showDiffLinks || !$lastOldid || in_array(
$type, $logTypes ) ) {
264 $lastLink = $lastMessage;
266 $lastLink = $this->linkRenderer->makeKnownLink(
269 [
'class' =>
'mw-changeslist-diff' ],
283 if ( ChangesList::isDeleted( $cacheEntry, RevisionRecord::DELETED_USER ) ) {
284 $userLink =
' <span class="history-deleted">' .
285 $this->context->msg(
'rev-deleted-user' )->escaped() .
'</span>';
288 $cacheEntry->mAttribs[
'rc_user'],
289 $cacheEntry->mAttribs[
'rc_user_text'],
290 ExternalUserNames::getLocal( $cacheEntry->mAttribs[
'rc_user_text'] )
303 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.
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.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
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.