Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1208,6 +1208,9 @@ |
1209 | 1209 | 'deletionlog', |
1210 | 1210 | 'reverted', |
1211 | 1211 | 'deletecomment', |
| 1212 | + 'deleteotherreason', |
| 1213 | + 'deletereasonotherlist', |
| 1214 | + 'deletereason-dropdown', |
1212 | 1215 | 'rollback', |
1213 | 1216 | 'rollback_short', |
1214 | 1217 | 'rollbacklink', |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1925,7 +1925,15 @@ |
1926 | 1926 | global $wgUser, $wgOut, $wgRequest; |
1927 | 1927 | $confirm = $wgRequest->wasPosted() && |
1928 | 1928 | $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ); |
1929 | | - $reason = $wgRequest->getText( 'wpReason' ); |
| 1929 | + $this->DeleteReasonList = $wgRequest->getText( 'wpDeleteReasonList' ); |
| 1930 | + $this->DeleteReason = $wgRequest->getText( 'wpReason' ); |
| 1931 | + $reason = $this->DeleteReasonList; |
| 1932 | + if ( $reason != 'other' && $this->DeleteReason != '') { |
| 1933 | + // Entry from drop down menu + additional comment |
| 1934 | + $reason .= ': ' . $this->DeleteReason; |
| 1935 | + } elseif ( $reason == 'other' ) { |
| 1936 | + $reason = $this->DeleteReason; |
| 1937 | + } |
1930 | 1938 | |
1931 | 1939 | # This code desperately needs to be totally rewritten |
1932 | 1940 | |
— | — | @@ -2034,18 +2042,63 @@ |
2035 | 2043 | $formaction = $this->mTitle->escapeLocalURL( 'action=delete' . $par ); |
2036 | 2044 | |
2037 | 2045 | $confirm = htmlspecialchars( wfMsg( 'deletepage' ) ); |
2038 | | - $delcom = htmlspecialchars( wfMsg( 'deletecomment' ) ); |
| 2046 | + $delcom = Xml::label( wfMsg( 'deletecomment' ), 'wpDeleteReasonList' ); |
2039 | 2047 | $token = htmlspecialchars( $wgUser->editToken() ); |
2040 | 2048 | $watch = Xml::checkLabel( wfMsg( 'watchthis' ), 'wpWatch', 'wpWatch', $wgUser->getBoolOption( 'watchdeletion' ) || $this->mTitle->userIsWatching(), array( 'tabindex' => '2' ) ); |
| 2049 | + |
| 2050 | + $mDeletereasonother = Xml::label( wfMsg( 'deleteotherreason' ), 'wpReason' ); |
| 2051 | + $mDeletereasonotherlist = wfMsgHtml( 'deletereasonotherlist' ); |
| 2052 | + $scDeleteReasonList = wfMsgForContent( 'deletereason-dropdown' ); |
2041 | 2053 | |
| 2054 | + $deleteReasonList = ''; |
| 2055 | + if ( $scDeleteReasonList != '' && $scDeleteReasonList != '-' ) { |
| 2056 | + $deleteReasonList = "<option value=\"other\">$mDeletereasonotherlist</option>"; |
| 2057 | + $optgroup = ""; |
| 2058 | + foreach ( explode( "\n", $scDeleteReasonList ) as $option) { |
| 2059 | + $value = trim( htmlspecialchars($option) ); |
| 2060 | + if ( $value == '' ) { |
| 2061 | + continue; |
| 2062 | + } elseif ( substr( $value, 0, 1) == '*' && substr( $value, 1, 1) != '*' ) { |
| 2063 | + // A new group is starting ... |
| 2064 | + $value = trim( substr( $value, 1 ) ); |
| 2065 | + $deleteReasonList .= "$optgroup<optgroup label=\"$value\">"; |
| 2066 | + $optgroup = "</optgroup>"; |
| 2067 | + } elseif ( substr( $value, 0, 2) == '**' ) { |
| 2068 | + // groupmember |
| 2069 | + $selected = ""; |
| 2070 | + $value = trim( substr( $value, 2 ) ); |
| 2071 | + if ( $this->DeleteReasonList === $value) |
| 2072 | + $selected = ' selected="selected"'; |
| 2073 | + $deleteReasonList .= "<option value=\"$value\"$selected>$value</option>"; |
| 2074 | + } else { |
| 2075 | + // groupless delete reason |
| 2076 | + $selected = ""; |
| 2077 | + if ( $this->DeleteReasonList === $value) |
| 2078 | + $selected = ' selected="selected"'; |
| 2079 | + $deleteReasonList .= "$optgroup<option value=\"$value\"$selected>$value</option>"; |
| 2080 | + $optgroup = ""; |
| 2081 | + } |
| 2082 | + } |
| 2083 | + $deleteReasonList .= $optgroup; |
| 2084 | + } |
2042 | 2085 | $wgOut->addHTML( " |
2043 | 2086 | <form id='deleteconfirm' method='post' action=\"{$formaction}\"> |
2044 | 2087 | <table border='0'> |
2045 | 2088 | <tr> |
2046 | 2089 | <td align='right'> |
2047 | | - <label for='wpReason'>{$delcom}:</label> |
| 2090 | + $delcom: |
2048 | 2091 | </td> |
2049 | 2092 | <td align='left'> |
| 2093 | + <select tabindex='2' id='wpDeleteReasonList' name=\"wpDeleteReasonList\"> |
| 2094 | + $deleteReasonList |
| 2095 | + </select> |
| 2096 | + </td> |
| 2097 | + </tr> |
| 2098 | + <tr> |
| 2099 | + <td> |
| 2100 | + $mDeletereasonother |
| 2101 | + </td> |
| 2102 | + <td align='right'> |
2050 | 2103 | <input type='text' maxlength='255' size='60' name='wpReason' id='wpReason' value=\"" . htmlspecialchars( $reason ) . "\" tabindex=\"1\" /> |
2051 | 2104 | </td> |
2052 | 2105 | </tr> |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1891,6 +1891,13 @@ |
1892 | 1892 | 'deletionlog' => 'deletion log', |
1893 | 1893 | 'reverted' => 'Reverted to earlier revision', |
1894 | 1894 | 'deletecomment' => 'Reason for deletion', |
| 1895 | +'deleteotherreason' => 'Other/additional reason:', |
| 1896 | +'deletereasonotherlist' => 'Other reason', |
| 1897 | +'deletereason-dropdown' => ' |
| 1898 | +*Common delete reasons |
| 1899 | +** Author request |
| 1900 | +** Copyright violation |
| 1901 | +** Vandalism', |
1895 | 1902 | 'rollback' => 'Roll back edits', |
1896 | 1903 | 'rollback_short' => 'Rollback', |
1897 | 1904 | 'rollbacklink' => 'rollback', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -79,6 +79,7 @@ |
80 | 80 | * dumpTextPass.php can spawn fetchText.php as a subprocess, which should restart |
81 | 81 | cleanly if database connections fail unpleasantly. |
82 | 82 | * (bug 12028) Add Special:Listbots as shortcut for Special:Listusers/bot |
| 83 | +* (bug 9633) Add a predefined list of delete reasons to the deletion form |
83 | 84 | |
84 | 85 | === Bug fixes in 1.12 === |
85 | 86 | |