Index: openacs-4/packages/categories/tcl/category-trees-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/category-trees-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/categories/tcl/category-trees-procs.tcl 29 Jun 2004 10:17:52 -0000 1.13 +++ openacs-4/packages/categories/tcl/category-trees-procs.tcl 6 Jun 2005 08:56:07 -0000 1.14 @@ -580,3 +580,67 @@ set rollup $nrollup } } + +ad_proc -public category_tree::import { + {-name:required} + {-description ""} + {-categories:required} + {-locale ""} + {-user_id ""} + {-creation_ip ""} + {-context_id ""} +} { + Insert a new category tree with categories. + Here is an example of how to use this in tcl: +
+ set tree_id [category_tree::import -name regions -description {regions and states} -categories { + 1 europe + 2 germany + 2 {united kingdom} + 2 france + 1 asia + 2 china + 1 {north america} + 2 {united states} + }] ++ + @option name tree name. + @option description tree description. + @option categories Tcl list of levels and category_names. + @option locale locale of the language. [ad_conn locale] used by default. + @option user_id user that adds the category tree. [ad_conn user_id] used by default. + @option creation_ip ip-address of the user that adds the category tree. [ad_conn peeraddr] used by default. + @option context_id context_id of the category tree. [ad_conn package_id] used by default. + @return tree_id + @author Jeff Davis