From d3852cd3f5b45e0c50c2b2ee29015d5a9d04f9a2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 7 Nov 2010 18:33:53 +0000 Subject: - Patch #961136 by sun: move system_sort_by_title() into common.inc. --- includes/common.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 86fb23ae9..6018eb549 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5787,6 +5787,19 @@ function drupal_sort_weight($a, $b) { return ($a_weight < $b_weight) ? -1 : 1; } +/** + * Array sorting callback; sorts elements by 'title' key. + */ +function drupal_sort_title($a, $b) { + if (!isset($b['title'])) { + return -1; + } + if (!isset($a['title'])) { + return 1; + } + return strcasecmp($a['title'], $b['title']); +} + /** * Check if the key is a property. */ -- cgit v1.2.3