Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs/language |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1 | 1 | Merged /trunk/extensions/FlaggedRevs/language:r77276 |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/api/ApiReview.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | * except that it generates the template and image parameters itself. |
35 | 35 | */ |
36 | 36 | public function execute() { |
37 | | - global $wgUser, $wgOut; |
| 37 | + global $wgUser, $wgOut, $wgParser; |
38 | 38 | $params = $this->extractRequestParams(); |
39 | 39 | // Check basic permissions |
40 | 40 | if ( !$wgUser->isAllowed( 'review' ) ) { |
— | — | @@ -52,10 +52,8 @@ |
53 | 53 | $title = $rev->getTitle(); |
54 | 54 | $form->setPage( $title ); |
55 | 55 | $form->setOldId( $revid ); |
56 | | - if ( FlaggedRevs::dimensionsEmpty() ) { |
57 | | - $form->setApprove( empty( $params['unapprove'] ) ); |
58 | | - $form->setUnapprove( !empty( $params['unapprove'] ) ); |
59 | | - } |
| 56 | + $form->setApprove( empty( $params['unapprove'] ) ); |
| 57 | + $form->setUnapprove( !empty( $params['unapprove'] ) ); |
60 | 58 | if ( isset( $params['comment'] ) ) |
61 | 59 | $form->setComment( $params['comment'] ); |
62 | 60 | if ( isset( $params['notes'] ) ) |
— | — | @@ -63,7 +61,7 @@ |
64 | 62 | // The flagging parameters have the form 'flag_$name'. |
65 | 63 | // Extract them and put the values into $form->dims |
66 | 64 | foreach ( FlaggedRevs::getTags() as $tag ) { |
67 | | - $form->setDim( $tag, intval( $params['flag_' . $tag] ) ); |
| 65 | + $form->setDim( $tag, (int)$params['flag_' . $tag] ); |
68 | 66 | } |
69 | 67 | if ( $form->getAction() === 'approve' ) { |
70 | 68 | $parserOutput = null; |
— | — | @@ -76,7 +74,6 @@ |
77 | 75 | } |
78 | 76 | if ( !$parserOutput || !isset( $parserOutput->fr_fileSHA1Keys ) ) { |
79 | 77 | // Miss, we have to reparse the page |
80 | | - global $wgParser; |
81 | 78 | $text = $article->getContent(); |
82 | 79 | $options = FlaggedRevs::makeParserOptions(); |
83 | 80 | $parserOutput = $wgParser->parse( |
— | — | @@ -96,11 +93,10 @@ |
97 | 94 | |
98 | 95 | $status = $form->ready(); // all params set |
99 | 96 | if ( $status === 'review_page_unreviewable' ) { |
100 | | - $this->dieUsage( "Provided revision or page can not be reviewed.", |
101 | | - 'notreviewable' ); |
| 97 | + $this->dieUsage( "Provided page is not reviewable.", 'notreviewable' ); |
102 | 98 | // Check basic page permissions |
103 | 99 | } elseif ( !$title->quickUserCan( 'review' ) || !$title->quickUserCan( 'edit' ) ) { |
104 | | - $this->dieUsage( "You don't have the necessary rights to set the specified flags.", |
| 100 | + $this->dieUsage( "Insufficient rights to set the specified flags.", |
105 | 101 | 'permissiondenied' ); |
106 | 102 | } |
107 | 103 | |
— | — | @@ -115,10 +111,7 @@ |
116 | 112 | $this->dieUsage( "Cannot find a flagged revision with the specified ID.", 'notarget' ); |
117 | 113 | # Approval failures |
118 | 114 | } else { |
119 | | - if ( is_array( $status ) ) { |
120 | | - $this->dieUsage( "A sync failure has occured while reviewing. Please try again.", |
121 | | - 'syncfailure' ); |
122 | | - } elseif ( $status === 'review_too_low' ) { |
| 115 | + if ( $status === 'review_too_low' ) { |
123 | 116 | $this->dieUsage( "Either all or none of the flags have to be set to zero.", |
124 | 117 | 'mixedapproval' ); |
125 | 118 | } elseif ( $status === 'review_denied' ) { |
— | — | @@ -144,15 +137,15 @@ |
145 | 138 | |
146 | 139 | public function getAllowedParams() { |
147 | 140 | $pars = array( |
148 | | - 'revid' => null, |
149 | | - 'token' => null, |
150 | | - 'comment' => null, |
| 141 | + 'revid' => null, |
| 142 | + 'token' => null, |
| 143 | + 'comment' => null, |
| 144 | + 'unapprove' => false |
151 | 145 | ); |
152 | | - if ( FlaggedRevs::allowComments() ) |
| 146 | + if ( FlaggedRevs::allowComments() ) { |
153 | 147 | $pars['notes'] = null; |
154 | | - if ( FlaggedRevs::dimensionsEmpty() ) { |
155 | | - $pars['unapprove'] = false; |
156 | | - } else { |
| 148 | + } |
| 149 | + if ( !FlaggedRevs::binaryFlagging() ) { |
157 | 150 | foreach ( FlaggedRevs::getDimensions() as $flagname => $levels ) { |
158 | 151 | $pars['flag_' . $flagname] = array( |
159 | 152 | ApiBase::PARAM_DFLT => 1, // default |
— | — | @@ -165,15 +158,15 @@ |
166 | 159 | |
167 | 160 | public function getParamDescription() { |
168 | 161 | $desc = array( |
169 | | - 'revid' => 'The revision ID for which to set the flags', |
170 | | - 'token' => 'An edit token retrieved through prop=info', |
171 | | - 'comment' => 'Comment for the review (optional)' |
| 162 | + 'revid' => 'The revision ID for which to set the flags', |
| 163 | + 'token' => 'An edit token retrieved through prop=info', |
| 164 | + 'comment' => 'Comment for the review (optional)', |
| 165 | + 'unapprove' => 'If set, revision will be unapproved rather than approved.' |
172 | 166 | ); |
173 | | - if ( FlaggedRevs::allowComments() ) |
| 167 | + if ( FlaggedRevs::allowComments() ) { |
174 | 168 | $desc['notes'] = "Additional notes for the review. The ''validate'' right is needed to set this parameter."; |
175 | | - if ( FlaggedRevs::dimensionsEmpty() ) { |
176 | | - $desc['unapprove'] = "If set, revision will be unapproved rather than approved."; |
177 | | - } else { |
| 169 | + } |
| 170 | + if ( !FlaggedRevs::binaryFlagging() ) { |
178 | 171 | foreach ( FlaggedRevs::getTags() as $flagname ) { |
179 | 172 | $desc['flag_' . $flagname] = "Set the flag ''{$flagname}'' to the specified value"; |
180 | 173 | } |
— | — | @@ -189,11 +182,10 @@ |
190 | 183 | return array_merge( parent::getPossibleErrors(), array( |
191 | 184 | array( 'badaccess-group0' ), |
192 | 185 | array( 'blockedtext' ), |
193 | | - array( 'code' => 'notarget', 'info' => 'Provided revision or page can not be reviewed.' ), |
194 | | - array( 'code' => 'notreviewable', 'info' => 'Provided revision or page can not be reviewed.' ), |
195 | | - array( 'code' => 'mixedapproval', 'info' => 'Either all or none of the flags have to be set to zero.' ), |
196 | | - array( 'code' => 'permissiondenied', 'info' => 'You don\'t have the necessary rights to set the specified flags.' ), |
197 | | - array( 'code' => 'syncfailure', 'info' => 'A sync failure has occured while reviewing. Please try again.' ), |
| 186 | + array( 'code' => 'notarget', 'info' => 'Provided revision or page can not be found.' ), |
| 187 | + array( 'code' => 'notreviewable', 'info' => 'Provided page is not reviewable.' ), |
| 188 | + array( 'code' => 'mixedapproval', 'info' => 'No flags can be set to zero when accepting a revision.' ), |
| 189 | + array( 'code' => 'permissiondenied', 'info' => 'Insufficient rights to set the specified flags.' ), |
198 | 190 | ) ); |
199 | 191 | } |
200 | 192 | |
Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedArticleView.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
201 | 193 | Merged /trunk/extensions/FlaggedRevs/FlaggedArticleView.php:r77276 |
Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs |
___________________________________________________________________ |
Modified: svn:mergeinfo |
202 | 194 | Merged /trunk/extensions/FlaggedRevs:r77276 |