if ( $block[0]->mAttribs['rc_log_type'] ) {
# Log entry
$classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
- . $block[0]->mAttribs['rc_log_type'] . '-' . $block[0]->mAttribs['rc_title'] );
+ . $block[0]->mAttribs['rc_log_type'] . '-' . $block[0]->mAttribs['rc_title'] );
} else {
$classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns'
- . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] );
+ . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] );
}
$classes[] = $block[0]->watched && $block[0]->mAttribs['rc_timestamp'] >= $block[0]->watched
? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
} else {
$link = Linker::linkKnown(
- $rcObj->getTitle(),
- $rcObj->timestamp,
- array(),
- $params
- );
+ $rcObj->getTitle(),
+ $rcObj->timestamp,
+ array(),
+ $params
+ );
if ( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) {
$link = '<span class="history-deleted">' . $link . '</span> ';
}
$encUrl = htmlspecialchars( $wgStylePath . '/common/images/Arr_' . $dir . '.png' );
$encAlt = htmlspecialchars( $alt );
$encTitle = htmlspecialchars( $title );
+
return "<img src=\"$encUrl\" width=\"12\" height=\"12\" alt=\"$encAlt\" title=\"$encTitle\" />";
}
*/
protected function sideArrow() {
$dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
+
return $this->arrow( $dir, '+', $this->msg( 'rc-enhanced-expand' )->text() );
}
if ( $logType ) {
# Log entry
$classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
- . $logType . '-' . $rcObj->mAttribs['rc_title'] );
+ . $logType . '-' . $rcObj->mAttribs['rc_title'] );
} else {
$classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns' .
- $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] );
+ $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] );
}
$classes[] = $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched
? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
* @return string
*/
protected function recentChangesBlock() {
- if ( count ( $this->rc_cache ) == 0 ) {
+ if ( count( $this->rc_cache ) == 0 ) {
return '';
}
public function endRecentChangesList() {
return $this->recentChangesBlock() . parent::endRecentChangesList();
}
-
}
public static function newFromRow( $row ) {
$rc = new RecentChange;
$rc->loadFromRow( $row );
+
return $rc;
}
$rc->loadFromCurRow( $row );
$rc->notificationtimestamp = false;
$rc->numberofWatchingusers = false;
+
return $rc;
}
if ( $this->mTitle === false ) {
$this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
}
+
return $this->mTitle;
}
$this->mPerformer = User::newFromName( $this->mAttribs['rc_user_text'], false );
}
}
+
return $this->mPerformer;
}
*/
public static function cleanupForIRC( $text ) {
wfDeprecated( __METHOD__, '1.22' );
+
return IRCColourfulRCFeedFormatter::cleanupForIRC( $text );
}
if ( !$change instanceof RecentChange ) {
return null;
}
+
return $change->doMarkPatrolled( $wgUser, $auto );
}
// Log this patrol event
PatrolLog::record( $this, $auto, $user );
wfRunHooks( 'MarkPatrolledComplete', array( $this->getAttribute( 'rc_id' ), &$user, false ) );
+
return array();
}
// Invalidate the page cache after the page has been patrolled
// to make sure that the Patrol link isn't visible any longer!
$this->getTitle()->invalidateCache();
+
return $dbw->affectedRows();
}
$rc->mTitle = $title;
$rc->mPerformer = $user;
$rc->mAttribs = array(
- 'rc_timestamp' => $timestamp,
- 'rc_namespace' => $title->getNamespace(),
- 'rc_title' => $title->getDBkey(),
- 'rc_type' => RC_EDIT,
- 'rc_source' => self::SRC_EDIT,
- 'rc_minor' => $minor ? 1 : 0,
- 'rc_cur_id' => $title->getArticleID(),
- 'rc_user' => $user->getId(),
- 'rc_user_text' => $user->getName(),
- 'rc_comment' => $comment,
+ 'rc_timestamp' => $timestamp,
+ 'rc_namespace' => $title->getNamespace(),
+ 'rc_title' => $title->getDBkey(),
+ 'rc_type' => RC_EDIT,
+ 'rc_source' => self::SRC_EDIT,
+ 'rc_minor' => $minor ? 1 : 0,
+ 'rc_cur_id' => $title->getArticleID(),
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_comment' => $comment,
'rc_this_oldid' => $newId,
'rc_last_oldid' => $oldId,
- 'rc_bot' => $bot ? 1 : 0,
- 'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => intval( $patrol ),
- 'rc_new' => 0, # obsolete
- 'rc_old_len' => $oldSize,
- 'rc_new_len' => $newSize,
- 'rc_deleted' => 0,
- 'rc_logid' => 0,
- 'rc_log_type' => null,
+ 'rc_bot' => $bot ? 1 : 0,
+ 'rc_ip' => self::checkIPAddress( $ip ),
+ 'rc_patrolled' => intval( $patrol ),
+ 'rc_new' => 0, # obsolete
+ 'rc_old_len' => $oldSize,
+ 'rc_new_len' => $newSize,
+ 'rc_deleted' => 0,
+ 'rc_logid' => 0,
+ 'rc_log_type' => null,
'rc_log_action' => '',
- 'rc_params' => ''
+ 'rc_params' => ''
);
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => $lastTimestamp,
- 'oldSize' => $oldSize,
- 'newSize' => $newSize,
- 'pageStatus' => 'changed'
+ 'oldSize' => $oldSize,
+ 'newSize' => $newSize,
+ 'pageStatus' => 'changed'
);
$rc->save();
+
return $rc;
}
$rc->mTitle = $title;
$rc->mPerformer = $user;
$rc->mAttribs = array(
- 'rc_timestamp' => $timestamp,
- 'rc_namespace' => $title->getNamespace(),
- 'rc_title' => $title->getDBkey(),
- 'rc_type' => RC_NEW,
- 'rc_source' => self::SRC_NEW,
- 'rc_minor' => $minor ? 1 : 0,
- 'rc_cur_id' => $title->getArticleID(),
- 'rc_user' => $user->getId(),
- 'rc_user_text' => $user->getName(),
- 'rc_comment' => $comment,
- 'rc_this_oldid' => $newId,
- 'rc_last_oldid' => 0,
- 'rc_bot' => $bot ? 1 : 0,
- 'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => intval( $patrol ),
- 'rc_new' => 1, # obsolete
- 'rc_old_len' => 0,
- 'rc_new_len' => $size,
- 'rc_deleted' => 0,
- 'rc_logid' => 0,
- 'rc_log_type' => null,
- 'rc_log_action' => '',
- 'rc_params' => ''
+ 'rc_timestamp' => $timestamp,
+ 'rc_namespace' => $title->getNamespace(),
+ 'rc_title' => $title->getDBkey(),
+ 'rc_type' => RC_NEW,
+ 'rc_source' => self::SRC_NEW,
+ 'rc_minor' => $minor ? 1 : 0,
+ 'rc_cur_id' => $title->getArticleID(),
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_comment' => $comment,
+ 'rc_this_oldid' => $newId,
+ 'rc_last_oldid' => 0,
+ 'rc_bot' => $bot ? 1 : 0,
+ 'rc_ip' => self::checkIPAddress( $ip ),
+ 'rc_patrolled' => intval( $patrol ),
+ 'rc_new' => 1, # obsolete
+ 'rc_old_len' => 0,
+ 'rc_new_len' => $size,
+ 'rc_deleted' => 0,
+ 'rc_logid' => 0,
+ 'rc_log_type' => null,
+ 'rc_log_action' => '',
+ 'rc_params' => ''
);
$rc->mExtra = array(
'pageStatus' => 'created'
);
$rc->save();
+
return $rc;
}
$rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
$target, $logComment, $params, $newId, $actionCommentIRC );
$rc->save();
+
return true;
}
$rc->mTitle = $target;
$rc->mPerformer = $user;
$rc->mAttribs = array(
- 'rc_timestamp' => $timestamp,
- 'rc_namespace' => $target->getNamespace(),
- 'rc_title' => $target->getDBkey(),
- 'rc_type' => RC_LOG,
- 'rc_source' => self::SRC_LOG,
- 'rc_minor' => 0,
- 'rc_cur_id' => $target->getArticleID(),
- 'rc_user' => $user->getId(),
- 'rc_user_text' => $user->getName(),
- 'rc_comment' => $logComment,
+ 'rc_timestamp' => $timestamp,
+ 'rc_namespace' => $target->getNamespace(),
+ 'rc_title' => $target->getDBkey(),
+ 'rc_type' => RC_LOG,
+ 'rc_source' => self::SRC_LOG,
+ 'rc_minor' => 0,
+ 'rc_cur_id' => $target->getArticleID(),
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_comment' => $logComment,
'rc_this_oldid' => 0,
'rc_last_oldid' => 0,
- 'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot', true ) : 0,
- 'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => 1,
- 'rc_new' => 0, # obsolete
- 'rc_old_len' => null,
- 'rc_new_len' => null,
- 'rc_deleted' => 0,
- 'rc_logid' => $newId,
- 'rc_log_type' => $type,
+ 'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot', true ) : 0,
+ 'rc_ip' => self::checkIPAddress( $ip ),
+ 'rc_patrolled' => 1,
+ 'rc_new' => 0, # obsolete
+ 'rc_old_len' => null,
+ 'rc_new_len' => null,
+ 'rc_deleted' => 0,
+ 'rc_logid' => $newId,
+ 'rc_log_type' => $type,
'rc_log_action' => $action,
- 'rc_params' => $params
+ 'rc_params' => $params
);
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => 0,
'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage
- 'pageStatus' => $pageStatus,
+ 'pageStatus' => $pageStatus,
'actionCommentIRC' => $actionCommentIRC
);
+
return $rc;
}
} else {
$trail = '';
}
+
return $trail;
}
if ( $old === null || $new === null ) {
return '';
}
+
return ChangesList::showCharacterDifference( $old, $new );
}
$method = __METHOD__;
$dbw = wfGetDB( DB_MASTER );
- $dbw->onTransactionIdle( function() use ( $dbw, $method ) {
+ $dbw->onTransactionIdle( function () use ( $dbw, $method ) {
global $wgRCMaxAge;
$cutoff = $dbw->timestamp( time() - $wgRCMaxAge );
$ip = '';
}
}
+
return $ip;
}
*/
public static function isInRCLifespan( $timestamp, $tolerance = 0 ) {
global $wgRCMaxAge;
+
return wfTimestamp( TS_UNIX, $timestamp ) > time() - $tolerance - $wgRCMaxAge;
}
}