Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | |
41 | 41 | if( $pages ) { |
42 | 42 | return $this->doDelete( $pages, $reason ); |
43 | | - } |
| 43 | + } |
44 | 44 | } |
45 | 45 | else { |
46 | 46 | $this->listForm( $target, $reason, $wgRequest->getInt( 'limit' ) ); |
— | — | @@ -244,16 +244,25 @@ |
245 | 245 | * @param string $reason |
246 | 246 | */ |
247 | 247 | protected function doDelete( array $pages, $reason ) { |
| 248 | + global $wgOut; |
| 249 | + |
| 250 | + $res = array(); |
248 | 251 | foreach( $pages as $page ) { |
249 | 252 | $title = Title::newFromURL( $page ); |
250 | | - $file = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
| 253 | + $file = $title->getNamespace() == NS_FILE ? wfLocalFile( $title ) : false; |
251 | 254 | if ( $file ) { |
252 | 255 | $oldimage = null; // Must be passed by reference |
253 | | - FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false ); |
| 256 | + $ok = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false )->isOK(); |
254 | 257 | } else { |
255 | | - $article = new Article( $title ); |
256 | | - $article->doDelete( $reason ); |
| 258 | + $article = new Article( $title, 0 ); |
| 259 | + $ok = $article->doDeleteArticle( $reason ); |
257 | 260 | } |
| 261 | + if ( $ok ) { |
| 262 | + $res[] = wfMsgExt( 'nuke-deleted', array( 'parseinline' ), $title->getPrefixedText() ); |
| 263 | + } else { |
| 264 | + $res[] = wfMsgExt( 'nuke-not-deleted', array( 'parseinline' ), $title->getPrefixedText() ); |
| 265 | + } |
258 | 266 | } |
| 267 | + $wgOut->addHTML( "<ul>\n<li>" .implode( "</li>\n<li>", $res ) . "</li>\n</ul>\n" ); |
259 | 268 | } |
260 | 269 | } |
Index: trunk/extensions/Nuke/Nuke.i18n.php |
— | — | @@ -30,7 +30,9 @@ |
31 | 31 | 'nuke-userorip' => 'Username, IP address or blank:', |
32 | 32 | 'nuke-maxpages' => 'Maximum number of pages:', |
33 | 33 | 'nuke-multiplepeople'=> 'multiple users', |
34 | | - 'nuke-editby' => 'Created by [[Special:Contributions/$1|$1]]' |
| 34 | + 'nuke-editby' => 'Created by [[Special:Contributions/$1|$1]]', |
| 35 | + 'nuke-deleted' => "Page '''$1''' has been deleted.", |
| 36 | + 'nuke-not-deleted' => "Page [[$1]] '''could not''' be deleted.", |
35 | 37 | ); |
36 | 38 | |
37 | 39 | /** Message documentation (Message documentation) |