Commit 02089b8e authored by Côme Chilliet's avatar Côme Chilliet

feat(systems): Sort services by name in the creation menu

issue #4387
parent 72000b50
......@@ -90,7 +90,7 @@ class ServerService extends simpleManagement
$this->plugins[$name] = new $name($dn, $this);
/* Capture all service objectClases, necessary for acl handling */
/* Capture all service objectClasses, necessary for acl handling */
if (isset($this->plugins[$name]->objectclasses)) {
foreach ($this->plugins[$name]->objectclasses as $oc) {
$this->objectclasses[] = $oc;
......@@ -99,6 +99,21 @@ class ServerService extends simpleManagement
}
}
uasort($this->plugins,
function($a, $b)
{
$aName = get_class($a);
$bName = get_class($b);
if (isset($a->DisplayName)) {
$aName = $a->DisplayName;
}
if (isset($b->DisplayName)) {
$bName = $b->DisplayName;
}
return strcmp($aName, $bName);
}
);
parent::__construct();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment