Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -379,17 +379,22 @@ |
380 | 380 | $revlink = $this->skin->makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ); |
381 | 381 | return "<li>$difflink $revlink " . $this->skin->revUserLink($rev) . " " . $this->skin->revComment($rev) . "</li>"; |
382 | 382 | } |
| 383 | + |
| 384 | + public function isApproval() { |
| 385 | + # If all values are set to zero, this has been unapproved |
| 386 | + if( !count( FlaggedRevs::getDimensions() ) && $this->approve ) { |
| 387 | + return true; // no tags & approve param given |
| 388 | + } |
| 389 | + foreach( $this->dims as $quality => $value ) { |
| 390 | + if( $value ) return true; |
| 391 | + } |
| 392 | + return false; |
| 393 | + } |
383 | 394 | |
384 | 395 | public function submit() { |
385 | 396 | global $wgUser; |
386 | 397 | # If all values are set to zero, this has been unapproved |
387 | | - $approved = !count( FlaggedRevs::getDimensions() ) && $this->approve; |
388 | | - foreach( $this->dims as $quality => $value ) { |
389 | | - if( $value ) { |
390 | | - $approved = true; |
391 | | - break; |
392 | | - } |
393 | | - } |
| 398 | + $approved = $this->isApproval(); |
394 | 399 | # Double-check permissions |
395 | 400 | if( !$this->page->quickUserCan('edit') || !self::userCanSetFlags($this->dims,$this->oflags,$this->config) ) { |
396 | 401 | return array($approved,false); |
Index: trunk/extensions/FlaggedRevs/api/ApiReview.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | if( !$title->quickUserCan('edit') || !RevisionReview::userCanSetFlags($form->dims,$form->oflags,$form->config) ) |
84 | 84 | $this->dieUsage( "You don't have the necessary rights to set the specified flags.", 'permissiondenied' ); |
85 | 85 | |
86 | | - if( $form->approve ) { |
| 86 | + if( $form->isApproval() ) { |
87 | 87 | // Now get the template and image parameters needed |
88 | 88 | // If it is the current revision, try the parser cache first |
89 | 89 | $article = new Article( $title, $revid ); |