From: Aaron Schulz Date: Wed, 2 Sep 2009 23:13:21 +0000 (+0000) Subject: (bug 18862) RevisionDelete dropdowns X-Git-Tag: 1.31.0-rc.0~39962 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=92efcc80188d79ca7b164cc2bfa305aa439eae80;p=lhc%2Fweb%2Fwiklou.git (bug 18862) RevisionDelete dropdowns --- diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 05cef05c52..35722571d5 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -153,6 +153,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $rev = Revision::newFromId( $this->ids[0] ); $this->targetObj = $rev ? $rev->getTitle() : $this->targetObj; } + + $this->otherReason = $wgRequest->getVal( 'wpReason' ); # We need a target page! if( is_null($this->targetObj) ) { $wgOut->addWikiMsg( 'undelete-header' ); @@ -365,9 +367,17 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) . $this->buildCheckBoxes( $bitfields ) . - '

' . Xml::inputLabel( wfMsg( 'revdelete-log' ), 'wpReason', 'wpReason', 60 ) . '

' . - '

' . Xml::submitButton( wfMsg( 'revdelete-submit' ), - array( 'name' => 'wpSubmit' ) ) . '

' . + "\n\n" . + '' . + '' . + "\n\n" . + '' . + '' . + "\n
' . Xml::label( wfMsg('revdelete-log'), 'wpRevDeleteReasonList' ) . '' . Xml::listDropDown( 'wpRevDeleteReasonList', + wfMsgForContent( 'revdelete-reason-dropdown' ), + wfMsgForContent( 'revdelete-reasonotherlist' ), '', 'wpReasonDropDown', 1 + ) . '
' . Xml::label( wfMsg( 'revdelete-otherreason' ), 'wpReason' ) . '' . Xml::input( 'wpReason', 60, $this->otherReason, array('id'=>'wpReason') ) . '
\n" . + Xml::submitButton( wfMsg( 'revdelete-submit' ), array( 'name' => 'wpSubmit' ) ) . Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . Xml::hidden( 'target', $this->targetObj->getPrefixedText() ) . Xml::hidden( 'type', $this->typeName ) . @@ -398,9 +408,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { // FIXME: all items checked for just one rev are checked, even if not set for the others foreach( $this->checks as $item ) { list( $message, $name, $field ) = $item; - $line = Xml::tags( 'div', null, Xml::checkLabel( wfMsg($message), $name, $name, - $bitfields & $field ) ); - if( $field == Revision::DELETED_RESTRICTED ) $line = "$line"; + $innerHTML = Xml::checkLabel( wfMsg($message), $name, $name, $bitfields & $field ); + if( $field == Revision::DELETED_RESTRICTED ) + $innerHTML = "$innerHTML"; + $line = Xml::tags( 'div', null, $innerHTML ); $html .= $line; } return $html; @@ -418,7 +429,14 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { return false; } $bitfield = $this->extractBitfield( $request ); - $comment = $request->getText( 'wpReason' ); + $listReason = $request->getText( 'wpRevDeleteReasonList', 'other' ); // from dropdown + $comment = $listReason; + if( $comment != 'other' && $this->otherReason != '' ) { + // Entry from drop down menu + additional comment + $comment .= wfMsgForContent( 'colon-separator' ) . $this->otherReason; + } elseif( $comment == 'other' ) { + $comment = $this->otherReason; + } # Can the user set this field? if( $bitfield & Revision::DELETED_RESTRICTED && !$wgUser->isAllowed('suppressrevision') ) { $wgOut->permissionRequired( 'suppressrevision' ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e11d5703f8..95b638622d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1462,7 +1462,13 @@ Please confirm that you intend to do this, that you understand the consequences, 'revdelete-suppress' => 'Suppress data from administrators as well as others', 'revdelete-hide-image' => 'Hide file content', 'revdelete-unsuppress' => 'Remove restrictions on restored revisions', -'revdelete-log' => 'Log comment:', +'revdelete-reasonotherlist' => 'Other reason', +'revdelete-reason-dropdown' => '*Common delete reasons +** Author request +** Copyright violation +** Vandalism', +'revdelete-log' => 'Reason for deletion:', +'revdelete-otherreason' => 'Other/additional reason:', 'revdelete-submit' => 'Apply to selected revision', 'revdelete-logentry' => 'changed revision visibility of [[$1]]', 'logdelete-logentry' => 'changed event visibility of [[$1]]', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 13609fdc6b..42a72c31fb 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -710,6 +710,8 @@ $wgMessageStructure = array( 'revdelete-no-change', 'revdelete-concurrent-change', 'revdelete-only-restricted', + 'revdelete-reason-dropdown', + 'revdelete-otherreason', ), 'suppression' => array( 'suppressionlog',