Merge branch 'next' into next-owner-group
authorAlexander Ebert <ebert@woltlab.com>
Mon, 15 Apr 2019 17:14:40 +0000 (19:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 15 Apr 2019 17:14:40 +0000 (19:14 +0200)
1  2 
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/data/user/group/UserGroup.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml
wcfsetup/setup/db/install.sql

index 256173c5c0731621002976b2a698cea440ffb5de,4d50d2092726b751e99c5c0a08293fa08766ad46..18ed85b24ad79f51b0e5ceff20bc51e8442dc00a
@@@ -259,12 -238,27 +259,30 @@@ class UserGroup extends DatabaseObject 
                return $groups;
        }
        
 -       *
+       /**
+        * Returns a sorted list of accessible groups.
++       *v
+        * @param       integer[]               $groupTypes
+        * @param       integer[]               $invalidGroupTypes
+        * @return      UserGroup[]
+        * @since       5.2
+        */
+       public static function getSortedAccessibleGroups(array $groupTypes = [], array $invalidGroupTypes = []) {
+               $userGroups = self::getAccessibleGroups($groupTypes, $invalidGroupTypes);
+               
+               uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) {
+                       return strcasecmp($groupA->getName(), $groupB->getName());
+               });
+               
+               return $userGroups;
+       }
+       
        /**
 -       * Returns true if the current group is an admin-group.
 -       * Every group that may access EVERY group is an admin-group.
 +       * Returns true if the current group is an admin-group, which requires it to fulfill
 +       * one of these conditions:
 +       *  a) The WCFSetup is running and the group id is 4.
 +       *  b) This is the 'Owner' group.
 +       *  c) The group can access all groups (the 'Owner' group does not count).
         * 
         * @return      boolean
         */
Simple merge
Simple merge
Simple merge