summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/php/components/UserSelection.php7
-rw-r--r--app/php/dto/CalendarGroupDTO.php5
2 files changed, 6 insertions, 6 deletions
diff --git a/app/php/components/UserSelection.php b/app/php/components/UserSelection.php
index 92b8463..7b10b40 100644
--- a/app/php/components/UserSelection.php
+++ b/app/php/components/UserSelection.php
@@ -58,12 +58,7 @@ class UserSelection extends TTemplateControl {
},
$categories
);
- usort(
- $categories,
- function($cat1, $cat2) {
- return strcmp($cat1->Name, $cat2->Name);
- }
- );
+ usort($categories, ['CalendarGroupDTO', '__compare']);
return $categories;
}
return [];
diff --git a/app/php/dto/CalendarGroupDTO.php b/app/php/dto/CalendarGroupDTO.php
index 779422d..a03afde 100644
--- a/app/php/dto/CalendarGroupDTO.php
+++ b/app/php/dto/CalendarGroupDTO.php
@@ -26,6 +26,11 @@ class CalendarGroupDTO {
usort($this->Calendars, ['CalendarDTO', '__compare']);
}
+ public static function __compare(CalendarGroupDTO $cat1,
+ CalendarGroupDTO $cat2) {
+ return strcmp($cat1->Name, $cat2->Name);
+ }
+
}
?>