<?php
/**
- * Classes to show various lists of changes:
+ * Classes to show lists of changes.
+ *
+ * These can be:
* - watchlist
* - related changes
* - recent changes
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
*/
* This first argument used to be an User object.
*
* @deprecated in 1.18; use newFromContext() instead
- * @param $unused Unused
+ * @param $unused string|User Unused
* @return ChangesList|EnhancedChangesList|OldChangesList derivative
*/
public static function newFromUser( $unused ) {
+ wfDeprecated( __METHOD__, '1.18' );
return self::newFromContext( RequestContext::getMain() );
}
$fastCharDiff[$code] = $wgMiserMode || wfMsgNoTrans( 'rc-change-size' ) === '$1';
}
- $formatedSize = $wgLang->formatNum($szdiff);
+ $formattedSize = $wgLang->formatNum($szdiff);
if ( !$fastCharDiff[$code] ) {
- $formatedSize = wfMsgExt( 'rc-change-size', array( 'parsemag', 'escape' ), $formatedSize );
+ $formattedSize = wfMsgExt( 'rc-change-size', array( 'parsemag' ), $formattedSize );
}
if( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
} else {
$tag = 'span';
}
- if( $szdiff === 0 ) {
- return "<$tag class='mw-plusminus-null'>($formatedSize)</$tag>";
- } elseif( $szdiff > 0 ) {
- return "<$tag class='mw-plusminus-pos'>(+$formatedSize)</$tag>";
- } else {
- return "<$tag class='mw-plusminus-neg'>($formatedSize)</$tag>";
+
+ if ( $szdiff === 0 ) {
+ $formattedSizeClass = 'mw-plusminus-null';
+ }
+ if ( $szdiff > 0 ) {
+ $formattedSize = '+' . $formattedSize;
+ $formattedSizeClass = 'mw-plusminus-pos';
+ }
+ if ( $szdiff < 0 ) {
+ $formattedSizeClass = 'mw-plusminus-neg';
}
+
+ $formattedTotalSize = wfMsgExt( 'rc-change-size-new', 'parsemag', $wgLang->formatNum( $new ) );
+
+ return Html::element( $tag,
+ array( 'dir' => 'ltr', 'class' => $formattedSizeClass, 'title' => $formattedTotalSize ),
+ wfMessage( 'parentheses', $formattedSize )->plain() ) . $wgLang->getDirMark();
}
/**
public function insertDateHeader( &$s, $rc_timestamp ) {
# Make date header if necessary
- $date = $this->getLang()->date( $rc_timestamp, true, true );
+ $date = $this->getLanguage()->date( $rc_timestamp, true, true );
if( $date != $this->lastdate ) {
if( $this->lastdate != '' ) {
$s .= "</ul>\n";
public function insertLog( &$s, $title, $logtype ) {
$page = new LogPage( $logtype );
$logname = $page->getName()->escaped();
- $s .= '(' . Linker::linkKnown( $title, $logname ) . ')';
+ $s .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $title, $logname ) )->escaped();
}
/**
* @param $s
* @param $rc RecentChange
* @param $unpatrolled
- * @return void
*/
public function insertDiffHist( &$s, &$rc, $unpatrolled ) {
# Diff link
if( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
$diffLink = $this->message['diff'];
- } elseif( !self::userCan($rc,Revision::DELETED_TEXT) ) {
+ } elseif ( !self::userCan( $rc, Revision::DELETED_TEXT, $this->getUser() ) ) {
$diffLink = $this->message['diff'];
} else {
$query = array(
$query
);
}
- $s .= '(' . $diffLink . $this->message['pipe-separator'];
+ $diffhist = $diffLink . $this->message['pipe-separator'];
# History link
- $s .= Linker::linkKnown(
+ $diffhist .= Linker::linkKnown(
$rc->getTitle(),
$this->message['hist'],
array(),
'action' => 'history'
)
);
- $s .= ') . . ';
+ $s .= $this->msg( 'parentheses' )->rawParams( $diffhist )->escaped() . ' . . ';
}
/**
* @param $rc RecentChange
* @param $unpatrolled
* @param $watched
- * @return void
*/
public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
# If it's a new article, there is no diff link, but if it hasn't been
$params['rcid'] = $rc->mAttribs['rc_id'];
}
+ $articlelink = Linker::linkKnown(
+ $rc->getTitle(),
+ null,
+ array(),
+ $params
+ );
if( $this->isDeleted($rc,Revision::DELETED_TEXT) ) {
- $articlelink = Linker::linkKnown(
- $rc->getTitle(),
- null,
- array(),
- $params
- );
$articlelink = '<span class="history-deleted">' . $articlelink . '</span>';
- } else {
- $articlelink = ' '. Linker::linkKnown(
- $rc->getTitle(),
- null,
- array(),
- $params
- );
}
# Bolden pages watched by this user
if( $watched ) {
$articlelink = "<strong class=\"mw-watched\">{$articlelink}</strong>";
}
# RTL/LTR marker
- $articlelink .= $this->getLang()->getDirMark();
+ $articlelink .= $this->getLanguage()->getDirMark();
wfRunHooks( 'ChangesListInsertArticleLink',
array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched) );
/**
* @param $s
* @param $rc RecentChange
- * @return void
*/
public function insertTimestamp( &$s, $rc ) {
$s .= $this->message['semicolon-separator'] .
- $this->getLang()->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
+ $this->getLanguage()->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
}
- /** Insert links to user page, user talk page and eventually a blocking link
+ /**
+ * Insert links to user page, user talk page and eventually a blocking link
*
- * @param $rc RecentChange
+ * @param &$s String HTML to update
+ * @param &$rc RecentChange
*/
public function insertUserRelatedLinks( &$s, &$rc ) {
if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
$s .= ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>';
} else {
- $s .= Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
+ $s .= $this->getLanguage()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'],
+ $rc->mAttribs['rc_user_text'] );
$s .= Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
}
}
- /** insert a formatted action
+ /**
+ * Insert a formatted action
*
* @param $rc RecentChange
+ * @return string
*/
public function insertLogEntry( $rc ) {
$formatter = LogFormatter::newFromRow( $rc->mAttribs );
$formatter->setShowUserToolLinks( true );
- $mark = $this->getLang()->getDirMark();
+ $mark = $this->getLanguage()->getDirMark();
return $formatter->getActionText() . " $mark" . $formatter->getComment();
}
+ /**
+ * Insert a formatted comment
+ * @param $rc RecentChange
+ * @return string
+ */
+ public function insertComment( $rc ) {
+ if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
+ if( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
+ return ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
+ } else {
+ return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
+ }
+ }
+ }
+
/**
* Check whether to enable recent changes patrol features
* @return Boolean
/**
* Returns the string which indicates the number of watching users
+ * @return string
*/
protected function numberofWatchingusers( $count ) {
static $cache = array();
if( $count > 0 ) {
if( !isset( $cache[$count] ) ) {
$cache[$count] = wfMsgExt( 'number_of_watching_users_RCview',
- array('parsemag', 'escape' ), $this->getLang()->formatNum( $count ) );
+ array('parsemag', 'escape' ), $this->getLanguage()->formatNum( $count ) );
}
return $cache[$count];
} else {
* field of this revision, if it's marked as deleted.
* @param $rc RCCacheEntry
* @param $field Integer
+ * @param $user User object to check, or null to use $wgUser
* @return Boolean
*/
- public static function userCan( $rc, $field ) {
+ public static function userCan( $rc, $field, User $user = null ) {
if( $rc->mAttribs['rc_type'] == RC_LOG ) {
- return LogEventsList::userCanBitfield( $rc->mAttribs['rc_deleted'], $field );
+ return LogEventsList::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
} else {
- return Revision::userCanBitfield( $rc->mAttribs['rc_deleted'], $field );
+ return Revision::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
}
}
+ /**
+ * @param $link string
+ * @param $watched bool
+ * @return string
+ */
protected function maybeWatchedLink( $link, $watched = false ) {
if( $watched ) {
return '<strong class="mw-watched">' . $link . '</strong>';
/** Inserts a rollback link
*
- * @param $s
+ * @param $s string
* @param $rc RecentChange
*/
public function insertRollback( &$s, &$rc ) {
}
/**
- * @param $s
+ * @param $s string
* @param $rc RecentChange
* @param $classes
- * @return
*/
public function insertTags( &$s, &$rc, &$classes ) {
if ( empty($rc->mAttribs['ts_tags']) )
public function insertExtra( &$s, &$rc, &$classes ) {
## Empty, used for subclassers to add anything special.
}
+
+ protected function showAsUnpatrolled( RecentChange $rc ) {
+ $unpatrolled = false;
+ if ( !$rc->mAttribs['rc_patrolled'] ) {
+ if ( $this->getUser()->useRCPatrol() ) {
+ $unpatrolled = true;
+ } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_new'] ) {
+ $unpatrolled = true;
+ }
+ }
+ return $unpatrolled;
+ }
}
* Format a line using the old system (aka without any javascript).
*
* @param $rc RecentChange
+ * @return string
*/
public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
global $wgRCShowChangedSize;
wfProfileIn( __METHOD__ );
+
# Should patrol-related stuff be shown?
- $unpatrolled = $this->getUser()->useRCPatrol() && !$rc->mAttribs['rc_patrolled'];
+ $unpatrolled = $this->showAsUnpatrolled( $rc );
$dateheader = ''; // $s now contains only <li>...</li>, for hooks' convenience.
$this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
if( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
// Log entries
} elseif( $rc->mAttribs['rc_log_type'] ) {
- $logtitle = Title::newFromText( 'Log/'.$rc->mAttribs['rc_log_type'], NS_SPECIAL );
+ $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
$this->insertLog( $s, $logtitle, $rc->mAttribs['rc_log_type'] );
// Log entries (old format) or log targets, and special pages
} elseif( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
# User tool links
$this->insertUserRelatedLinks( $s, $rc );
# LTR/RTL direction mark
- $s .= $this->getLang()->getDirMark();
+ $s .= $this->getLanguage()->getDirMark();
+ $s .= $this->insertComment( $rc );
}
# Tags
# How many users watch this page
if( $rc->numberofWatchingusers > 0 ) {
$s .= ' ' . wfMsgExt( 'number_of_watching_users_RCview',
- array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $rc->numberofWatchingusers ) );
+ array( 'parsemag', 'escape' ), $this->getLanguage()->formatNum( $rc->numberofWatchingusers ) );
}
if( $this->watchlist ) {
* Generate a list of changes using an Enhanced system (uses javascript).
*/
class EnhancedChangesList extends ChangesList {
+
+ protected $rc_cache;
+
/**
* Add the JavaScript file for enhanced changeslist
* @return String
$curIdEq = array( 'curid' => $rc->mAttribs['rc_cur_id'] );
# If it's a new day, add the headline and flush the cache
- $date = $this->getLang()->date( $rc->mAttribs['rc_timestamp'], true );
+ $date = $this->getLanguage()->date( $rc->mAttribs['rc_timestamp'], true );
$ret = '';
if( $date != $this->lastdate ) {
# Process current cache
}
# Should patrol-related stuff be shown?
- if( $this->getUser()->useRCPatrol() ) {
- $rc->unpatrolled = !$rc->mAttribs['rc_patrolled'];
- } else {
- $rc->unpatrolled = false;
- }
+ $rc->unpatrolled = $this->showAsUnpatrolled( $rc );
$showdifflinks = true;
# Make article link
} elseif( $type == RC_LOG ) {
if( $logType ) {
$logtitle = SpecialPage::getTitleFor( 'Log', $logType );
- $clink = '(' . Linker::linkKnown( $logtitle,
- LogPage::logName( $logType ) ) . ')';
+ $logpage = new LogPage( $logType );
+ $logname = $logpage->getName()->escaped();
+ $clink = $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped();
} else {
$clink = Linker::link( $rc->getTitle() );
}
$watched = false;
// Log entries (old format) and special pages
} elseif( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
- list( $specialName, $logtype ) = SpecialPageFactory::resolveAlias( $rc->mAttribs['rc_title'] );
- if ( $specialName == 'Log' ) {
- # Log updates, etc
- $logname = LogPage::logName( $logtype );
- $clink = '(' . Linker::linkKnown( $rc->getTitle(), $logname ) . ')';
- } else {
- wfDebug( "Unexpected special page in recentchanges\n" );
- $clink = '';
- }
+ wfDebug( "Unexpected special page in recentchanges\n" );
+ $clink = '';
// Edits
} else {
$clink = Linker::linkKnown( $rc->getTitle() );
}
# Don't show unusable diff links
- if ( !ChangesList::userCan($rc,Revision::DELETED_TEXT) ) {
+ if ( !ChangesList::userCan( $rc, Revision::DELETED_TEXT, $this->getUser() ) ) {
$showdifflinks = false;
}
- $time = $this->getLang()->time( $rc->mAttribs['rc_timestamp'], true, true );
+ $time = $this->getLanguage()->time( $rc->mAttribs['rc_timestamp'], true, true );
$rc->watched = $watched;
$rc->link = $clink;
$rc->timestamp = $time;
if ( $type != RC_NEW ) {
$curLink = $this->message['cur'];
} else {
- $curUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querycur ) );
+ $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) );
$curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
}
$diffLink = $this->message['diff'];
} else {
- $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querydiff ) );
- $curUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querycur ) );
+ $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querydiff ) );
+ $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) );
$diffLink = "<a href=\"$diffUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['diff']}</a>";
$curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
}
/**
* Enhanced RC group
+ * @return string
*/
protected function recentChangesBlockGroup( $block ) {
global $wgRCShowChangedSize;
# Add the namespace and title of the block as part of the class
if ( $block[0]->mAttribs['rc_log_type'] ) {
# Log entry
- $classes = 'mw-collapsible mw-collapsed mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-log-' . $block[0]->mAttribs['rc_log_type'] . '-' . $block[0]->mAttribs['rc_title'] );
+ $classes = 'mw-collapsible mw-collapsed mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-log-'
+ . $block[0]->mAttribs['rc_log_type'] . '-' . $block[0]->mAttribs['rc_title'] );
} else {
- $classes = 'mw-collapsible mw-collapsed mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-ns' . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] );
+ $classes = 'mw-collapsible mw-collapsed mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-ns'
+ . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] );
}
$r = Html::openElement( 'table', array( 'class' => $classes ) ) .
Html::openElement( 'tr' );
$users = array();
foreach( $userlinks as $userlink => $count) {
$text = $userlink;
- $text .= $this->getLang()->getDirMark();
+ $text .= $this->getLanguage()->getDirMark();
if( $count > 1 ) {
- $text .= ' (' . $this->getLang()->formatNum( $count ) . '×)';
+ $text .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped();
}
array_push( $users, $text );
}
- $users = ' <span class="changedby">[' .
- implode( $this->message['semicolon-separator'], $users ) . ']</span>';
+ $users = ' <span class="changedby">'
+ . $this->getContext()->msg( 'brackets' )->rawParams(
+ implode( $this->message['semicolon-separator'], $users )
+ )->plain() . '</span>';
- # Title for <a> tags
- $expandTitle = htmlspecialchars( wfMsg( 'rc-enhanced-expand' ) );
- $closeTitle = htmlspecialchars( wfMsg( 'rc-enhanced-hide' ) );
-
- $tl = "<span class='mw-collapsible-toggle'>"
- . "<span class='mw-rc-openarrow'>"
- . "<a href='#' title='$expandTitle'>{$this->sideArrow()}</a>"
- . "</span><span class='mw-rc-closearrow'>"
- . "<a href='#' title='$closeTitle'>{$this->downArrow()}</a>"
- . "</span></span>";
+ $tl = '<span class="mw-collapsible-toggle mw-enhancedchanges-arrow"></span>';
$r .= "<td>$tl</td>";
# Main line
$this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched );
}
- $r .= $this->getLang()->getDirMark();
+ $r .= $this->getLanguage()->getDirMark();
$queryParams['curid'] = $curId;
# Changes message
$n = count($block);
static $nchanges = array();
if ( !isset( $nchanges[$n] ) ) {
- $nchanges[$n] = wfMsgExt( 'nchanges', array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $n ) );
+ $nchanges[$n] = wfMsgExt( 'nchanges', array( 'parsemag', 'escape' ), $this->getLanguage()->formatNum( $n ) );
}
# Total change link
$r .= ' ';
+ $logtext = '';
if( !$allLogs ) {
- $r .= '(';
- if( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT ) ) {
- $r .= $nchanges[$n];
+ if( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
+ $logtext .= $nchanges[$n];
} elseif( $isnew ) {
- $r .= $nchanges[$n];
+ $logtext .= $nchanges[$n];
} else {
$params = $queryParams;
$params['diff'] = $currentRevision;
$params['oldid'] = $oldid;
- $r .= Linker::link(
+ $logtext .= Linker::link(
$block[0]->getTitle(),
$nchanges[$n],
array(),
if( $allLogs ) {
// don't show history link for logs
} elseif( $namehidden || !$block[0]->getTitle()->exists() ) {
- $r .= $this->message['pipe-separator'] . $this->message['hist'] . ')';
+ $logtext .= $this->message['pipe-separator'] . $this->message['hist'];
} else {
$params = $queryParams;
$params['action'] = 'history';
- $r .= $this->message['pipe-separator'] .
+ $logtext .= $this->message['pipe-separator'] .
Linker::linkKnown(
$block[0]->getTitle(),
$this->message['hist'],
array(),
$params
- ) . ')';
+ );
+ }
+
+ if( $logtext !== '' ) {
+ $r .= $this->msg( 'parentheses' )->rawParams( $logtext )->escaped();
}
+
$r .= ' . . ';
# Character difference (does not apply if only log items)
$classes = array();
$type = $rcObj->mAttribs['rc_type'];
- #$r .= '<tr><td valign="top">'.$this->spacerArrow();
$r .= '<tr><td></td><td class="mw-enhanced-rc">';
$r .= $this->recentChangesFlags( array(
'newpage' => $rcObj->mAttribs['rc_new'],
if( $type == RC_LOG ) {
$link = $rcObj->timestamp;
# Revision link
- } elseif( !ChangesList::userCan($rcObj,Revision::DELETED_TEXT) ) {
+ } elseif( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
$link = '<span class="history-deleted">'.$rcObj->timestamp.'</span> ';
} else {
if ( $rcObj->unpatrolled && $type == RC_NEW) {
$r .= $link . '</span>';
if ( !$type == RC_LOG || $type == RC_NEW ) {
- $r .= ' (';
- $r .= $rcObj->curlink;
- $r .= $this->message['pipe-separator'];
- $r .= $rcObj->lastlink;
- $r .= ')';
+ $r .= ' ' . $this->msg( 'parentheses' )->rawParams( $rcObj->curlink . $this->message['pipe-separator'] . $rcObj->lastlink )->escaped();
}
$r .= ' . . ';
# User links
$r .= $rcObj->userlink;
$r .= $rcObj->usertalklink;
+ $r .= $this->insertComment( $rcObj );
}
# Rollback
* @return String: HTML <img> tag
*/
protected function sideArrow() {
- global $wgContLang;
- $dir = $wgContLang->isRTL() ? 'l' : 'r';
+ global $wgLang;
+ $dir = $wgLang->isRTL() ? 'l' : 'r';
return $this->arrow( $dir, '+', wfMsg( 'rc-enhanced-expand' ) );
}
* Enhanced RC ungrouped line.
*
* @param $rcObj RecentChange
- * @return String: a HTML formated line (generated using $r)
+ * @return String: a HTML formatted line (generated using $r)
*/
protected function recentChangesBlockLine( $rcObj ) {
global $wgRCShowChangedSize;
$logType = $rcObj->mAttribs['rc_log_type'];
if( $logType ) {
# Log entry
- $classes = 'mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-log-' . $logType . '-' . $rcObj->mAttribs['rc_title'] );
+ $classes = 'mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-log-'
+ . $logType . '-' . $rcObj->mAttribs['rc_title'] );
} else {
- $classes = 'mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-ns' . $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] );
+ $classes = 'mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-ns' .
+ $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] );
}
$r = Html::openElement( 'table', array( 'class' => $classes ) ) .
Html::openElement( 'tr' );
- $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow();
+ $r .= '<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow mw-enhancedchanges-arrow-space"></span>';
# Flag and Timestamp
if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
$r .= '    '; // 4 flags -> 4 spaces
} else {
$r .= $this->recentChangesFlags( array(
'newpage' => $type == RC_NEW,
- 'mino' => $rcObj->mAttribs['rc_minor'],
+ 'minor' => $rcObj->mAttribs['rc_minor'],
'unpatrolled' => $rcObj->unpatrolled,
'bot' => $rcObj->mAttribs['rc_bot'],
) );
if( $logType ) {
$logtitle = SpecialPage::getTitleFor( 'Log', $logType );
$logname = LogPage::logName( $logType );
- $r .= '(' . Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) . ')';
+ $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) )->escaped();
} else {
$this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched );
}
# Diff and hist links
if ( $type != RC_LOG ) {
- $r .= ' ('. $rcObj->difflink . $this->message['pipe-separator'];
$query['action'] = 'history';
- $r .= Linker::linkKnown(
+ $r .= ' ' . $this->msg( 'parentheses' )->rawParams( $rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown(
$rcObj->getTitle(),
$this->message['hist'],
array(),
$query
- ) . ')';
+ ) )->escaped();
}
$r .= ' . . ';
# Character diff
$r .= $this->insertLogEntry( $rcObj );
} else {
$r .= ' '.$rcObj->userlink . $rcObj->usertalklink;
+ $r .= $this->insertComment( $rcObj );
+ $r .= $this->insertRollback( $r, $rcObj );
}
# Tags
/**
* Returns text for the end of RC
* If enhanced RC is in use, returns pretty much all the text
+ * @return string
*/
public function endRecentChangesList() {
return $this->recentChangesBlock() . parent::endRecentChangesList();