| Index: trunk/extensions/DeleteBatch/DeleteBatch.body.php |
| — | — | @@ -13,7 +13,6 @@ |
| 14 | 14 | */ |
| 15 | 15 | function DeleteBatch() { |
| 16 | 16 | SpecialPage::SpecialPage( 'DeleteBatch', 'deletebatch', true, 'execute', false ); |
| 17 | | - wfLoadExtensionMessages('DeleteBatch'); |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | 19 | /** |
| — | — | @@ -24,12 +23,12 @@ |
| 25 | 24 | function execute( $par ) { |
| 26 | 25 | global $wgOut, $wgUser, $wgRequest; |
| 27 | 26 | |
| 28 | | - if ( $wgUser->isBlocked() ) { |
| | 27 | + if ( $wgUser->isBlocked() ) { |
| 29 | 28 | $wgOut->blockedPage(); |
| 30 | 29 | return; |
| 31 | | - } |
| | 30 | + } |
| 32 | 31 | if ( wfReadOnly() ) { |
| 33 | | - $wgOut->readOnlyPage(); |
| | 32 | + $wgOut->readOnlyPage(); |
| 34 | 33 | return; |
| 35 | 34 | } |
| 36 | 35 | if ( !$wgUser->isAllowed( 'deletebatch' ) ) { |
| — | — | @@ -37,6 +36,8 @@ |
| 38 | 37 | return; |
| 39 | 38 | } |
| 40 | 39 | |
| | 40 | + wfLoadExtensionMessages('DeleteBatch'); |
| | 41 | + |
| 41 | 42 | $wgOut->setPageTitle(wfMsg('deletebatch-title')); |
| 42 | 43 | $cSF = new DeleteBatchForm($par); |
| 43 | 44 | |
| — | — | @@ -60,8 +61,8 @@ |
| 61 | 62 | function deletebatchForm( $par ) { |
| 62 | 63 | global $wgRequest; |
| 63 | 64 | $this->mMode = $wgRequest->getVal( 'wpMode' ); |
| 64 | | - $this->mPage = $wgRequest->getVal( 'wpPage' ); |
| 65 | | - $this->mReason = $wgRequest->getVal( 'wpReason' ); |
| | 65 | + $this->mPage = $wgRequest->getVal( 'wpPage' ); |
| | 66 | + $this->mReason = $wgRequest->getVal( 'wpReason' ); |
| 66 | 67 | $this->mFile = $wgRequest->getFileName( 'wpFile' ); |
| 67 | 68 | $this->mFileTemp = $wgRequest->getFileTempName( 'wpFile' ); |
| 68 | 69 | } |
| — | — | @@ -202,7 +203,7 @@ |
| 203 | 204 | // $this->showForm(''); |
| 204 | 205 | } else { |
| 205 | 206 | /* run through text and do all like it should be */ |
| 206 | | - $lines = explode( "\n", $line ); |
| | 207 | + $lines = explode( "\n", $line ); |
| 207 | 208 | foreach ($lines as $single_page) { |
| 208 | 209 | /* explode and give me a reason */ |
| 209 | 210 | $page_data = explode("|", trim ($single_page) ); |
| — | — | @@ -230,9 +231,9 @@ |
| 231 | 232 | */ |
| 232 | 233 | function deletePage($line, $reason = '', &$db, $multi = false, $linenum = 0, $user = null) { |
| 233 | 234 | global $wgOut, $wgUser; |
| 234 | | - $page = Title::newFromText ($line); |
| | 235 | + $page = Title::newFromText ($line); |
| 235 | 236 | if (is_null($page)) { /* invalid title? */ |
| 236 | | - $wgOut->addWikiText( wfMsg('deletebatch-omitting-invalid', $line) ); |
| | 237 | + $wgOut->addWikiText( wfMsg('deletebatch-omitting-invalid', $line) ); |
| 237 | 238 | if (!$multi) { |
| 238 | 239 | if (!is_null($user)) { |
| 239 | 240 | $wgUser = $user; |
| — | — | @@ -265,7 +266,7 @@ |
| 266 | 267 | $art = new Article($page); |
| 267 | 268 | } |
| 268 | 269 | |
| 269 | | - /* what is the generic reason for page deletion? |
| | 270 | + /* what is the generic reason for page deletion? |
| 270 | 271 | something about the content, I guess... |
| 271 | 272 | */ |
| 272 | 273 | $art->doDelete($reason); |
| — | — | @@ -288,4 +289,4 @@ |
| 289 | 290 | } |
| 290 | 291 | $this->deleteBatch ($this->mUser, $this->mPage, $this->mFileTemp); |
| 291 | 292 | } |
| 292 | | -} |
| \ No newline at end of file |
| | 293 | +} |
| Index: trunk/extensions/DeleteBatch/DeleteBatch.i18n.php |
| — | — | @@ -12,11 +12,14 @@ |
| 13 | 13 | */ |
| 14 | 14 | $messages['en'] = array( |
| 15 | 15 | 'deletebatch' => 'Delete batch of pages', |
| | 16 | + 'deletebatch-desc' => '[[Special:DeleteBatch|Delete a batch of pages]]', |
| 16 | 17 | 'deletebatch-button' => 'DELETE', /* make it an irritably big button, on purpose, of course... */ |
| 17 | 18 | 'deletebatch-here' => '<b>here</b>', |
| 18 | | - 'deletebatch-help' => 'Delete a batch of pages. You can either perform a single delete, or delete pages listed in a file. Choose a user that will be shown in deletion logs. Uploaded file should contain page name and optional reason separated by | character in each line.', |
| | 19 | + 'deletebatch-help' => 'Delete a batch of pages. You can either perform a single delete, or delete pages listed in a file. |
| | 20 | +Choose a user that will be shown in deletion logs. |
| | 21 | +Uploaded file should contain page name and optional reason separated by a "|" character in each line.', |
| 19 | 22 | 'deletebatch-caption' => 'Page list', |
| 20 | | - 'deletebatch-title' => 'Delete Batch', |
| | 23 | + 'deletebatch-title' => 'Delete batch', |
| 21 | 24 | 'deletebatch-link-back' => 'Go back to the special page ', |
| 22 | 25 | 'deletebatch-as' => 'Run the script as', |
| 23 | 26 | 'deletebatch-both-modes' => 'Please choose either one specified page or a given list of pages.', |
| Index: trunk/extensions/DeleteBatch/DeleteBatch.php |
| — | — | @@ -12,14 +12,15 @@ |
| 13 | 13 | $wgGroupPermissions['staff']['deletebatch'] = true; |
| 14 | 14 | |
| 15 | 15 | $wgExtensionCredits['specialpage'][] = array( |
| 16 | | - 'name' => 'Delete Batch', |
| 17 | | - 'version' => '1.0', |
| 18 | | - 'author' => 'Bartek Łapiński', |
| 19 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:DeleteBatch', |
| 20 | | - 'description' => 'Deletes a batch of pages' |
| | 16 | + 'name' => 'Delete Batch', |
| | 17 | + 'version' => '1.0', |
| | 18 | + 'author' => 'Bartek Łapiński', |
| | 19 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:DeleteBatch', |
| | 20 | + 'description' => 'Deletes a batch of pages', |
| | 21 | + 'descriptionmsg' => 'deletebatch-msg', |
| 21 | 22 | ); |
| 22 | 23 | |
| 23 | 24 | $dir = dirname(__FILE__) . '/'; |
| 24 | 25 | $wgExtensionMessagesFiles['DeleteBatch'] = $dir . 'DeleteBatch.i18n.php'; |
| 25 | 26 | $wgAutoloadClasses['DeleteBatch'] = $dir. 'DeleteBatch.body.php'; |
| 26 | | -$wgSpecialPages['DeleteBatch'] = 'DeleteBatch'; |
| \ No newline at end of file |
| | 27 | +$wgSpecialPages['DeleteBatch'] = 'DeleteBatch'; |