You are here

function _webform_components_tree_build in Webform 5

Same name and namespace in other branches
  1. 5.2 webform.module \_webform_components_tree_build()
  2. 6.3 webform.module \_webform_components_tree_build()
  3. 6.2 webform.module \_webform_components_tree_build()
  4. 7.4 webform.module \_webform_components_tree_build()
  5. 7.3 webform.module \_webform_components_tree_build()

Convert an array of components into a tree

3 calls to _webform_components_tree_build()
theme_webform_node_form in ./webform.module
Theme the node form. Use a table to organize the components.
webform_client_form in ./webform.module
Client form generation function. If this is displaying an existing submission, pass in the $submission variable with the contents of the submission to be displayed.
webform_load in ./webform.module
Implemenation of hook_load().

File

./webform.module, line 1898

Code

function _webform_components_tree_build($src, &$tree, $parent, &$page_count) {
  foreach ($src as $cid => $component) {
    if ($component['parent'] == $parent) {
      _webform_components_tree_build($src, $component, $cid, $page_count);
      $tree['children'][$cid] = $component;
      $tree['children'][$cid]['page_num'] = $page_count;
      if ($component['type'] == 'pagebreak') {
        $page_count++;
      }
    }
  }
  return $tree;
}