You are here

function _webform_components_tree_build in Webform 5.2

Same name and namespace in other branches
  1. 5 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_components_form in ./webform_components.inc
Theme the node components 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
Implementation of hook_load().

File

./webform.module, line 2305

Code

function _webform_components_tree_build($src, &$tree, $parent, &$page_count) {
  foreach ($src as $cid => $component) {
    if ($component['pid'] == $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;
}