From 14d65ce19eb2a9c8b02a711567f6b7e42e426f1f Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 5 Sep 2010 15:38:16 +0000 Subject: #800502 by Damien Tournoud, sun: Fixed Module page is not ordered correctly. --- includes/common.inc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index a70d26e93..39606404e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5465,6 +5465,15 @@ function element_sort($a, $b) { return ($a_weight < $b_weight) ? -1 : 1; } +/** + * Array sorting callback; sorts elements by title. + */ +function element_sort_by_title($a, $b) { + $a_title = (is_array($a) && isset($a['#title'])) ? $a['#title'] : ''; + $b_title = (is_array($b) && isset($b['#title'])) ? $b['#title'] : ''; + return strnatcasecmp($a_title, $b_title); +} + /** * Retrieve the default properties for the defined element type. */ -- cgit v1.2.3