r50043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50042‎ | r50043 | r50044 >
Date:15:14, 29 April 2009
Author:aaron
Status:ok
Tags:
Comment:
Cleaned up addToHistLine() perms and $skin var cruft.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -1150,10 +1150,16 @@
11511151 * @param Row $row, from history page
11521152 * @returns array (string,string)
11531153 */
1154 - public static function markHistoryRow( $title, $row, $skin ) {
1155 - if( isset($row->fr_quality) && isset($row->fr_flags) ) {
 1154+ public static function markHistoryRow( $title, $row ) {
 1155+ global $wgUser;
 1156+ if( !isset($row->fr_quality) ) {
 1157+ return array("",""); // not reviewed
 1158+ }
 1159+ $css = FlaggedRevsXML::getQualityColor( $row->fr_quality );
 1160+ if( $row->rev_deleted & Revision::DELETED_USER ) {
 1161+ $link = "";
 1162+ } else {
11561163 wfLoadExtensionMessages( 'FlaggedRevs' );
1157 - $css = FlaggedRevsXML::getQualityColor( $row->fr_quality );
11581164 $user = User::whois( $row->fr_user ); // FIXME: o(N)
11591165 $flags = explode(',',$row->fr_flags);
11601166 if( in_array('auto',$flags) ) {
@@ -1164,8 +1170,6 @@
11651171 $st = $title->getPrefixedDBkey();
11661172 $link = "<span class='fr-$msg plainlinks'>[" .
11671173 wfMsgExt($msg,array('parseinline'),$st,$row->rev_id,$user) . "]</span>";
1168 - } else {
1169 - return array("","");
11701174 }
11711175 return array($link,$css);
11721176 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1418,15 +1418,14 @@
14191419 }
14201420
14211421 public static function addToHistLine( &$history, $row, &$s ) {
1422 - global $wgUser;
14231422 if( $row->rev_deleted & Revision::DELETED_TEXT )
14241423 return true; // Don't bother showing notice for deleted revs
1425 - $skin = $wgUser->getSkin();
14261424 # Add link to stable version of *this* rev, if any
1427 - list($link,$class) = FlaggedRevs::markHistoryRow( $history->getArticle()->getTitle(), $row, $skin );
1428 - if( $link ) {
1429 - $s = "<span class='$class'>$s</span> <small>$link</small>";
1430 - }
 1425+ list($link,$class) = FlaggedRevs::markHistoryRow( $history->getArticle()->getTitle(), $row );
 1426+ # Style the row as needed
 1427+ if( $class ) $s = "<span class='$class'>$s</span>";
 1428+ # Add stable old version link
 1429+ if( $link ) $s .= " <small>$link</small>";
14311430 return true;
14321431 }
14331432

Status & tagging log