r46282 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46281‎ | r46282 | r46283 >
Date:20:39, 26 January 2009
Author:aaron
Status:ok
Tags:
Comment:
Add getPrecedence() convenience function
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -219,6 +219,27 @@
220220 }
221221 }
222222
 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+
223244 ################# Parsing functions #################
224245
225246 /**
@@ -777,17 +798,7 @@
778799 ## 2 = pristine -> quality -> stable;
779800 ## 1 = quality -> stable
780801 ## 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();
792803 return array( 'select' => $select, 'override' => $override, 'expiry' => 'infinity' );
793804 }
794805 return array('select' => $row->fpc_select, 'override' => $row->fpc_override,

Status & tagging log