$this->oldfile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->title, $this->oldimage );
if( !self::haveDeletableFile($this->file, $this->oldfile, $this->oldimage) ) {
- $wgOut->addHtml( $this->prepareMessage( 'filedelete-nofile' ) );
+ $wgOut->addHTML( $this->prepareMessage( 'filedelete-nofile' ) );
$wgOut->addReturnTo( $this->title );
return;
}
$reason = $this->DeleteReasonList;
if ( $reason != 'other' && $this->DeleteReason != '') {
// Entry from drop down menu + additional comment
- $reason .= ': ' . $this->DeleteReason;
+ $reason .= wfMsgForContent( 'colon-separator' ) . $this->DeleteReason;
} elseif ( $reason == 'other' ) {
$reason = $this->DeleteReason;
}
$wgOut->addWikiText( $status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' ) );
if( $status->ok ) {
$wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
- $wgOut->addHtml( $this->prepareMessage( 'filedelete-success' ) );
+ $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
// Return to the main page if we just deleted all versions of the
// file, otherwise go back to the description page
$wgOut->addReturnTo( $this->oldimage ? $this->title : Title::newMainPage() );
$id = $title->getArticleID( GAID_FOR_UPDATE );
// Need to delete the associated article
$article = new Article( $title );
- if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) {
- if( $article->doDeleteArticle( $reason, $suppress, $id ) )
+ $error = '';
+ if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) {
+ if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
+ global $wgRequest;
+ if( $wgRequest->getCheck( 'wpWatch' ) ) {
+ $article->doWatch();
+ } elseif( $title->userIsWatching() ) {
+ $article->doUnwatch();
+ }
wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason, $id));
+ }
}
}
}
global $wgOut, $wgUser, $wgRequest;
if( $wgUser->isAllowed( 'suppressrevision' ) ) {
- $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\">
+ $suppress = "<tr id=\"wpDeleteSuppressRow\">
<td></td>
<td class='mw-input'>" .
Xml::checkLabel( wfMsg( 'revdelete-suppress' ),
$suppress = '';
}
- $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(), 'id' => 'mw-img-deleteconfirm' ) ) .
+ $checkWatch = $wgUser->getBoolOption( 'watchdeletion' ) || $this->title->userIsWatching();
+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(),
+ 'id' => 'mw-img-deleteconfirm' ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'filedelete-legend' ) ) .
Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ) .
"</td>
</tr>
{$suppress}
+ <tr>
+ <td></td>
+ <td class='mw-input'>" .
+ Xml::checkLabel( wfMsg( 'watchthis' ),
+ 'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
+ "</td>
+ </tr>
<tr>
<td></td>
<td class='mw-submit'>" .
$form .= '<p class="mw-filedelete-editreasons">' . $link . '</p>';
}
- $wgOut->addHtml( $form );
+ $wgOut->addHTML( $form );
}
/**
*/
private function showLogEntries() {
global $wgOut;
- $wgOut->addHtml( '<h2>' . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+ $wgOut->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
LogEventsList::showLogExtract( $wgOut, 'delete', $this->title->getPrefixedText() );
}