function _webform_components_tree_sort in Webform 6.2
Same name and namespace in other branches
- 5.2 webform.module \_webform_components_tree_sort()
- 5 webform.module \_webform_components_tree_sort()
- 6.3 webform.module \_webform_components_tree_sort()
- 7.4 webform.module \_webform_components_tree_sort()
- 7.3 webform.module \_webform_components_tree_sort()
Sort each level of a component tree by weight and name
1 call to _webform_components_tree_sort()
- theme_webform_components_form in ./
webform_components.inc - Theme the node components form. Use a table to organize the components.
File
- ./
webform.module, line 2472
Code
function _webform_components_tree_sort($tree) {
if (isset($tree['children']) && is_array($tree['children'])) {
$children = array();
uasort($tree['children'], '_webform_components_sort');
foreach ($tree['children'] as $cid => $component) {
$children[$cid] = _webform_components_tree_sort($component);
}
$tree['children'] = $children;
}
return $tree;
}