From: Brion Vibber Date: Fri, 27 Apr 2007 16:09:45 +0000 (+0000) Subject: Avoid the duplication of form UI code between Special:Userrights and Special:Makesysop X-Git-Tag: 1.31.0-rc.0~53198 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=b3d133efd26dc4181ab240ad66d6be03e452e437;p=lhc%2Fweb%2Fwiklou.git Avoid the duplication of form UI code between Special:Userrights and Special:Makesysop --- diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 597b7f2c40..d12a9cc411 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -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 ) .