function dsDisplay::orderFields in Display Suite 6.3
Helper to sort nested fields
1 call to dsDisplay::orderFields()
- dsDisplay::prepare in includes/
dsDisplay.php - Build field and region information
File
- includes/
dsDisplay.php, line 639 - Class definition for a Display Suite Display object
Class
- dsDisplay
- The Display Suite Display object
Code
function orderFields(&$fields) {
// Order fields by weight
$weight = array();
foreach ($fields as $key => $row) {
$weight[$key] = $row['#weight'];
}
array_multisort($weight, SORT_ASC, $fields);
foreach ($fields as &$field) {
if (isset($field['#fields']) && !empty($field['#fields'])) {
ds_order_fields($field['#fields']);
}
}
}