- $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction() ) );
- $form .= '<fieldset><legend>' . wfMsgHtml( 'filedelete-legend' ) . '</legend>';
- $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) );
- $form .= '<table><tr><td colspan="2">';
- $form .= $this->prepareMessage( 'filedelete-intro' );
- $form .= "</td></tr><tr><td align=\"right\"> $delcom </td><td align=\"left\">";
- $form .= "<select tabindex='2' id='wpDeleteReasonList' name=\"wpDeleteReasonList\">
- $deleteReasonList
-</select>";
- $form .= "</td></tr><tr><td align=\"right\"> $mDeletereasonother </td><td align=\"left\">";
- $form .= "<input type='text' maxlength='255' size='60' name='wpReason' id='wpReason' ";
- $form .= "value=\"". htmlspecialchars( $wgRequest->getText( 'wpReason' ) ) ."\" tabindex=\"1\" />";
- $form .= '</td></tr><tr><td colspan="2">';
- $form .= '<p>' . Xml::submitButton( wfMsg( 'filedelete-submit' ), array( 'name' => 'mw-filedelete-submit', 'id' => 'mw-filedelete-submit' ) ) . '</p>';
- $form .= '</td></tr></table>';
- $form .= '</fieldset>';
- $form .= '</form>';
+ $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' ) ) .
+ Html::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}";
+ if( $wgUser->isLoggedIn() ) {
+ $form .= "
+ <tr>
+ <td></td>
+ <td class='mw-input'>" .
+ Xml::checkLabel( wfMsg( 'watchthis' ),
+ 'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
+ "</td>
+ </tr>";
+ }
+ $form .= "
+ <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>';
+ }