function _taxonomy_manager_tree_element_set_params in Taxonomy Manager 6
Same name and namespace in other branches
- 5 taxonomy_manager.module \_taxonomy_manager_tree_element_set_params()
- 6.2 taxonomy_manager.module \_taxonomy_manager_tree_element_set_params()
- 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 548 - 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) . ']';
}
}