diff options
author | Matěj Suchánek <matejsuchanek97@gmail.com> | 2019-09-24 13:49:18 +0200 |
---|---|---|
committer | Matěj Suchánek <matejsuchanek97@gmail.com> | 2019-09-24 13:49:18 +0200 |
commit | 75ff49a1ffcef0fdd27e6bf8d6421210413cfed4 (patch) | |
tree | dc0f9de860aa20e939617484d48704aa6bdea872 /includes/api/ApiQueryContributors.php | |
parent | 66eb92b458b4b43f0ca0970d7bbc440f9252e401 (diff) | |
download | mediawikicore-75ff49a1ffcef0fdd27e6bf8d6421210413cfed4.tar.gz mediawikicore-75ff49a1ffcef0fdd27e6bf8d6421210413cfed4.zip |
Sort user groups when shown in drop-downs
This makes searching for them easier and makes their
order less arbitrary, especially when they are localized.
Replace one sort function wrongly chosen by me.
Change-Id: I231f28656333c5bf846bedfedb6ba5040a09f74e
Diffstat (limited to 'includes/api/ApiQueryContributors.php')
-rw-r--r-- | includes/api/ApiQueryContributors.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/api/ApiQueryContributors.php b/includes/api/ApiQueryContributors.php index f2e306fe8352..ea5b7c313a2c 100644 --- a/includes/api/ApiQueryContributors.php +++ b/includes/api/ApiQueryContributors.php @@ -223,10 +223,14 @@ class ApiQueryContributors extends ApiQueryBase { return 'public'; } - public function getAllowedParams() { + public function getAllowedParams( $flags = 0 ) { $userGroups = User::getAllGroups(); $userRights = $this->getPermissionManager()->getAllPermissions(); + if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) { + sort( $userGroups ); + } + return [ 'group' => [ ApiBase::PARAM_TYPE => $userGroups, |