Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -219,6 +219,27 @@ |
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
| 223 | + /** |
| 224 | + * Get global revision status precedence settings |
| 225 | + * @return int |
| 226 | + */ |
| 227 | + public static function getPrecedence() { |
| 228 | + global $wgFlaggedRevsPrecedence; |
| 229 | + switch( $wgFlaggedRevsPrecedence ) |
| 230 | + { |
| 231 | + case 2: |
| 232 | + $select = FLAGGED_VIS_PRISTINE; |
| 233 | + break; |
| 234 | + case 1: |
| 235 | + $select = FLAGGED_VIS_NORMAL; |
| 236 | + break; |
| 237 | + default: |
| 238 | + $select = FLAGGED_VIS_LATEST; |
| 239 | + break; |
| 240 | + } |
| 241 | + return $select; |
| 242 | + } |
| 243 | + |
223 | 244 | ################# Parsing functions ################# |
224 | 245 | |
225 | 246 | /** |
— | — | @@ -777,17 +798,7 @@ |
778 | 799 | ## 2 = pristine -> quality -> stable; |
779 | 800 | ## 1 = quality -> stable |
780 | 801 | ## 0 = none |
781 | | - switch( $wgFlaggedRevsPrecedence ) { |
782 | | - case 2: |
783 | | - $select = FLAGGED_VIS_PRISTINE; |
784 | | - break; |
785 | | - case 1: |
786 | | - $select = FLAGGED_VIS_NORMAL; |
787 | | - break; |
788 | | - default: |
789 | | - $select = FLAGGED_VIS_LATEST; |
790 | | - break; |
791 | | - } |
| 802 | + $select = self::getPrecedence(); |
792 | 803 | return array( 'select' => $select, 'override' => $override, 'expiry' => 'infinity' ); |
793 | 804 | } |
794 | 805 | return array('select' => $row->fpc_select, 'override' => $row->fpc_override, |