class UsersPager extends AlphabeticPager {
/**
- * @var array A array with user ids as key and a array of groups as value
+ * @var array[] A array with user ids as key and a array of groups as value
*/
protected $userGroupCache;
function getPageHeader() {
list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() );
- $groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
+ $groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
foreach ( $this->getAllGroups() as $group => $groupText ) {
$groupOptions[ $groupText ] = $group;
}
$formDescriptor = [
'user' => [
- 'class' => 'HTMLUserTextField',
+ 'class' => HTMLUserTextField::class,
'label' => $this->msg( 'listusersfrom' )->text(),
'name' => 'username',
- 'value' => $this->requestedUser,
+ 'default' => $this->requestedUser,
],
'dropdown' => [
- 'label' => $this->msg( 'group' ),
+ 'label' => $this->msg( 'group' )->text(),
'name' => 'group',
- 'value' => $this->requestedGroup,
- 'class' => 'HTMLSelectField',
+ 'default' => $this->requestedGroup,
+ 'class' => HTMLSelectField::class,
'options' => $groupOptions,
],
'editsOnly' => [
'label' => $this->msg( 'listusers-editsonly' )->text(),
'name' => 'editsOnly',
'id' => 'editsOnly',
- 'value' => $this->editsOnly
+ 'default' => $this->editsOnly
],
'creationSort' => [
'type' => 'check',
'label' => $this->msg( 'listusers-creationsort' )->text(),
'name' => 'creationSort',
'id' => 'creationSort',
- 'value' => $this->creationSort
+ 'default' => $this->creationSort
],
'desc' => [
'type' => 'check',
'label' => $this->msg( 'listusers-desc' )->text(),
'name' => 'desc',
'id' => 'desc',
- 'value' => $this->mDefaultDirection
+ 'default' => $this->mDefaultDirection
],
'limithiddenfield' => [
- 'class' => 'HTMLHiddenField',
+ 'class' => HTMLHiddenField::class,
'name' => 'limit',
- 'value' => $this->mLimit
+ 'default' => $this->mLimit
]
];
if ( $beforeSubmitButtonHookOut !== '' ) {
$formDescriptior[ 'beforeSubmitButtonHookOut' ] = [
- 'class' => 'HTMLInfoField',
+ 'class' => HTMLInfoField::class,
'raw' => true,
'default' => $beforeSubmitButtonHookOut
];
}
$formDescriptor[ 'submit' ] = [
- 'class' => 'HTMLSubmitField',
+ 'class' => HTMLSubmitField::class,
'buttonlabel-message' => 'listusers-submit',
];
if ( $beforeClosingFieldsetHookOut !== '' ) {
$formDescriptior[ 'beforeClosingFieldsetHookOut' ] = [
- 'class' => 'HTMLInfoField',
+ 'class' => HTMLInfoField::class,
'raw' => true,
'default' => $beforeClosingFieldsetHookOut
];
$htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
$htmlForm
->setMethod( 'get' )
+ ->setAction( Title::newFromText( $self )->getLocalURL() )
->setId( 'mw-listusers-form' )
->setFormIdentifier( 'mw-listusers-form' )
->suppressDefaultSubmit()
* and the relevant UserGroupMembership objects
*
* @param int $uid User id
- * @param array|null $cache
- * @return array (group name => UserGroupMembership object)
+ * @param array[]|null $cache
+ * @return UserGroupMembership[] (group name => UserGroupMembership object)
*/
protected static function getGroupMemberships( $uid, $cache = null ) {
if ( $cache === null ) {
* Format a link to a group description page
*
* @param string|UserGroupMembership $group Group name or UserGroupMembership object
- * @param string $username Username
+ * @param string $username
* @return string
*/
protected function buildGroupLink( $group, $username ) {