r98821 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98820‎ | r98821 | r98822 >
Date:22:42, 3 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Wrap text by trimming lines

Trim trailing whitespace
Modified paths:
  • /trunk/extensions/UploadWizard/api/ApiDeleteUploadCampaign.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/api/ApiDeleteUploadCampaign.php
@@ -13,47 +13,47 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class ApiDeleteUploadCampaign extends ApiBase {
17 -
 17+
1818 public function __construct( $main, $action ) {
1919 parent::__construct( $main, $action );
2020 }
21 -
 21+
2222 public function execute() {
2323 global $wgUser;
24 -
 24+
2525 if ( !$wgUser->isAllowed( 'upwizcampaigns' ) || $wgUser->isBlocked() ) {
2626 $this->dieUsageMsg( array( 'badaccess-groups' ) );
2727 }
28 -
 28+
2929 $params = $this->extractRequestParams();
30 -
 30+
3131 $everythingOk = true;
32 -
 32+
3333 foreach ( $params['ids'] as $id ) {
3434 $campaign = new UploadWizardCampaign( $id );
3535 $everythingOk = $campaign->deleteFromDB() && $everythingOk;
3636 }
37 -
 37+
3838 $this->getResult()->addValue(
3939 null,
4040 'success',
4141 $everythingOk
4242 );
4343 }
44 -
 44+
4545 public function needsToken() {
4646 return true;
4747 }
48 -
 48+
4949 public function getTokenSalt() {
5050 $params = $this->extractRequestParams();
5151 return 'deletecampaign' . implode( '|', $params['ids'] );
5252 }
53 -
 53+
5454 public function mustBePosted() {
5555 return true;
5656 }
57 -
 57+
5858 public function getAllowedParams() {
5959 return array(
6060 'ids' => array(
@@ -64,21 +64,22 @@
6565 'token' => null,
6666 );
6767 }
68 -
 68+
6969 public function getParamDescription() {
7070 return array(
7171 'ids' => 'The IDs of the campaigns to delete',
7272 'token' => 'Edit token. You can get one of these through prop=info.',
7373 );
7474 }
75 -
 75+
7676 public function getDescription() {
7777 return array(
78 - 'API module for deleting Upload Campaigns, associated with UploadWizard. Do not rely on this, it is an API method '
79 - . 'mostly for developer convenience. This does not mean an Upload Campaign editing API will ever be available.'
 78+ 'API module for deleting Upload Campaigns, associated with UploadWizard.',
 79+ 'Do not rely on this, it is an API method mostly for developer convenience.',
 80+ 'This does not mean an Upload Campaign editing API will ever be available.',
8081 );
8182 }
82 -
 83+
8384 public function getPossibleErrors() {
8485 return array_merge( parent::getPossibleErrors(), array(
8586 array( 'missingparam', 'ids' ),
@@ -90,10 +91,10 @@
9192 'api.php?action=deleteuploadcampaign&ids=42',
9293 'api.php?action=deleteuploadcampaign&ids=4|2',
9394 );
94 - }
95 -
 95+ }
 96+
9697 public function getVersion() {
9798 return __CLASS__ . ': $Id$';
98 - }
99 -
 99+ }
 100+
100101 }

Status & tagging log