(bug 11079) Use 'wpReason' as the comment field name and pre-fill the comment field...
authorRob Church <robchurch@users.mediawiki.org>
Mon, 27 Aug 2007 13:52:51 +0000 (13:52 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Mon, 27 Aug 2007 13:52:51 +0000 (13:52 +0000)
includes/FileDeleteForm.php

index bd96e3d..e2be53f 100644 (file)
@@ -63,7 +63,7 @@ class FileDeleteForm {
                
                // Perform the deletion if appropriate
                if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $token, $this->oldimage ) ) {
-                       $comment = $wgRequest->getText( 'wpComment' );
+                       $comment = $wgRequest->getText( 'wpReason' );
                        if( $this->oldimage ) {
                                $status = $this->file->deleteOld( $this->oldimage, $comment );
                                if( $status->ok ) {
@@ -98,14 +98,15 @@ class FileDeleteForm {
         * Show the confirmation form
         */
        private function showForm() {
-               global $wgOut, $wgUser;
+               global $wgOut, $wgUser, $wgRequest;
                
                $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::inputLabel( wfMsg( 'filedelete-comment' ), 'wpReason', 'wpReason',
+                       60, $wgRequest->getText( 'wpReason' ) ) . '</p>';
                $form .= '<p>' . Xml::submitButton( wfMsg( 'filedelete-submit' ) ) . '</p>';
                $form .= '</fieldset>';
                $form .= '</form>';