From f10d65f0a3b716b7cc90f4aacec388e21f8ef644 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 16 Dec 2005 23:56:44 +0000 Subject: [PATCH] * (bug 4298) Include rc_id on enhanced RC singleton diff links for patrolling * Did some refactoring on ChangesList.php merging dupe code oh man this changes list code is nasty --- RELEASE-NOTES | 2 + includes/ChangesList.php | 579 ++++++++++++++++++++++----------------- 2 files changed, 326 insertions(+), 255 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8128a9aad4..58ac9332c3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -326,6 +326,8 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 349) Fix for some numeric differences not being highlighted patch by Andrius Ramanauskas * Removed FulltextStoplist.php, no longer used (was for MySQL 3.x workaround) +* (bug 4298) Include rc_id on enhanced RC singleton diff links for patrolling +* Did some refactoring on ChangesList.php merging dupe code === Caveats === diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 9e5e4b1282..7f9c9f4465 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -22,7 +22,7 @@ class ChangesList { function newFromUser( &$user ) { $sk =& $user->getSkin(); - if ( $user->getOption('usenewrc') ) { + if( $user->getOption('usenewrc') ) { return new EnhancedChangesList( $sk ); } else { return new OldChangesList( $sk ); @@ -59,9 +59,9 @@ class ChangesList { * Returns text for the start of the tabular part of RC */ function beginRecentChangesList() { - $this->rc_cache = array() ; + $this->rc_cache = array(); $this->rcMoveIndex = 0; - $this->rcCacheIndex = 0 ; + $this->rcCacheIndex = 0; $this->lastdate = ''; $this->rclistOpen = false; return ''; @@ -69,87 +69,13 @@ class ChangesList { /** * Returns text for the end of RC - * If enhanced RC is in use, returns pretty much all the text */ function endRecentChangesList() { - $s = $this->recentChangesBlock() ; if( $this->rclistOpen ) { - $s .= "\n"; - } - return $s; - } - - /** - * Enhanced RC ungrouped line. - * @return string a HTML formated line (generated using $r) - */ - function recentChangesBlockLine ( $rcObj ) { - global $wgStylePath, $wgContLang ; - - # Get rc_xxxx variables - extract( $rcObj->mAttribs ) ; - $curIdEq = 'curid='.$rc_cur_id; - - $r = '' ; - - # Spacer image - $r .= '' ; - - # Flag and Timestamp - $r .= '' ; - - if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { - $r .= '   '; + return "\n"; } else { - $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled ); - } - $r .= ' '.$rcObj->timestamp.' ' ; - - # Article link - $link = $rcObj->link ; - // FIXME: should be handled with a css class - if ( $rcObj->watched ) $link = ''.$link.'' ; - $r .= $link ; - - # Diff - $r .= ' ('. $rcObj->difflink .'; ' ; - - # Hist - $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' ); - - # User/talk - $r .= ') . . '.$rcObj->userlink . $rcObj->usertalklink ; - - # Comment - if ( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { - $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() ); - } - - if ($rcObj->numberofWatchingusers > 0) { - $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rcObj->numberofWatchingusers)); - } - - $r .= "
\n" ; - return $r ; - } - - /** - * If enhanced RC is in use, this function takes the previously cached - * RC lines, arranges them, and outputs the HTML - */ - function recentChangesBlock () { - global $wgStylePath ; - if ( count ( $this->rc_cache ) == 0 ) return '' ; - $blockOut = ''; - foreach ( $this->rc_cache AS $secureName => $block ) { - if ( count ( $block ) < 2 ) { - $blockOut .= $this->recentChangesBlockLine ( array_shift ( $block ) ) ; - } else { - $blockOut .= $this->recentChangesBlockGroup ( $block ) ; - } + return ''; } - - return '
'.$blockOut.'
' ; } @@ -172,8 +98,10 @@ class ChangesList { # Make date header if necessary $date = $wgLang->date( $rc_timestamp, true, true ); $s = ''; - if ( $date != $this->lastdate ) { - if ( '' != $this->lastdate ) { $s .= "\n"; } + if( $date != $this->lastdate ) { + if( '' != $this->lastdate ) { + $s .= "\n"; + } $s .= '

'.$date."

\n