Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -86,17 +86,13 @@ |
87 | 87 | 'revreview-basic-same' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>.', |
88 | 88 | 'revreview-basic-source' => 'A [{{fullurl:{{FULLPAGENAMEE}}|stableid=$1}} checked version] of this page, [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>, was based off this revision.', |
89 | 89 | 'revreview-failed' => "'''Unable to review this revision.''' The submission was incomplete or otherwise invalid.", |
90 | | - 'revreview-changed' => '\'\'\'The requested action could not be performed on this revision of [[:$1|$1]].\'\'\' |
91 | 90 | |
92 | | -A template or file may have been requested when no specific version was specified. |
93 | | -This can happen if a dynamic template transcludes another file or template depending on a variable that changed since you started reviewing this page. |
94 | | -Refreshing the page and rereviewing can solve this problem.', |
95 | | - |
96 | 91 | 'review_page_invalid' => 'The target page title is invalid.', |
97 | 92 | 'review_page_notexists' => 'The target page does not exist.', |
98 | 93 | 'review_page_unreviewable' => 'The target page is not reviewable.', |
99 | 94 | 'review_no_oldid' => 'No revision ID specified.', |
100 | | - 'review_bad_oldid' => 'There is no such target revision.', |
| 95 | + 'review_bad_oldid' => 'The target revision does not exist.', |
| 96 | + 'review_not_flagged' => 'The target revision is not currently marked as reviewed.', |
101 | 97 | 'review_too_low' => 'Revision cannot be reviewed with some fields left "inadequate".', |
102 | 98 | 'review_bad_key' => 'Invalid inclusion parameter key.', |
103 | 99 | 'review_denied' => 'Permission denied.', |
Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php |
— | — | @@ -219,11 +219,13 @@ |
220 | 220 | { |
221 | 221 | return 'review_too_low'; |
222 | 222 | } |
223 | | - # Special token to discourage fiddling... |
224 | | - $k = self::validationKey( |
225 | | - $this->templateParams, $this->imageParams, $this->fileVersion, $this->oldid ); |
226 | | - if ( $this->validatedParams !== $k ) { |
227 | | - return 'review_bad_key'; |
| 223 | + # Special token to discourage fiddling with template/files... |
| 224 | + if ( $this->isApproval() ) { |
| 225 | + $k = self::validationKey( |
| 226 | + $this->templateParams, $this->imageParams, $this->fileVersion, $this->oldid ); |
| 227 | + if ( $this->validatedParams !== $k ) { |
| 228 | + return 'review_bad_key'; |
| 229 | + } |
228 | 230 | } |
229 | 231 | # Check permissions and validate |
230 | 232 | # FIXME: invalid vs denied |
— | — | @@ -301,7 +303,7 @@ |
302 | 304 | $frev = FlaggedRevision::newFromTitle( $this->page, $this->oldid ); |
303 | 305 | # If we can't find this flagged rev, return to page??? |
304 | 306 | if ( is_null( $frev ) ) { |
305 | | - return 'review_bad_oldid'; |
| 307 | + return 'review_not_flagged'; |
306 | 308 | } |
307 | 309 | $status = $this->unapproveRevision( $frev ); |
308 | 310 | } |
— | — | @@ -938,19 +940,6 @@ |
939 | 941 | return $form; |
940 | 942 | } |
941 | 943 | |
942 | | - public function syncFailureHTML( array $status, $showlinks = false ) { |
943 | | - $form = wfMsgExt( 'revreview-changed', 'parse', $this->page->getPrefixedText() ); |
944 | | - $form .= "<ul>"; |
945 | | - foreach ( $status as $n => $text ) { |
946 | | - $form .= "<li><i>$text</i></li>\n"; |
947 | | - } |
948 | | - $form .= "</ul>"; |
949 | | - if ( $showlinks ) { |
950 | | - $form .= wfMsg( 'returnto', $this->skin->makeLinkObj( $this->page ) ); |
951 | | - } |
952 | | - return $form; |
953 | | - } |
954 | | - |
955 | 944 | private function getSpecialLinks() { |
956 | 945 | $s = '<p>' . wfMsg( 'returnto', |
957 | 946 | $this->skin->makeLinkObj( SpecialPage::getTitleFor( 'UnreviewedPages' ) ) ) . '</p>'; |
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -101,14 +101,7 @@ |
102 | 102 | } else { |
103 | 103 | $wgOut->addHTML( $form->deapprovalSuccessHTML( true ) ); |
104 | 104 | } |
105 | | - // Failure for unflagging |
106 | | - } elseif ( !$form->isApproval() ) { |
107 | | - $wgOut->redirect( $this->page->getFullUrl() ); // already unflagged |
108 | | - // Sync failure for flagging |
109 | | - } elseif ( is_array( $status ) ) { |
110 | | - $wgOut->setPageTitle( wfMsgHtml( 'internalerror' ) ); |
111 | | - $wgOut->addHTML( $form->syncFailureHTML( $status, true ) ); |
112 | | - // Any other fails for flagging... |
| 105 | + // Failure for flagging or unflagging |
113 | 106 | } else { |
114 | 107 | if ( $status === 'review_denied' ) { |
115 | 108 | $wgOut->permissionRequired( 'badaccess-group0' ); // protected? |
— | — | @@ -116,6 +109,8 @@ |
117 | 110 | $wgOut->permissionRequired( 'badaccess-group0' ); // fiddling |
118 | 111 | } elseif ( $status === 'review_bad_oldid' ) { |
119 | 112 | $wgOut->showErrorPage( 'internalerror', 'revreview-revnotfound' ); |
| 113 | + } elseif ( $status === 'review_not_flagged' ) { |
| 114 | + $wgOut->redirect( $this->page->getFullUrl() ); // already unflagged |
120 | 115 | } elseif ( $status === 'review_too_low' ) { |
121 | 116 | $wgOut->addWikiText( wfMsg( 'revreview-toolow' ) ); |
122 | 117 | } else { |
— | — | @@ -223,23 +218,18 @@ |
224 | 219 | } |
225 | 220 | # Try submission... |
226 | 221 | $status = $form->submit(); |
227 | | - # Approve/de-approve success |
| 222 | + # Success... |
228 | 223 | if ( $status === true ) { |
229 | 224 | $tier = FlaggedRevs::getLevelTier( $form->getDims() ) + 1; // shift to 0-3 |
230 | | - if ( $form->isApproval() ) { |
| 225 | + if ( $form->isApproval() ) { // approve |
231 | 226 | return "<suc#><t#$tier>" . $form->approvalSuccessHTML( false ); |
232 | | - } else { |
| 227 | + } else { // de-approve |
233 | 228 | return "<suc#><t#$tier>" . $form->deapprovalSuccessHTML( false ); |
234 | 229 | } |
235 | | - # De-approve failure |
236 | | - } elseif ( !$form->isApproval() ) { |
237 | | - return "<suc#><t#0>"; // failure -> already unflagged |
238 | | - # Approve sync failure |
239 | | - } elseif ( is_array( $status ) ) { |
240 | | - return '<err#>' . $form->syncFailureHTML( $status, false ); |
241 | | - # Other approval failures |
242 | | - } else { // hmmm? |
243 | | - return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' ); |
| 230 | + # Failure... |
| 231 | + } else { |
| 232 | + return '<err#>' . wfMsgExt( 'revreview-failed', 'parse' ) . |
| 233 | + '<p>' . wfMsgHtml( $status ) . '</p>'; |
244 | 234 | } |
245 | 235 | } |
246 | 236 | } |