Avoid the duplication of form UI code between Special:Userrights and Special:Makesysop
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 27 Apr 2007 16:09:45 +0000 (16:09 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 27 Apr 2007 16:09:45 +0000 (16:09 +0000)
includes/SpecialUserrights.php

index 597b7f2..d12a9cc 100644 (file)
@@ -138,7 +138,7 @@ class UserrightsForm extends HTMLForm {
         * @param string $username Name of the user.
         */
        function editUserGroupsForm($username) {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                $user = User::newFromName($username);
                if( is_null( $user ) ) {
@@ -150,7 +150,11 @@ class UserrightsForm extends HTMLForm {
                }
 
                $groups = $user->getGroups();
-
+               $this->showEditUserGroupsForm( $username, $groups );
+       }
+       
+       function showEditUserGroupsForm( $username, $groups ) {
+               global $wgOut, $wgUser;
                $wgOut->addHTML(
                        Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'editGroup' ) ) .
                        Xml::hidden( 'user-editname', $username ) .