From: Rob Church Date: Mon, 27 Aug 2007 13:52:51 +0000 (+0000) Subject: (bug 11079) Use 'wpReason' as the comment field name and pre-fill the comment field... X-Git-Tag: 1.31.0-rc.0~51644 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=e71d81d77896a24d9cabdadd858ac6398e1fe6c2;p=lhc%2Fweb%2Fwiklou.git (bug 11079) Use 'wpReason' as the comment field name and pre-fill the comment field from the request when building the form --- diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index bd96e3da25..e2be53f63f 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -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 .= '
' . wfMsgHtml( 'filedelete-legend' ) . ''; $form .= $this->prepareMessage( 'filedelete-intro' ); - $form .= '

' . Xml::inputLabel( wfMsg( 'filedelete-comment' ), 'wpComment', 'wpComment', 60 ) . '

'; + $form .= '

' . Xml::inputLabel( wfMsg( 'filedelete-comment' ), 'wpReason', 'wpReason', + 60, $wgRequest->getText( 'wpReason' ) ) . '

'; $form .= '

' . Xml::submitButton( wfMsg( 'filedelete-submit' ) ) . '

'; $form .= '
'; $form .= '';