You are here

function _webform_components_tree_build in Webform 6.3

Same name and namespace in other branches
  1. 5.2 webform.module \_webform_components_tree_build()
  2. 5 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

4 calls to _webform_components_tree_build()
theme_webform_components_form in includes/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_node_load in ./webform.module
Implements hook_node_load().
webform_submission_render in includes/webform.submissions.inc
Print a Webform submission for display on a page or in an e-mail.

File

./webform.module, line 3256

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);
      if ($component['type'] == 'pagebreak') {
        $page_count++;
      }
      $tree['children'][$cid] = $component;
      $tree['children'][$cid]['page_num'] = $page_count;
    }
  }
  return $tree;
}