$reason = $this->mRequest->getVal( 'user-reason' );
if( $wgUser->matchEditToken( $this->mRequest->getVal( 'wpEditToken' ), $username ) ) {
$this->saveUserGroups( $username,
- $this->mRequest->getArray( 'member' ),
+ $this->mRequest->getArray( 'removable' ),
$this->mRequest->getArray( 'available' ),
$reason );
}
global $wgOut, $wgUser;
list( $addable, $removable ) = $this->splitGroups( $groups );
-
+
+ $list = array();
+ foreach( $user->getGroups() as $group )
+ $list[] = self::buildGroupLink( $group );
+ $grouplist = implode( ', ', $list );
+
$wgOut->addHTML(
Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'editGroup' ) ) .
Xml::hidden( 'user-editname', $user->getName() ) .
Xml::element( 'legend', array(), wfMsg( 'userrights-editusergroup' ) ) .
wfMsgExt( 'editinguser', array( 'parse' ),
wfEscapeWikiText( $user->getName() ) ) .
+ '<p>' . wfMsgHtml('userrights-groupsmember') . ' ' . $grouplist . '</p>' .
$this->explainRights() .
"<table border='0'>
<tr>
Xml::closeElement( 'form' ) . "\n"
);
}
+
+ /**
+ * Format a link to a group description page
+ *
+ * @param string $group
+ * @return string
+ */
+ private static function buildGroupLink( $group ) {
+ static $cache = array();
+ if( !isset( $cache[$group] ) )
+ $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );
+ return $cache[$group];
+ }
/**
* Prepare a list of groups the user is able to add and remove
* @return string XHTML <select> element
*/
private function removeSelect( $groups ) {
- return $this->doSelect( $groups, 'member' );
+ return $this->doSelect( $groups, 'removable' );
}
/**
* Adds the <select> thingie where you can select what groups to add/remove
*
* @param array $groups The groups that can be added/removed
- * @param string $name 'member' or 'available'
+ * @param string $name 'removable' or 'available'
* @return string XHTML <select> element
*/
private function doSelect( $groups, $name ) {
$viewer->showList( $output );
}
-}
\ No newline at end of file
+}
'editusergroup' => 'Edit User Groups',
'userrights-editusergroup' => 'Edit user groups',
'saveusergroups' => 'Save User Groups',
-'userrights-groupsmember' => 'Removable groups:',
+'userrights-groupsmember' => 'Member of:',
+'userrights-groupsremovable' => 'Removable groups:',
'userrights-groupsavailable' => 'Available groups:',
'userrights-groupshelp' => 'Select groups you want the user to be removed from or added to.
Unselected groups will not be changed. You can deselect a group with CTRL + Left Click',