r56740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56739‎ | r56740 | r56741 >
Date:23:33, 21 September 2009
Author:aaron
Status:ok
Tags:
Comment:
Added forDefaultVersionOnly() convenience function
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -97,6 +97,15 @@
9898 global $wgFlaggedRevsOverride;
9999 return (bool)$wgFlaggedRevsOverride;
100100 }
 101+
 102+ /**
 103+ * Does the review form only show for pages were the stable version is the default?
 104+ * @returns bool
 105+ */
 106+ public static function forDefaultVersionOnly() {
 107+ global $wgFlaggedRevsReviewForDefault;
 108+ return (bool)$wgFlaggedRevsReviewForDefault;
 109+ }
101110
102111 /**
103112 * Should this user ignore the site and page default version settings?
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -131,11 +131,10 @@
132132 );
133133 if( !$row ) return null;
134134 } else {
135 - global $wgFlaggedRevsReviewForDefault;
136135 $row = null;
137136 # Get visiblity settings...
138137 $config = FlaggedRevs::getPageVisibilitySettings( $title, true );
139 - if( !$config['override'] && $wgFlaggedRevsReviewForDefault ) {
 138+ if( !$config['override'] && FlaggedRevs::forDefaultVersionOnly() ) {
140139 return $row; // page is not reviewable; no stable version
141140 }
142141 $dbw = wfGetDB( DB_MASTER );

Status & tagging log