You are here

function _taxonomy_manager_tree_element_set_params in Taxonomy Manager 5

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.module \_taxonomy_manager_tree_element_set_params()
  2. 6 taxonomy_manager.module \_taxonomy_manager_tree_element_set_params()
  3. 7 taxonomy_manager.module \_taxonomy_manager_tree_element_set_params()

adds #id and #name to all form elements

Parameters

$parents:

$form:

1 call to _taxonomy_manager_tree_element_set_params()
taxonomy_manager_tree_build_form in ./taxonomy_manager.module
recursive function for building nested form array with checkboxes and weight forms for each term

File

./taxonomy_manager.module, line 1802
Taxonomy Manager

Code

function _taxonomy_manager_tree_element_set_params($parents, &$form) {
  foreach (element_children($form) as $field_name) {
    $field_parents = array_merge($parents, array(
      $field_name,
    ));
    $form[$field_name]['#tree'] = TRUE;
    $form[$field_name]['#post'] = array();
    $form[$field_name]['#parents'] = $field_parents;
    $form[$field_name]['#id'] = form_clean_id('edit-' . implode('-', $field_parents));
    $form[$field_name]['#name'] = array_shift($field_parents) . '[' . implode('][', $field_parents) . ']';
  }
}