Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -408,6 +408,9 @@ |
409 | 409 | $wgHooks['PageHistoryLineEnding'][] = 'FlaggedRevsHooks::addToHistLine'; |
410 | 410 | $wgHooks['LocalFile::getHistory'][] = 'FlaggedRevsHooks::addToFileHistQuery'; |
411 | 411 | $wgHooks['ImagePageFileHistoryLine'][] = 'FlaggedRevsHooks::addToFileHistLine'; |
| 412 | +# Mark items in RC |
| 413 | +$wgHooks['SpecialRecentChangesQuery'][] = 'FlaggedRevsHooks::addToRCQuery'; |
| 414 | +$wgHooks['ChangesListInsertArticleLink'][] = 'FlaggedRevsHooks::addToRCLine'; |
412 | 415 | # Mark items in user contribs |
413 | 416 | $wgHooks['ContribsPager::getQueryInfo'][] = 'FlaggedRevsHooks::addToContribsQuery'; |
414 | 417 | $wgHooks['ContributionsLineEnding'][] = 'FlaggedRevsHooks::addToContribsLine'; |
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -199,6 +199,8 @@ |
200 | 200 | 'revreview-typefilter' => 'Type:', |
201 | 201 | 'revreview-tagfilter' => 'Tag:', |
202 | 202 | |
| 203 | + 'revreview-reviewlink' => 'review', |
| 204 | + |
203 | 205 | 'tooltip-ca-current' => 'View the current draft of this page', |
204 | 206 | 'tooltip-ca-stable' => 'View the stable version of this page', |
205 | 207 | 'tooltip-ca-default' => 'Quality assurance settings', |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1205,6 +1205,12 @@ |
1206 | 1206 | return true; |
1207 | 1207 | } |
1208 | 1208 | |
| 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 | + |
1209 | 1215 | public static function addToHistLine( &$history, $row, &$s ) { |
1210 | 1216 | return FlaggedArticle::getInstance( $history->getArticle() )->addToHistLine( $history, $row, $s ); |
1211 | 1217 | } |
— | — | @@ -1225,6 +1231,19 @@ |
1226 | 1232 | return true; |
1227 | 1233 | } |
1228 | 1234 | |
| 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 | + |
1229 | 1248 | public static function injectReviewDiffURLParams( &$article, &$sectionAnchor, &$extraQuery ) { |
1230 | 1249 | return FlaggedArticle::getInstance( $article )->injectReviewDiffURLParams( $sectionAnchor, $extraQuery ); |
1231 | 1250 | } |