summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 388986d)
raw | patch | inline | side by side (parent: 388986d)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Aug 2009 14:33:30 +0000 (14:33 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Aug 2009 14:33:30 +0000 (14:33 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14097 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_listingSortIterator.inc | patch | blob | history |
diff --git a/gosa-core/include/class_listingSortIterator.inc b/gosa-core/include/class_listingSortIterator.inc
index 7f46512e51c9ed003f086500b5f30eb1062e5915..14aef7630feb6b312578acae870cb0e2b0753222 100644 (file)
// Take a look at the several types
switch ($_sortType) {
case 'string':
- return strnatcmp($a, $b);
+ return strcoll($a, $b);
+
+ case 'integer':
+ return $b - $a;
+
+ case 'date':
+ list($d, $m, $y)= split('\.', $a);
+ $a= (int)sprintf("%04d%02d%02d", $y, $m, $d);
+ list($d, $m, $y)= split('\.', $b);
+ $b= (int)sprintf("%04d%02d%02d", $y, $m, $d);
+ return $b-$a;
// Sort for string by default
default:
- return strnatcmp($a, $b);
+ return strcoll($a, $b);
}
}