r44039 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44038‎ | r44039 | r44040 >
Date:17:10, 29 November 2008
Author:aaron
Status:deferred
Tags:
Comment:
(bug 16489) Add "diff to last sighted version" to recent changes
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -408,6 +408,9 @@
409409 $wgHooks['PageHistoryLineEnding'][] = 'FlaggedRevsHooks::addToHistLine';
410410 $wgHooks['LocalFile::getHistory'][] = 'FlaggedRevsHooks::addToFileHistQuery';
411411 $wgHooks['ImagePageFileHistoryLine'][] = 'FlaggedRevsHooks::addToFileHistLine';
 412+# Mark items in RC
 413+$wgHooks['SpecialRecentChangesQuery'][] = 'FlaggedRevsHooks::addToRCQuery';
 414+$wgHooks['ChangesListInsertArticleLink'][] = 'FlaggedRevsHooks::addToRCLine';
412415 # Mark items in user contribs
413416 $wgHooks['ContribsPager::getQueryInfo'][] = 'FlaggedRevsHooks::addToContribsQuery';
414417 $wgHooks['ContributionsLineEnding'][] = 'FlaggedRevsHooks::addToContribsLine';
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -199,6 +199,8 @@
200200 'revreview-typefilter' => 'Type:',
201201 'revreview-tagfilter' => 'Tag:',
202202
 203+ 'revreview-reviewlink' => 'review',
 204+
203205 'tooltip-ca-current' => 'View the current draft of this page',
204206 'tooltip-ca-stable' => 'View the stable version of this page',
205207 'tooltip-ca-default' => 'Quality assurance settings',
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1205,6 +1205,12 @@
12061206 return true;
12071207 }
12081208
 1209+ public static function addToRCQuery( &$conds, &$tables, &$join_conds, $opts ) {
 1210+ $tables[] = 'flaggedpages';
 1211+ $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
 1212+ return true;
 1213+ }
 1214+
12091215 public static function addToHistLine( &$history, $row, &$s ) {
12101216 return FlaggedArticle::getInstance( $history->getArticle() )->addToHistLine( $history, $row, $s );
12111217 }
@@ -1225,6 +1231,19 @@
12261232 return true;
12271233 }
12281234
 1235+ public static function addToRCLine( &$list, &$articlelink, &$s, &$rc, $unpatrolled, $watched ) {
 1236+ global $wgUser;
 1237+ if( $rc->getTitle()->getNamespace() < 0 || !isset($rc->mAttribs['fp_stable']) )
 1238+ return true; // reviewed pages only
 1239+ if( $unpatrolled && $wgUser->isAllowed('review') ) {
 1240+ wfLoadExtensionMessages( 'FlaggedRevs' );
 1241+ $rlink = $list->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg('revreview-reviewlink'),
 1242+ 'oldid='.intval($rc->mAttribs['fp_stable']).'&diff=cur' );
 1243+ $articlelink .= " ($rlink)";
 1244+ }
 1245+ return true;
 1246+ }
 1247+
12291248 public static function injectReviewDiffURLParams( &$article, &$sectionAnchor, &$extraQuery ) {
12301249 return FlaggedArticle::getInstance( $article )->injectReviewDiffURLParams( $sectionAnchor, $extraQuery );
12311250 }

Status & tagging log