Index: trunk/extensions/AJAXPoll/AJAXPoll_body.php |
— | — | @@ -317,9 +317,12 @@ |
318 | 318 | |
319 | 319 | // Different message depending on if the user has already voted or not, or is entitled to vote |
320 | 320 | |
| 321 | + $canRevoke = false; |
| 322 | + |
321 | 323 | if ( $wgUser->isAllowed( 'ajaxpoll-vote' ) ) { |
322 | 324 | if ( isset( $row[0] ) ) { |
323 | 325 | $message = $ourLastVoteDate; |
| 326 | + $canRevoke = true; |
324 | 327 | $lines[] = wfMsg( 'ajaxpoll-revoke-vote' ); |
325 | 328 | } else { |
326 | 329 | $message = wfMsg( 'ajaxpoll-no-vote' ); |
— | — | @@ -336,8 +339,9 @@ |
337 | 340 | |
338 | 341 | for ( $i = 1; $i < count( $lines ); $i++ ) { |
339 | 342 | |
340 | | - $vote = ( $i != count( $lines ) - 1 ); |
| 343 | + $vote = !( $canRevoke && ( $i == count( $lines ) - 1 ) ); |
341 | 344 | $voteValue = ( $vote ) ? $i : 0; |
| 345 | + |
342 | 346 | $ans_no = $i - 1; |
343 | 347 | |
344 | 348 | if ( $amountOfVotes == 0 ) { |
Index: trunk/extensions/AJAXPoll/AJAXPoll.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * @author Jack Phoenix <jack@countervandalism.net> |
21 | 21 | * @author Thomas Gries |
22 | 22 | * @maintainer Thomas Gries |
23 | | - * @version 1.68 |
| 23 | + * @version 1.69 |
24 | 24 | * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation |
25 | 25 | */ |
26 | 26 | |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | $wgExtensionCredits['parserhook'][] = array( |
33 | 33 | 'path' => __FILE__, |
34 | 34 | 'name' => 'AJAX Poll', |
35 | | - 'version' => '1.68 20120313', |
| 35 | + 'version' => '1.69 20120313', |
36 | 36 | 'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), |
37 | 37 | 'descriptionmsg' => 'ajaxpoll-desc', |
38 | 38 | 'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', |