r67620 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67619‎ | r67620 | r67621 >
Date:13:24, 8 June 2010
Author:demon
Status:deferred
Tags:
Comment:
Fix minor TODO note
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiStabilize.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -255,6 +255,17 @@
256256 }
257257
258258 /**
 259+ * Get the appropriate PageStabilityForm depending on whether protection
 260+ * levels are being used
 261+ * @return PageStabilityForm
 262+ */
 263+ public static function getPageStabilityForm() {
 264+ return FlaggedRevs::useProtectionLevels() ?
 265+ new PageStabilityProtectForm() :
 266+ new PageStabilityGeneralForm();
 267+ }
 268+
 269+ /**
259270 * Get the autoreview restriction levels available
260271 * @returns array
261272 */
Index: trunk/extensions/FlaggedRevs/api/ApiStabilize.php
@@ -46,11 +46,9 @@
4747 // We don't care about multiple errors, just report one of them
4848 $this->dieUsageMsg( reset( $errors ) );
4949 }
50 - // TODO: factory function?
51 - $form = FlaggedRevs::useProtectionLevels()
52 - ? new PageStabilityProtectForm()
53 - : new PageStabilityGeneralForm();
5450
 51+ $form = FlaggedRevs::getPageStabilityForm();
 52+
5553 $form->setPage( $title ); # Our target page
5654 $form->setWatchThis( $params['watch'] ); # Watch this page
5755 $form->setReason( $params['reason'] ); # Reason

Status & tagging log