From 155e77fd080792d161d6b39f31ad3e9bda13ba14 Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Tue, 31 Jul 2012 08:32:04 -0700 Subject: Issue #1673380 by marcin.wosinek: Fix docs for drupal_sort_weight function --- includes/common.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/common.inc b/includes/common.inc index 051efd55a..f80496bf8 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -6219,7 +6219,19 @@ function element_info_property($type, $property_name, $default = NULL) { } /** - * Function used by uasort to sort structured arrays by weight, without the property weight prefix. + * Sorts a structured array by the 'weight' element. + * + * Note that the sorting is by the 'weight' array element, not by the render + * element property '#weight'. + * + * Callback for uasort() used in various functions. + * + * @param $a + * First item for comparison. The compared items should be associative arrays + * that optionally include a 'weight' element. For items without a 'weight' + * element, a default value of 0 will be used. + * @param $b + * Second item for comparison. */ function drupal_sort_weight($a, $b) { $a_weight = (is_array($a) && isset($a['weight'])) ? $a['weight'] : 0; -- cgit v1.2.3