function _webform_components_tree_build in Webform 5
Same name and namespace in other branches
- 5.2 webform.module \_webform_components_tree_build()
- 6.3 webform.module \_webform_components_tree_build()
- 6.2 webform.module \_webform_components_tree_build()
- 7.4 webform.module \_webform_components_tree_build()
- 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;
}