Index: trunk/extensions/FlaggedRevs/business/FRGenericSubmitForm.php |
— | — | @@ -67,6 +67,29 @@ |
68 | 68 | } |
69 | 69 | |
70 | 70 | /* |
| 71 | + * Preload existing params from a DB (e.g. for GET request). |
| 72 | + * @return mixed (true on success, error string on failure) |
| 73 | + */ |
| 74 | + public function preload() { |
| 75 | + if ( !$this->inputLock ) { |
| 76 | + throw new MWException( __CLASS__ . " input fields not set yet.\n"); |
| 77 | + } |
| 78 | + $status = $this->doCheckTarget(); |
| 79 | + if ( $status !== true ) { |
| 80 | + return $status; // bad target |
| 81 | + } |
| 82 | + return $this->doPreloadParameters(); |
| 83 | + } |
| 84 | + |
| 85 | + /* |
| 86 | + * Preload existing params from a DB (e.g. for GET request). |
| 87 | + * @return mixed (true on success, error string on failure) |
| 88 | + */ |
| 89 | + protected function doPreloadParameters() { |
| 90 | + return true; |
| 91 | + } |
| 92 | + |
| 93 | + /* |
71 | 94 | * Check that the target is valid (e.g. from GET/POST request) |
72 | 95 | * @param int $flags ON_SUBMISSION (set on submit) |
73 | 96 | * @return mixed (true on success, error string on failure) |
Index: trunk/extensions/FlaggedRevs/business/PageStabilityForm.php |
— | — | @@ -122,26 +122,19 @@ |
123 | 123 | * Preload existing page settings (e.g. from GET request). |
124 | 124 | * @return mixed (true on success, error string on failure) |
125 | 125 | */ |
126 | | - public function preloadSettings() { |
127 | | - if ( !$this->inputLock ) { |
128 | | - throw new MWException( __CLASS__ . " input fields not set yet.\n"); |
129 | | - } |
130 | | - $status = $this->doCheckTarget(); |
131 | | - if ( $status !== true ) { |
132 | | - return $status; // bad target |
133 | | - } |
| 126 | + public function doPreloadParameters() { |
134 | 127 | if ( $this->oldConfig['expiry'] == Block::infinity() ) { |
135 | 128 | $this->expirySelection = 'infinite'; // no settings set OR indefinite |
136 | 129 | } else { |
137 | 130 | $this->expirySelection = 'existing'; // settings set and NOT indefinite |
138 | 131 | } |
139 | | - return $this->reallyPreloadSettings(); // load the params... |
| 132 | + return $this->reallyDoPreloadParameters(); // load the params... |
140 | 133 | } |
141 | 134 | |
142 | 135 | /* |
143 | 136 | * @return mixed (true on success, error string on failure) |
144 | 137 | */ |
145 | | - protected function reallyPreloadSettings() { |
| 138 | + protected function reallyDoPreloadParameters() { |
146 | 139 | return true; |
147 | 140 | } |
148 | 141 | |
— | — | @@ -372,7 +365,7 @@ |
373 | 366 | $this->trySet( $this->override, $value ); |
374 | 367 | } |
375 | 368 | |
376 | | - protected function reallyPreloadSettings() { |
| 369 | + protected function reallyDoPreloadParameters() { |
377 | 370 | $this->override = $this->oldConfig['override']; |
378 | 371 | $this->autoreview = $this->oldConfig['autoreview']; |
379 | 372 | $this->watchThis = $this->page->userIsWatching(); |
— | — | @@ -471,7 +464,7 @@ |
472 | 465 | |
473 | 466 | // Assumes $wgFlaggedRevsProtection is on |
474 | 467 | class PageStabilityProtectForm extends PageStabilityForm { |
475 | | - protected function reallyPreloadSettings() { |
| 468 | + protected function reallyDoPreloadParameters() { |
476 | 469 | $this->autoreview = $this->oldConfig['autoreview']; // protect level |
477 | 470 | $this->watchThis = $this->page->userIsWatching(); |
478 | 471 | return true; |
Index: trunk/extensions/FlaggedRevs/specialpages/actions/Stabilization_body.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | } |
79 | 79 | # Form GET request... |
80 | 80 | } else { |
81 | | - $form->preloadSettings(); |
| 81 | + $form->preload(); |
82 | 82 | $this->showForm(); |
83 | 83 | } |
84 | 84 | } |