Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -167,8 +167,10 @@ |
168 | 168 | 'revreview-text2' => '\'\'[[{{MediaWiki:Validationpage}}|Stable versions]] are checked revisions of pages and can be set as the default content for viewers.\'\'', |
169 | 169 | 'revreview-toggle' => '(+/-)', |
170 | 170 | 'revreview-toggle-title' => 'show/hide details', |
171 | | - 'revreview-toolow' => 'You must at least rate each of the below attributes higher than "unapproved" in order for a revision to be considered reviewed. |
172 | | -To deprecate a revision, set all fields to "unapproved".', |
| 171 | + 'revreview-toolow' => '\'\'\'You must at least rate each of the below attributes higher than "unapproved" in order for a revision to be considered reviewed.\'\'\' |
| 172 | +To deprecate a revision, set all fields to "unapproved". |
| 173 | + |
| 174 | +Please hit the "back" button in your browser and try again.', |
173 | 175 | 'revreview-update' => 'Please [[{{MediaWiki:Validationpage}}|review]] any changes \'\'(shown below)\'\' made since the stable revision was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved].<br /> |
174 | 176 | \'\'\'Some templates/files were updated:\'\'\'', |
175 | 177 | 'revreview-update-includes' => '\'\'\'Some templates/files were updated:\'\'\'', |
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -117,14 +117,17 @@ |
118 | 118 | } |
119 | 119 | # We must at least rate each category as 1, the minimum |
120 | 120 | # Exception: we can rate ALL as unapproved to depreciate a revision |
121 | | - $valid = true; |
122 | 121 | if( $this->unapprovedTags && $this->unapprovedTags < count( FlaggedRevs::getDimensions() ) ) { |
123 | | - $valid = false; |
| 122 | + $wgOut->addWikiText( wfMsg( 'revreview-toolow' ) ); |
| 123 | + $wgOut->returnToMain( false, $this->page ); |
| 124 | + return; |
124 | 125 | } elseif( !$wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) ) { |
125 | | - $valid = false; |
| 126 | + $wgOut->addWikiText( wfMsg('sessionfailure') ); |
| 127 | + $wgOut->returnToMain( false, $this->page ); |
| 128 | + return; |
126 | 129 | } |
127 | 130 | # Submit or display info on failure |
128 | | - if( $valid && $wgRequest->wasPosted() ) { |
| 131 | + if( $wgRequest->wasPosted() ) { |
129 | 132 | list($approved,$status) = $this->submit(); |
130 | 133 | // Success for either flagging or unflagging |
131 | 134 | if( $status === true ) { |
— | — | @@ -143,9 +146,6 @@ |
144 | 147 | $wgOut->showErrorPage( 'internalerror', 'revreview-revnotfound' ); |
145 | 148 | $wgOut->returnToMain( false, $this->page ); |
146 | 149 | } |
147 | | - # Show revision and form |
148 | | - } else { |
149 | | - $this->showRevision(); |
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
— | — | @@ -279,114 +279,6 @@ |
280 | 280 | } |
281 | 281 | } |
282 | 282 | |
283 | | - /** |
284 | | - * Show revision review form |
285 | | - */ |
286 | | - private function showRevision() { |
287 | | - global $wgOut, $wgUser, $wgFlaggedRevComments; |
288 | | - |
289 | | - if( $this->unapprovedTags ) |
290 | | - $wgOut->addWikiText( '<strong>' . wfMsg( 'revreview-toolow' ) . '</strong>' ); |
291 | | - |
292 | | - $wgOut->addWikiText( wfMsg( 'revreview-selected', $this->page->getPrefixedText() ) ); |
293 | | - |
294 | | - $rev = Revision::newFromTitle( $this->page, $this->oldid ); |
295 | | - # Check if rev exists |
296 | | - # Do not mess with deleted revisions |
297 | | - if( !isset( $rev ) || $rev->mDeleted ) { |
298 | | - $wgOut->showErrorPage( 'internalerror', 'notargettitle', 'notargettext' ); |
299 | | - return; |
300 | | - } |
301 | | - |
302 | | - $wgOut->addHTML( "<ul>" ); |
303 | | - $wgOut->addHTML( $this->historyLine( $rev ) ); |
304 | | - $wgOut->addHTML( "</ul>" ); |
305 | | - |
306 | | - if( FlaggedRevs::showStableByDefault() ) |
307 | | - $wgOut->addWikiText( wfMsg('revreview-text') ); |
308 | | - |
309 | | - $action = $this->getTitle()->escapeLocalUrl( 'action=submit' ); |
310 | | - $form = "<form name='RevisionReview' action='$action' method='post'>"; |
311 | | - $form .= '<fieldset><legend>' . wfMsgHtml( 'revreview-legend' ) . '</legend><table><tr>'; |
312 | | - |
313 | | - $formradios = array(); |
314 | | - # Dynamically contruct our radio options |
315 | | - foreach( FlaggedRevs::getDimensions() as $tag => $levels ) { |
316 | | - $formradios[$tag] = array(); |
317 | | - $x = count($levels); // number of levels AND zero |
318 | | - for( $i=0; $i < $x; $i++ ) { |
319 | | - $formradios[$tag][] = array( "revreview-$tag-$i", "wp$tag", $i ); |
320 | | - } |
321 | | - $form .= '<td><strong>' . wfMsgHtml( "revreview-$tag" ) . |
322 | | - '</strong></td><td width=\'20\'></td>'; |
323 | | - } |
324 | | - $hidden = array( |
325 | | - Xml::hidden( 'wpEditToken', $wgUser->editToken() ), |
326 | | - Xml::hidden( 'target', $this->page->getPrefixedText() ), |
327 | | - Xml::hidden( 'oldid', $this->oldid ) |
328 | | - ); |
329 | | - |
330 | | - $form .= '</tr><tr>'; |
331 | | - foreach( $formradios as $set => $ratioset ) { |
332 | | - $form .= '<td>'; |
333 | | - foreach( $ratioset as $item ) { |
334 | | - list( $message, $name, $field ) = $item; |
335 | | - # Don't give options the user can't set unless its the status quo |
336 | | - $attribs = array('id' => $name.$field); |
337 | | - if( !$this->userCan($set,$field) ) |
338 | | - $attribs['disabled'] = 'true'; |
339 | | - $form .= "<div>"; |
340 | | - $form .= Xml::radio( $name, $field, ($field==$this->dims[$set]), $attribs ); |
341 | | - $form .= Xml::label( wfMsg($message), $name.$field ); |
342 | | - $form .= "</div>\n"; |
343 | | - } |
344 | | - $form .= '</td><td width=\'20\'></td>'; |
345 | | - } |
346 | | - $form .= '</tr></table></fieldset>'; |
347 | | - # Add box to add live notes to a flagged revision |
348 | | - if( $wgFlaggedRevComments && $wgUser->isAllowed( 'validate' ) ) { |
349 | | - $form .= "<fieldset><legend>" . wfMsgHtml( 'revreview-notes' ) . "</legend>" . |
350 | | - "<textarea tabindex='1' name='wpNotes' id='wpNotes' rows='3' cols='80' style='width:100%'>" . |
351 | | - htmlspecialchars( $this->notes ) . |
352 | | - "</textarea></fieldset>"; |
353 | | - } |
354 | | - |
355 | | - $form .= '<fieldset><legend>' . wfMsgHtml('revisionreview') . '</legend>'; |
356 | | - $form .= '<p>'.Xml::inputLabel( wfMsg( 'revreview-log' ), 'wpReason', 'wpReason', 60 ).'</p>'; |
357 | | - $form .= '<p>'.Xml::submitButton( wfMsg( 'revreview-submit' ) ).'</p>'; |
358 | | - foreach( $hidden as $item ) { |
359 | | - $form .= $item; |
360 | | - } |
361 | | - # Hack, versioning params |
362 | | - $form .= Xml::hidden( 'templateParams', $this->templateParams ) . "\n"; |
363 | | - $form .= Xml::hidden( 'imageParams', $this->imageParams ) . "\n"; |
364 | | - $form .= Xml::hidden( 'fileVersion', $this->fileVersion ) . "\n"; |
365 | | - $form .= Xml::hidden( 'wpApprove', $this->approve ) . "\n"; |
366 | | - $form .= Xml::hidden( 'rcid', $this->rcid ) . "\n"; |
367 | | - # Special token to discourage fiddling... |
368 | | - $checkCode = self::validationKey( $this->templateParams, $this->imageParams, |
369 | | - $this->fileVersion, $rev->getId() ); |
370 | | - $form .= Xml::hidden( 'validatedParams', $checkCode ); |
371 | | - $form .= '</fieldset>'; |
372 | | - |
373 | | - $form .= '</form>'; |
374 | | - $wgOut->addHTML( $form ); |
375 | | - } |
376 | | - |
377 | | - /** |
378 | | - * @param Revision $rev |
379 | | - * @return string |
380 | | - */ |
381 | | - private function historyLine( $rev ) { |
382 | | - global $wgContLang; |
383 | | - $date = $wgContLang->timeanddate( $rev->getTimestamp() ); |
384 | | - $difflink = '(' . $this->skin->makeKnownLinkObj( $this->page, wfMsgHtml('diff'), |
385 | | - '&diff=' . $rev->getId() . '&oldid=prev' ) . ')'; |
386 | | - $revlink = $this->skin->makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ); |
387 | | - return "<li>$difflink $revlink " . $this->skin->revUserLink($rev) . " " . |
388 | | - $this->skin->revComment($rev) . "</li>"; |
389 | | - } |
390 | | - |
391 | 283 | public function isApproval() { |
392 | 284 | # If all values are set to zero, this has been unapproved |
393 | 285 | if( FlaggedRevs::dimensionsEmpty() && $this->approve ) { |
— | — | @@ -870,27 +762,4 @@ |
871 | 763 | } |
872 | 764 | wfProfileOut( __METHOD__ ); |
873 | 765 | } |
874 | | - |
875 | | - private function mergeTemplateParams( $pout, $tmps, $tmpIds, $maxID ) { |
876 | | - foreach( $tmps as $ns => $dbkey_id ) { |
877 | | - foreach( $dbkey_id as $dbkey => $pageid ) { |
878 | | - if( !isset($pout->mTemplates[$ns]) ) |
879 | | - $pout->mTemplates[$ns] = array(); |
880 | | - # Add in this template; overrides |
881 | | - $pout->mTemplates[$ns][$dbkey] = $pageid; |
882 | | - } |
883 | | - } |
884 | | - # Merge in template params from first phase of parsing... |
885 | | - foreach( $tmpIds as $ns => $dbkey_id ) { |
886 | | - foreach( $dbkey_id as $dbkey => $revid ) { |
887 | | - if( !isset($pout->mTemplateIds[$ns]) ) |
888 | | - $pout->mTemplateIds[$ns] = array(); |
889 | | - # Add in this template; overrides |
890 | | - $pout->mTemplateIds[$ns][$dbkey] = $revid; |
891 | | - } |
892 | | - } |
893 | | - if( $maxID > $pout->fr_newestTemplateID ) { |
894 | | - $pout->fr_newestTemplateID = $maxID; |
895 | | - } |
896 | | - } |
897 | 766 | } |