Index: trunk/extensions/UserMerge/UserMerge_body.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | // init variables |
34 | 34 | $olduser_text = ''; |
35 | 35 | $newuser_text = ''; |
36 | | - $deleteUserCheck = ''; |
| 36 | + $deleteUserCheck = false; |
37 | 37 | $validNewUser = false; |
38 | 38 | |
39 | 39 | if ( strlen( $wgRequest->getText( 'olduser' ).$wgRequest->getText( 'newuser' ) ) > 0 || $wgRequest->getText( 'deleteuser' ) ) { |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | $newuser_text = is_object( $newuser ) ? $newuser->getText() : ''; |
46 | 46 | |
47 | 47 | if ( $wgRequest->getText( 'deleteuser' ) ) { |
48 | | - $deleteUserCheck = 'checked="checked" '; |
| 48 | + $deleteUserCheck = true; |
49 | 49 | } |
50 | 50 | |
51 | 51 | if ( strlen( $olduser_text ) > 0 ) { |
— | — | @@ -55,10 +55,10 @@ |
56 | 56 | |
57 | 57 | if ( !is_object( $objOldUser ) ) { |
58 | 58 | $validOldUser = false; |
59 | | - $wgOut->addHTML( "<span style=\"color: red;\">" . wfMsg('usermerge-badolduser') . "</span><br />\n" ); |
| 59 | + $wgOut->wrapWikiMsg( "<div class='error'>\n$1</div>", 'usermerge-badolduser' ); |
60 | 60 | } elseif ( $olduserID == $wgUser->getID() ) { |
61 | 61 | $validOldUser = false; |
62 | | - $wgOut->addHTML( "<span style=\"color: red;\">" . wfMsg('usermerge-noselfdelete') . "</span><br />\n" ); |
| 62 | + $wgOut->wrapWikiMsg( "<div class='error'>\n$1</div>", 'usermerge-noselfdelete' ); |
63 | 63 | } else { |
64 | 64 | global $wgUserMergeProtectedGroups; |
65 | 65 | |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | if ( $boolProtected ) { |
74 | 74 | $validOldUser = false; |
75 | | - $wgOut->addHTML( "<span style=\"color: red;\">" . wfMsg('usermerge-protectedgroup') . "</span><br />\n" ); |
| 75 | + $wgOut->wrapWikiMsg( "<div class='error'>\n$1</div>", 'usermerge-protectedgroup' ); |
76 | 76 | } else { |
77 | 77 | $validOldUser = true; |
78 | 78 | |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | } else { |
90 | 90 | //invalid newuser entered |
91 | 91 | $validNewUser = false; |
92 | | - $wgOut->addHTML( "<span style=\"color: red;\">" . wfMsg('usermerge-badnewuser') . "</span><br />\n" ); |
| 92 | + $wgOut->wrapWikiMsg( "<div class='error'>$1</div>", 'usermerge-badnewuser' ); |
93 | 93 | } |
94 | 94 | } else { |
95 | 95 | //newuser looks good |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | //empty newuser string |
100 | 100 | $validNewUser = false; |
101 | 101 | $newuser_text = "Anonymous"; |
102 | | - $wgOut->addHTML( "<span style=\"color: red;\">" . wfMsg('usermerge-nonewuser', $newuser_text) . "</span><br />\n" ); |
| 102 | + $wgOut->wrapWikiMsg( "<div class='error'>$1</div>", array( 'usermerge-nonewuser', $newuser_text ) ); |
103 | 103 | } |
104 | 104 | } |
105 | 105 | } |
— | — | @@ -110,32 +110,46 @@ |
111 | 111 | //NO POST data found |
112 | 112 | } |
113 | 113 | |
114 | | - $action = $wgTitle->escapeLocalUrl(); |
115 | | - $token = $wgUser->editToken(); |
| 114 | + $wgOut->addHTML( |
| 115 | + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $wgTitle->getLocalUrl(), 'id' => 'usermergeform' ) ) . |
| 116 | + Xml::fieldset( wfMsg( 'usermerge-fieldset' ) ) . |
| 117 | + Xml::openElement( 'table', array( 'id' => 'mw-usermerge-table' ) ) . |
| 118 | + "<tr> |
| 119 | + <td class='mw-label'>" . |
| 120 | + Xml::label( wfMsg( 'usermerge-olduser' ), 'olduser' ) . |
| 121 | + "</td> |
| 122 | + <td class='mw-input'>" . |
| 123 | + Xml::input( 'olduser', 20, $olduser_text, array( 'type' => 'text', 'tabindex' => '1', 'onFocus' => "document.getElementById('olduser').select;" ) ) . ' ' . |
| 124 | + "</td> |
| 125 | + </tr> |
| 126 | + <tr> |
| 127 | + <td class='mw-label'>" . |
| 128 | + Xml::label( wfMsg( 'usermerge-newuser' ), 'newuser' ) . |
| 129 | + "</td> |
| 130 | + <td class='mw-input'>" . |
| 131 | + Xml::input( 'newuser', 20, $newuser_text, array( 'type' => 'text', 'tabindex' => '2', 'onFocus' => "document.getElementById('newuser').select;" ) ) . |
| 132 | + "</td> |
| 133 | + </tr> |
| 134 | + <tr> |
| 135 | + <td> " . |
| 136 | + "</td> |
| 137 | + <td class='mw-input'>" . |
| 138 | + Xml::checkLabel( wfMsg( 'usermerge-deleteolduser' ), 'deleteuser', 'deleteuser', $deleteUserCheck, array( 'tabindex' => '3' ) ) . |
| 139 | + "</td> |
| 140 | + </tr> |
| 141 | + <tr> |
| 142 | + <td> |
| 143 | + </td> |
| 144 | + <td class='mw-submit'>" . |
| 145 | + Xml::submitButton( wfMsg( 'usermerge-submit' ), array( 'tabindex' => '4' ) ) . |
| 146 | + "</td> |
| 147 | + </tr>" . |
| 148 | + Xml::closeElement( 'table' ) . |
| 149 | + Xml::closeElement( 'fieldset' ) . |
| 150 | + Xml::hidden( 'token', $wgUser->editToken() ) . |
| 151 | + Xml::closeElement( 'form' ) . "\n" |
| 152 | + ); |
116 | 153 | |
117 | | - $wgOut->addHTML( " |
118 | | -<form id='usermergeform' method='post' action=\"$action\"> |
119 | | -<table> |
120 | | - <tr> |
121 | | - <td align='right'>" . wfMsg( 'usermerge-olduser' ) . "</td> |
122 | | - <td align='left'><input tabindex='1' type='text' size='20' name='olduser' id='olduser' value=\"$olduser_text\" onFocus=\"document.getElementById('olduser').select;\" /></td> |
123 | | - </tr> |
124 | | - <tr> |
125 | | - <td align='right'>" . wfMsg( 'usermerge-newuser' ) . "</td> |
126 | | - <td align='left'><input tabindex='2' type='text' size='20' name='newuser' id='newuser' value=\"$newuser_text\" onFocus=\"document.getElementById('newuser').select;\" /></td> |
127 | | - </tr> |
128 | | - <tr> |
129 | | - <td align='right'>" . wfMsg( 'usermerge-deleteolduser' ) . "</td> |
130 | | - <td align='left'><input tabindex='3' type='checkbox' name='deleteuser' id='deleteuser' $deleteUserCheck/></td> |
131 | | - </tr> |
132 | | - <tr> |
133 | | - <td> </td> |
134 | | - <td align='right'><input type='submit' name='submit' value=\"" . wfMsg( 'usermerge-submit' ) . "\" /></td> |
135 | | - </tr> |
136 | | -</table> |
137 | | -<input type='hidden' name='token' value='$token' /> |
138 | | -</form>"); |
139 | | - |
140 | 154 | if ( $validNewUser && $validOldUser ) { |
141 | 155 | //go time, baby |
142 | 156 | if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) { |
Index: trunk/extensions/UserMerge/UserMerge.i18n.php |
— | — | @@ -1,8 +1,9 @@ |
2 | 2 | <?php |
3 | | -#coding: utf-8 |
4 | | -/** \file |
5 | | -* \brief Internationalization file for the User Merge and Delete Extension. |
6 | | -*/ |
| 3 | +/** |
| 4 | + * Internationalisation file for the User Merge and Delete Extension. |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + */ |
7 | 8 | |
8 | 9 | $messages = array(); |
9 | 10 | |
— | — | @@ -11,12 +12,13 @@ |
12 | 13 | 'usermerge-desc' => "[[Special:UserMerge|Merges references from one user to another user]] in the wiki database - will also delete old users following merge. Requires ''usermerge'' privileges", |
13 | 14 | 'usermerge-badolduser' => 'Invalid old username', |
14 | 15 | 'usermerge-badnewuser' => 'Invalid new username', |
15 | | - 'usermerge-nonewuser' => 'Empty new username - assuming merge to $1.<br /> |
16 | | -Click <u>Merge User</u> to accept.', |
| 16 | + 'usermerge-nonewuser' => 'Empty new username - assuming merge to "$1".<br /> |
| 17 | +Click "{{int:usermerge-submit}}" to accept.', |
17 | 18 | 'usermerge-noolduser' => 'Empty old username', |
18 | | - 'usermerge-olduser' => 'Old user (merge from)', |
19 | | - 'usermerge-newuser' => 'New user (merge to)', |
20 | | - 'usermerge-deleteolduser' => 'Delete old user?', |
| 19 | + 'usermerge-fieldset' => 'Usernames to merge', |
| 20 | + 'usermerge-olduser' => 'Old user (merge from):', |
| 21 | + 'usermerge-newuser' => 'New user (merge to):', |
| 22 | + 'usermerge-deleteolduser' => 'Delete old user', |
21 | 23 | 'usermerge-submit' => 'Merge user', |
22 | 24 | 'usermerge-badtoken' => 'Invalid edit token', |
23 | 25 | 'usermerge-userdeleted' => '$1 ($2) has been deleted.', |
Index: trunk/extensions/UserMerge/UserMerge.php |
— | — | @@ -15,9 +15,12 @@ |
16 | 16 | 'author' => 'Tim Laqua', |
17 | 17 | 'description' => "Merges references from one user to another user in the Wiki database - will also delete old users following merge. Requires 'usermerge' privileges.", |
18 | 18 | 'descriptionmsg' => 'usermerge-desc', |
19 | | - 'version' => '1.6' |
| 19 | + 'version' => '1.6.1' |
20 | 20 | ); |
21 | 21 | |
| 22 | +$wgAvailableRights[] = 'usermerge'; |
| 23 | +# $wgGroupPermissions['bureaucrat']['usermerge'] = true; |
| 24 | + |
22 | 25 | $dir = dirname(__FILE__) . '/'; |
23 | 26 | $wgAutoloadClasses['UserMerge'] = $dir . 'UserMerge_body.php'; |
24 | 27 | |
— | — | @@ -29,8 +32,8 @@ |
30 | 33 | $wgUserMergeProtectedGroups = array( "sysop" ); |
31 | 34 | |
32 | 35 | # Add a new log type |
33 | | -$wgLogTypes[] = 'usermerge'; |
34 | | -$wgLogNames['usermerge'] = 'usermerge-logpage'; |
35 | | -$wgLogHeaders['usermerge'] = 'usermerge-logpagetext'; |
36 | | -$wgLogActions['usermerge/mergeuser'] = 'usermerge-success-log'; |
37 | | -$wgLogActions['usermerge/deleteuser'] = 'usermerge-userdeleted-log'; |
| 36 | +$wgLogTypes[] = 'usermerge'; |
| 37 | +$wgLogNames['usermerge'] = 'usermerge-logpage'; |
| 38 | +$wgLogHeaders['usermerge'] = 'usermerge-logpagetext'; |
| 39 | +$wgLogActions['usermerge/mergeuser'] = 'usermerge-success-log'; |
| 40 | +$wgLogActions['usermerge/deleteuser'] = 'usermerge-userdeleted-log'; |
Index: trunk/extensions/UserMerge/install.settings |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +require_once( "$IP/extensions/UserMerge/UserMerge.php" ); |
| 3 | +# Assign the usermerge right to a usergroup, i.e. to the bureaucrats: |
| 4 | +$wgGroupPermissions['bureaucrat']['usermerge'] = true; |
| 5 | + |
Property changes on: trunk/extensions/UserMerge/install.settings |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 6 | + native |