- global $wgOut, $wgUser;
-
- $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction() ) );
- $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) );
- $form .= '<fieldset><legend>' . wfMsgHtml( 'filedelete-legend' ) . '</legend>';
- $form .= $this->prepareMessage( 'filedelete-intro' );
-
- $form .= '<p>' . Xml::inputLabel( wfMsg( 'filedelete-comment' ), 'wpComment', 'wpComment', 60 ) . '</p>';
- $form .= '<p>' . Xml::submitButton( wfMsg( 'filedelete-submit' ) ) . '</p>';
- $form .= '</fieldset>';
- $form .= '</form>';
-
- $wgOut->addHtml( $form );
+ global $wgOut, $wgUser, $wgRequest;
+
+ if( $wgUser->isAllowed( 'suppressrevision' ) ) {
+ $suppress = "<tr id=\"wpDeleteSuppressRow\">
+ <td></td>
+ <td class='mw-input'>" .
+ Xml::checkLabel( wfMsg( 'revdelete-suppress' ),
+ 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '3' ) ) .
+ "</td>
+ </tr>";
+ } else {
+ $suppress = '';
+ }
+
+ $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 ) ) .
+ $this->prepareMessage( 'filedelete-intro' ) .
+ Xml::openElement( 'table', array( 'id' => 'mw-img-deleteconfirm-table' ) ) .
+ "<tr>
+ <td class='mw-label'>" .
+ Xml::label( wfMsg( 'filedelete-comment' ), 'wpDeleteReasonList' ) .
+ "</td>
+ <td class='mw-input'>" .
+ Xml::listDropDown( 'wpDeleteReasonList',
+ wfMsgForContent( 'filedelete-reason-dropdown' ),
+ wfMsgForContent( 'filedelete-reason-otherlist' ), '', 'wpReasonDropDown', 1 ) .
+ "</td>
+ </tr>
+ <tr>
+ <td class='mw-label'>" .
+ Xml::label( wfMsg( 'filedelete-otherreason' ), 'wpReason' ) .
+ "</td>
+ <td class='mw-input'>" .
+ Xml::input( 'wpReason', 60, $wgRequest->getText( 'wpReason' ),
+ array( 'type' => 'text', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason' ) ) .
+ "</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'>" .
+ Xml::submitButton( wfMsg( 'filedelete-submit' ),
+ array( 'name' => 'mw-filedelete-submit', 'id' => 'mw-filedelete-submit', 'tabindex' => '4' ) ) .
+ "</td>
+ </tr>" .
+ Xml::closeElement( 'table' ) .
+ Xml::closeElement( 'fieldset' ) .
+ Xml::closeElement( 'form' );
+
+ if ( $wgUser->isAllowed( 'editinterface' ) ) {
+ $skin = $wgUser->getSkin();
+ $title = Title::makeTitle( NS_MEDIAWIKI, 'Filedelete-reason-dropdown' );
+ $link = $skin->link(
+ $title,
+ wfMsgHtml( 'filedelete-edit-reasonlist' ),
+ array(),
+ array( 'action' => 'edit' )
+ );
+ $form .= '<p class="mw-filedelete-editreasons">' . $link . '</p>';
+ }
+
+ $wgOut->addHTML( $form );
+ }
+
+ /**
+ * Show deletion log fragments pertaining to the current file
+ */
+ private function showLogEntries() {
+ global $wgOut;
+ $wgOut->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+ LogEventsList::showLogExtract( $wgOut, 'delete', $this->title->getPrefixedText() );