/** * Clone nodes * * @param * @return */ function cloneNodes($a_new_obj, $a_target_parent, $a_source_parent) { include_once "./Services/Taxonomy/classes/class.ilTaxonomyNode.php"; // get all childs $nodes = $this->getTree()->getChilds($a_source_parent); foreach ($nodes as $node) { switch ($node["type"]) { case "taxn": $tax_node = new ilTaxonomyNode($node["child"]); $new_node = $tax_node->copy($a_new_obj->getId()); break; } ilTaxonomyNode::putInTree($a_new_obj->getId(), $new_node, $a_target_parent); $this->node_mapping[$node["child"]] = $new_node->getId(); // handle childs $this->cloneNodes($a_new_obj, $new_node->getId(), $node["child"]); } }