function _webform_components_tree_sort in Webform 5
Same name and namespace in other branches
- 5.2 webform.module \_webform_components_tree_sort()
- 6.3 webform.module \_webform_components_tree_sort()
- 6.2 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_node_form in ./
webform.module - Theme the node form. Use a table to organize the components.
File
- ./
webform.module, line 1947
Code
function _webform_components_tree_sort($tree) {
if (is_array($tree['children'])) {
uasort($tree['children'], "_webform_components_sort");
foreach ($tree['children'] as $cid => $component) {
$return[$cid] = _webform_components_tree_sort($component);
}
$tree['children'] = $return;
}
return $tree;
}