You are here

function content_multiple_value_after_build_recursive in Content Construction Kit (CCK) 6.3

Helper function to deal with items flagged for removal recursively.

1 call to content_multiple_value_after_build_recursive()
content_multiple_value_after_build in includes/content.node_form.inc
After build callback for multiple value fields.

File

includes/content.node_form.inc, line 326
Create fields' form for a content type.

Code

function content_multiple_value_after_build_recursive(&$elements, $post) {
  foreach (element_children($elements) as $key) {
    if (isset($elements[$key]) && $elements[$key] && !in_array($key, array(
      '_weight',
      '_remove',
      '_error_element',
    ))) {

      // Recurse through all children elements.
      content_multiple_value_after_build_recursive($elements[$key], $post);
    }
  }

  // Remove values for items flagged for removal.
  if (isset($elements['#value'])) {
    $elements['#value'] = NULL;
    form_set_value($elements, NULL, $form_state);
    $elements['#post'] = $post;
  }
}