r50297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50296‎ | r50297 | r50298 >
Date:02:55, 7 May 2009
Author:aaron
Status:ok
Tags:
Comment:
Line breaks & formatting tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -246,7 +246,12 @@
247247 # Reader feedback tags, positive and negative. [a-zA-Z] tag names only.
248248 # Each tag has five levels, which 3 being average. The tag names are
249249 # mapped to their weight. This is used to determine the "worst"/"best" pages.
250 -$wgFlaggedRevsFeedbackTags = array( 'reliability' => 3, 'completeness' => 2, 'npov' => 2, 'presentation' => 1 );
 250+$wgFlaggedRevsFeedbackTags = array(
 251+ 'reliability' => 3,
 252+ 'completeness' => 2,
 253+ 'npov' => 2,
 254+ 'presentation' => 1
 255+);
251256 # How many seconds back should the average rating for a page be based on?
252257 $wgFlaggedRevsFeedbackAge = 7 * 24 * 3600;
253258 # How long before stats page is updated?
@@ -531,7 +536,7 @@
532537 $wgAjaxExportList[] = 'RevisionReview::AjaxReview';
533538
534539 // Defaults for prefs
535 -$wgDefaultUserOptions['flaggedrevssimpleui'] = $wgSimpleFlaggedRevsUI;
 540+$wgDefaultUserOptions['flaggedrevssimpleui'] = (int)$wgSimpleFlaggedRevsUI;
536541 $wgDefaultUserOptions['flaggedrevsstable'] = true;
537542
538543 # Cache update
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -986,9 +986,12 @@
987987 if( $article->getTitle()->isContentPage() ) {
988988 $pages = explode( ',', trim($p['uniqueContentPages']) ); // page IDs
989989 # Don't let this get bloated for no reason
990 - if( count($pages) < $wgFlaggedRevsAutopromote['uniqueContentPages'] && !in_array($article->getId(),$pages) ) {
 990+ if( count($pages) < $wgFlaggedRevsAutopromote['uniqueContentPages']
 991+ && !in_array($article->getId(),$pages) )
 992+ {
991993 $pages[] = $article->getId();
992 - $p['uniqueContentPages'] = preg_replace('/^,/','',implode(',',$pages)); // clear any garbage
 994+ // Clear out any formatting garbage
 995+ $p['uniqueContentPages'] = preg_replace('/^,/','',implode(',',$pages));
993996 }
994997 $p['totalContentEdits'] += 1;
995998 $changed = true;
@@ -1246,7 +1249,9 @@
12471250 * @param string $t timestamp of the log entry
12481251 * @return bool true
12491252 */
1250 - public static function reviewLogLine( $type='', $action='', $title=null, $paramArray=array(), &$c, &$r ) {
 1253+ public static function reviewLogLine( $type='', $action='', $title=null,
 1254+ $paramArray=array(), &$c, &$r )
 1255+ {
12511256 $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2');
12521257 # Show link to page with oldid=x
12531258 if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) {
@@ -1542,9 +1547,11 @@
15431548 if( empty($wgTitle) || $wgTitle->getNamespace() !== NS_SPECIAL ) {
15441549 return true; // nothing to do here
15451550 }
 1551+ if( !$wgUser->isAllowed('review') )
 1552+ return true; // not relevant to user
15461553 $watchlist = SpecialPage::getTitleFor( 'Watchlist' );
15471554 $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' );
1548 - if( $wgUser->isAllowed('review') && ($wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges)) ) {
 1555+ if( $wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges) ) {
15491556 $dbr = wfGetDB( DB_SLAVE );
15501557 $watchedOutdated = $dbr->selectField( array('watchlist','page','flaggedpages'), '1',
15511558 array( 'wl_user' => $wgUser->getId(),
@@ -1559,8 +1566,10 @@
15601567 wfMsgExt('flaggedrevs-watched-pending',array('parseinline')) . "</div>";
15611568 # Otherwise, give a notice if there is a large backlog in general
15621569 } else {
1563 - $pages = $dbr->estimateRowCount( 'page', '*', array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ );
1564 - $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', 'fp_pending_since IS NOT NULL', __METHOD__ );
 1570+ $pages = $dbr->estimateRowCount( 'page', '*',
 1571+ array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ );
 1572+ $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*',
 1573+ 'fp_pending_since IS NOT NULL', __METHOD__ );
15651574 if( ($unreviewed/$pages) > .02 ) {
15661575 wfLoadExtensionMessages( 'FlaggedRevs' );
15671576 $notice .= "<div id='mw-oldreviewed-notice' class='plainlinks fr-backlognotice'>" .
@@ -1576,7 +1585,9 @@
15771586 $tables = array('flaggedpages','page','revision');
15781587 $opts['ORDER BY'] = 'fp_page_id ASC';
15791588 $opts['USE INDEX'] = array( 'flaggedpages' => 'PRIMARY' );
1580 - $join['page'] = array('INNER JOIN',array('page_id = fp_page_id','page_namespace' => $wgFlaggedRevsNamespaces));
 1589+ $join['page'] = array( 'INNER JOIN',
 1590+ array('page_id = fp_page_id','page_namespace' => $wgFlaggedRevsNamespaces)
 1591+ );
15811592 $join['revision'] = array('INNER JOIN','rev_page = fp_page_id AND rev_id = fp_stable');
15821593 return false; // final
15831594 }

Status & tagging log