Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1150,10 +1150,16 @@ |
1151 | 1151 | * @param Row $row, from history page |
1152 | 1152 | * @returns array (string,string) |
1153 | 1153 | */ |
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 { |
1156 | 1163 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
1157 | | - $css = FlaggedRevsXML::getQualityColor( $row->fr_quality ); |
1158 | 1164 | $user = User::whois( $row->fr_user ); // FIXME: o(N) |
1159 | 1165 | $flags = explode(',',$row->fr_flags); |
1160 | 1166 | if( in_array('auto',$flags) ) { |
— | — | @@ -1164,8 +1170,6 @@ |
1165 | 1171 | $st = $title->getPrefixedDBkey(); |
1166 | 1172 | $link = "<span class='fr-$msg plainlinks'>[" . |
1167 | 1173 | wfMsgExt($msg,array('parseinline'),$st,$row->rev_id,$user) . "]</span>"; |
1168 | | - } else { |
1169 | | - return array("",""); |
1170 | 1174 | } |
1171 | 1175 | return array($link,$css); |
1172 | 1176 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1418,15 +1418,14 @@ |
1419 | 1419 | } |
1420 | 1420 | |
1421 | 1421 | public static function addToHistLine( &$history, $row, &$s ) { |
1422 | | - global $wgUser; |
1423 | 1422 | if( $row->rev_deleted & Revision::DELETED_TEXT ) |
1424 | 1423 | return true; // Don't bother showing notice for deleted revs |
1425 | | - $skin = $wgUser->getSkin(); |
1426 | 1424 | # 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>"; |
1431 | 1430 | return true; |
1432 | 1431 | } |
1433 | 1432 | |