You are here

function _taxonomy_manager_tree_element_set_params in Taxonomy Manager 6.2

Same name and namespace in other branches
  1. 5 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:

2 calls 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
taxonomy_manager_tree_process_elements in ./taxonomy_manager.module
Processes the tree form element

File

./taxonomy_manager.module, line 687
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) . ']';
  }
}