From 28de6d99d21c90d554345f64650d95d62bbc8fea Mon Sep 17 00:00:00 2001 From: "Nicholas Pisarro, Jr" Date: Fri, 10 Dec 2004 04:49:27 +0000 Subject: New feature: You can edit summaries and change the Minor Edit flag. * Documented at http://meta.wikimedia.org/wiki/Feature_to_edit_summaries --- includes/ChangesList.php | 58 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) (limited to 'includes/ChangesList.php') diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 7e9807b2b905..45fef5ff39b2 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -92,9 +92,20 @@ class ChangesList { $r .= $rcObj->usertalklink ; # Comment - if ( $rc_comment != '' && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { - $rc_comment=$this->skin->formatComment($rc_comment, $rcObj->getTitle()); - $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' ); + if ( ($rc_comment != '' || $rc_type == RC_EDIT_COMMENT) && + $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { + + $rc_comment = $this->skin->formatComment($rc_comment, $rcObj->getTitle()); + + # If a summary comment change, we want to form the message "was ($rc_moved_to_title) + # now ($rc_comment)". + if ( $rc_type == RC_EDIT_COMMENT ) { + $rc_comment = $wgContLang->emphasize( '(' . $rc_comment . ')' ); + $rc_moved_to_title = $this->skin->formatComment( $rc_moved_to_title, $rcObj->getTitle() ); + $rc_moved_to_title = $wgContLang->emphasize( '(' . $rc_moved_to_title . ')' ); + $r .= ' ' . wfMsg( 'ecrccommentformat', $rc_moved_to_title, $rc_comment ); + } else + $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' ); } $r .= "
\n" ; @@ -324,6 +335,20 @@ class ChangesList { $msg = ( $rc_type == RC_MOVE ) ? '1movedto2' : '1movedto2_redir'; $s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); + } else if ( $rc_type == RC_EDIT_COMMENT ) { + # Diff + $s .= '(' . wfMsg( 'diff' ) . ') ('; + # History link + $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' ); + $s .= ') . . '; + + # M and ! (minor and unpatrolled) + if ( $rc_minor ) { $s .= ''.$message["minoreditletter"].' '; } + if ( !$rc_patrolled ) { $s .= '! '; } + + # Put a link to the revision the comment is for, in a message. + $s .= wfMsg( "eccommentchanged" , + $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no&oldid=' . $rc_this_oldid ) ); } elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) { # Log updates, etc $logtype = $matches[1]; @@ -408,9 +433,20 @@ class ChangesList { if($userTalkLink) $s.=' ('.$userTalkLink.')'; # Add comment - if ( '' != $rc_comment && '*' != $rc_comment && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { - $rc_comment = $this->skin->formatComment($rc_comment,$rc->getTitle()); - $s .= $wgContLang->emphasize(' (' . $rc_comment . ')'); + if ( (('' != $rc_comment && '*' != $rc_comment) || $rc_type == RC_EDIT_COMMENT) && + $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { + + $rc_comment = $this->skin->formatComment( $rc_comment, $rc->getTitle() ); + + # If a summary comment change, we want to form the message "was ($rc_moved_to_title) + # now ($rc_comment)". + if ( $rc_type == RC_EDIT_COMMENT ) { + $rc_comment = $wgContLang->emphasize( '(' . $rc_comment . ')' ); + $rc_moved_to_title = $this->skin->formatComment( $rc_moved_to_title, $rc->getTitle() ); + $rc_moved_to_title = $wgContLang->emphasize( '(' . $rc_moved_to_title . ')' ); + $s .= ' ' . wfMsg( 'ecrccommentformat', $rc_moved_to_title, $rc_comment ); + } else + $s .= $wgContLang->emphasize(' (' . $rc_comment . ')'); } $s .= "\n"; @@ -461,6 +497,10 @@ class ChangesList { $msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir"; $clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); + } else if ( $rc_type == RC_EDIT_COMMENT ) { + # Put a link to the revision the comment is for, in a message. + $clink = wfMsg( "eccommentchanged" , + $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no&oldid=' . $rc_this_oldid ) ); } elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) { # Log updates, etc $logtype = $matches[1]; @@ -485,7 +525,9 @@ class ChangesList { } else { $rcIdQuery = ''; } - if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { + if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || + $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT || + $rc_type == RC_EDIT_COMMENT) { $curLink = $message['cur']; $diffLink = $message['diff']; } else { @@ -543,7 +585,7 @@ class ChangesList { # Page moves go on their own line $title = $rc->getTitle(); $secureName = $title->getPrefixedDBkey(); - if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { + if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT || $rc_type == RC_EDIT_COMMENT ) { # Use an @ character to prevent collision with page names $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc); } else { -- cgit v1.2.3