Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -710,6 +710,8 @@ |
711 | 711 | 'revdelete-no-change', |
712 | 712 | 'revdelete-concurrent-change', |
713 | 713 | 'revdelete-only-restricted', |
| 714 | + 'revdelete-reason-dropdown', |
| 715 | + 'revdelete-otherreason', |
714 | 716 | ), |
715 | 717 | 'suppression' => array( |
716 | 718 | 'suppressionlog', |
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -153,6 +153,8 @@ |
154 | 154 | $rev = Revision::newFromId( $this->ids[0] ); |
155 | 155 | $this->targetObj = $rev ? $rev->getTitle() : $this->targetObj; |
156 | 156 | } |
| 157 | + |
| 158 | + $this->otherReason = $wgRequest->getVal( 'wpReason' ); |
157 | 159 | # We need a target page! |
158 | 160 | if( is_null($this->targetObj) ) { |
159 | 161 | $wgOut->addWikiMsg( 'undelete-header' ); |
— | — | @@ -365,9 +367,17 @@ |
366 | 368 | Xml::openElement( 'fieldset' ) . |
367 | 369 | Xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) . |
368 | 370 | $this->buildCheckBoxes( $bitfields ) . |
369 | | - '<p>' . Xml::inputLabel( wfMsg( 'revdelete-log' ), 'wpReason', 'wpReason', 60 ) . '</p>' . |
370 | | - '<p>' . Xml::submitButton( wfMsg( 'revdelete-submit' ), |
371 | | - array( 'name' => 'wpSubmit' ) ) . '</p>' . |
| 371 | + "\n<table><tr>\n" . |
| 372 | + '<td>' . Xml::label( wfMsg('revdelete-log'), 'wpRevDeleteReasonList' ) . '</td>' . |
| 373 | + '<td>' . Xml::listDropDown( 'wpRevDeleteReasonList', |
| 374 | + wfMsgForContent( 'revdelete-reason-dropdown' ), |
| 375 | + wfMsgForContent( 'revdelete-reasonotherlist' ), '', 'wpReasonDropDown', 1 |
| 376 | + ) . '</td>' . |
| 377 | + "\n</tr><tr>\n" . |
| 378 | + '<td>' . Xml::label( wfMsg( 'revdelete-otherreason' ), 'wpReason' ) . '</td>' . |
| 379 | + '<td>' . Xml::input( 'wpReason', 60, $this->otherReason, array('id'=>'wpReason') ) . '</td>' . |
| 380 | + "\n</tr></table>\n" . |
| 381 | + Xml::submitButton( wfMsg( 'revdelete-submit' ), array( 'name' => 'wpSubmit' ) ) . |
372 | 382 | Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . |
373 | 383 | Xml::hidden( 'target', $this->targetObj->getPrefixedText() ) . |
374 | 384 | Xml::hidden( 'type', $this->typeName ) . |
— | — | @@ -398,9 +408,10 @@ |
399 | 409 | // FIXME: all items checked for just one rev are checked, even if not set for the others |
400 | 410 | foreach( $this->checks as $item ) { |
401 | 411 | list( $message, $name, $field ) = $item; |
402 | | - $line = Xml::tags( 'div', null, Xml::checkLabel( wfMsg($message), $name, $name, |
403 | | - $bitfields & $field ) ); |
404 | | - if( $field == Revision::DELETED_RESTRICTED ) $line = "<b>$line</b>"; |
| 412 | + $innerHTML = Xml::checkLabel( wfMsg($message), $name, $name, $bitfields & $field ); |
| 413 | + if( $field == Revision::DELETED_RESTRICTED ) |
| 414 | + $innerHTML = "<b>$innerHTML</b>"; |
| 415 | + $line = Xml::tags( 'div', null, $innerHTML ); |
405 | 416 | $html .= $line; |
406 | 417 | } |
407 | 418 | return $html; |
— | — | @@ -418,7 +429,14 @@ |
419 | 430 | return false; |
420 | 431 | } |
421 | 432 | $bitfield = $this->extractBitfield( $request ); |
422 | | - $comment = $request->getText( 'wpReason' ); |
| 433 | + $listReason = $request->getText( 'wpRevDeleteReasonList', 'other' ); // from dropdown |
| 434 | + $comment = $listReason; |
| 435 | + if( $comment != 'other' && $this->otherReason != '' ) { |
| 436 | + // Entry from drop down menu + additional comment |
| 437 | + $comment .= wfMsgForContent( 'colon-separator' ) . $this->otherReason; |
| 438 | + } elseif( $comment == 'other' ) { |
| 439 | + $comment = $this->otherReason; |
| 440 | + } |
423 | 441 | # Can the user set this field? |
424 | 442 | if( $bitfield & Revision::DELETED_RESTRICTED && !$wgUser->isAllowed('suppressrevision') ) { |
425 | 443 | $wgOut->permissionRequired( 'suppressrevision' ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1462,7 +1462,13 @@ |
1463 | 1463 | 'revdelete-suppress' => 'Suppress data from administrators as well as others', |
1464 | 1464 | 'revdelete-hide-image' => 'Hide file content', |
1465 | 1465 | 'revdelete-unsuppress' => 'Remove restrictions on restored revisions', |
1466 | | -'revdelete-log' => 'Log comment:', |
| 1466 | +'revdelete-reasonotherlist' => 'Other reason', |
| 1467 | +'revdelete-reason-dropdown' => '*Common delete reasons |
| 1468 | +** Author request |
| 1469 | +** Copyright violation |
| 1470 | +** Vandalism', |
| 1471 | +'revdelete-log' => 'Reason for deletion:', |
| 1472 | +'revdelete-otherreason' => 'Other/additional reason:', |
1467 | 1473 | 'revdelete-submit' => 'Apply to selected revision', |
1468 | 1474 | 'revdelete-logentry' => 'changed revision visibility of [[$1]]', |
1469 | 1475 | 'logdelete-logentry' => 'changed event visibility of [[$1]]', |