Sort available box controllers by name
authorMatthias Schmidt <gravatronics@live.com>
Wed, 12 Apr 2017 15:46:56 +0000 (17:46 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 12 Apr 2017 15:46:56 +0000 (17:46 +0200)
wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php

index 22cec70961a25d258defec6219986ef8d3862b1b..4121237501a33b91953e32cdfe006d84348565ed 100644 (file)
@@ -215,6 +215,14 @@ class BoxAddForm extends AbstractForm {
                }
                
                $this->availableBoxControllers = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.boxController');
+               
+               uasort($this->availableBoxControllers, function(ObjectType $a, ObjectType $b) {
+                       return strcmp(
+                               WCF::getLanguage()->get('wcf.acp.box.boxController.' . $a->objectType),
+                               WCF::getLanguage()->get('wcf.acp.box.boxController.' . $b->objectType)
+                       );
+               });
+               
                $this->readBoxPositions();
        }