Index: trunk/phase3/includes/SpecialUserrights.php |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | * @param string $username Name of the user. |
140 | 140 | */ |
141 | 141 | function editUserGroupsForm($username) { |
142 | | - global $wgOut, $wgUser; |
| 142 | + global $wgOut; |
143 | 143 | |
144 | 144 | $user = User::newFromName($username); |
145 | 145 | if( is_null( $user ) ) { |
— | — | @@ -150,7 +150,11 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | $groups = $user->getGroups(); |
154 | | - |
| 154 | + $this->showEditUserGroupsForm( $username, $groups ); |
| 155 | + } |
| 156 | + |
| 157 | + function showEditUserGroupsForm( $username, $groups ) { |
| 158 | + global $wgOut, $wgUser; |
155 | 159 | $wgOut->addHTML( |
156 | 160 | Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'editGroup' ) ) . |
157 | 161 | Xml::hidden( 'user-editname', $username ) . |
Index: trunk/extensions/Makesysop/SpecialMakesysop_body.php |
— | — | @@ -303,29 +303,8 @@ |
304 | 304 | } |
305 | 305 | |
306 | 306 | $groups = $this->getUserGroups( $database, $userid ); |
307 | | - |
308 | | - $wgOut->addHTML( |
309 | | - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'editGroup' ) ) . |
310 | | - Xml::hidden( 'user-editname', $username ) . |
311 | | - Xml::hidden( 'wpEditToken', $wgUser->editToken( $username ) ) . |
312 | | - Xml::openElement( 'fieldset' ) . |
313 | | - Xml::element( 'legend', array(), wfMsg( 'userrights-editusergroup' ) ) . |
314 | | - $wgOut->parse( wfMsg( 'editinguser', $username ) ) . |
315 | | - "<table border='0' align='center'> |
316 | | - <tr> |
317 | | - <td>" . HTMLSelectGroups( 'member', $this->mName.'-groupsmember', $groups, true, 6 ) . "</td> |
318 | | - <td align='right'>" . HTMLSelectGroups( 'available', $this->mName.'-groupsavailable', $groups, true, 6, true) . "</td> |
319 | | - </tr><tr> |
320 | | - <td>" . $wgOut->parse( wfMsg( 'makesysopreason' ) ) . "</td> |
321 | | - <td align='right'>" . Xml::input( 'wpMakesysopReason', 30 ) . "</td> |
322 | | - </tr> |
323 | | - </table> \n" . |
324 | | - $wgOut->parse( wfMsg('userrights-groupshelp') ) . |
325 | | - Xml::submitButton( wfMsg( 'saveusergroups' ), array( 'name' => 'saveusergroups' ) ) . |
326 | | - Xml::closeElement( 'fieldset' ) . |
327 | | - Xml::closeElement( 'form' ) . "\n" |
328 | | - ); |
329 | | - |
| 307 | + |
| 308 | + $this->showEditUserGroupsForm( $username, $groups ); |
330 | 309 | } |
331 | 310 | |
332 | 311 | function splitUsername( $username ) { |