define( "RC_NEW", 1);
define( "RC_MOVE", 2);
define( "RC_LOG", 3);
+define( "RC_MOVE_OVER_REDIRECT", 4);
+
/*
mAttributes:
}
# Makes an entry in the database corresponding to a rename
- /*static*/ function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' )
+ /*static*/ function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
{
if ( !$ip ) {
global $wgIP;
'rc_cur_time' => $timestamp,
'rc_namespace' => $oldTitle->getNamespace(),
'rc_title' => $oldTitle->getDBkey(),
- 'rc_type' => RC_MOVE,
+ 'rc_type' => $overRedir ? RC_MOVE_OVER_REDIRECT : RC_MOVE,
'rc_minor' => 0,
'rc_cur_id' => $oldTitle->getArticleID(),
'rc_user' => $user->getID(),
$rc->save();
}
+ /* static */ function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
+ RecentChange::notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip, false );
+ }
+
+ /* static */ function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
+ RecentChange::notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', true );
+ }
+
# A log entry is different to an edit in that previous revisions are
# not kept
/*static*/ function notifyLog( $timestamp, &$title, &$user, $comment, $ip='' )
$r .= '<img src="'.$wgStylePath.'/images/Arr_.png" width="12" height="12" border="0" />' ;
$r .= '<tt>' ;
- if ( $rc_type == RC_MOVE ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$r .= ' ';
} else {
# M & N (minor & new)
$r .= $rcObj->usertalklink ;
# Comment
- if ( $rc_comment != '' && $rc_type != RC_MOVE ) {
+ if ( $rc_comment != '' && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
$rc_comment=$this->formatComment($rc_comment);
$r .= $wgLang->emphasize( ' ('.$rc_comment.')' );
}
}
$s .= '<li> ';
- if ( $rc_type == RC_MOVE ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Diff
$s .= '(' . wfMsg( 'diff' ) . ') (';
# Hist
') . . ';
# "[[x]] moved to [[y]]"
-
- $s .= wfMsg( '1movedto2', $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
+ if ( $rc_type == RC_MOVE ) {
+ $msg = '1movedto2';
+ } else {
+ $msg = '1movedto2_redir';
+ }
+ $s .= wfMsg( $msg, $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
-
} else {
# Diff link
if ( $rc_type == RC_NEW || $rc_type == RC_LOG ) {
$fname
);
- RecentChange::notifyMove( $now, $this, $nt, $wgUser, $comment );
+ RecentChange::notifyMoveOverRedirect( $now, $this, $nt, $wgUser, $comment );
# Swap links
);
# Record in RC
- RecentChange::notifyMove( $now, $this, $nt, $wgUser, $comment );
+ RecentChange::notifyMoveToNew( $now, $this, $nt, $wgUser, $comment );
# Purge squid and linkscc as per article creation
Article::onArticleCreate( $nt );
'talkpagemoved' => 'The corresponding talk page was also moved.',
'talkpagenotmoved' => 'The corresponding talk page was <strong>not</strong> moved.',
'1movedto2' => "$1 moved to $2",
+'1movedto2_redir' => '$1 moved to $2 over redirect',
# Export