You are here

function _webform_components_tree_sort in Webform 5

Same name and namespace in other branches
  1. 5.2 webform.module \_webform_components_tree_sort()
  2. 6.3 webform.module \_webform_components_tree_sort()
  3. 6.2 webform.module \_webform_components_tree_sort()
  4. 7.4 webform.module \_webform_components_tree_sort()
  5. 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;
}