Index: openacs-4/packages/categories/tcl/categories-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/categories-procs.tcl,v diff -u -r1.22.2.3 -r1.22.2.4 --- openacs-4/packages/categories/tcl/categories-procs.tcl 31 May 2007 07:15:09 -0000 1.22.2.3 +++ openacs-4/packages/categories/tcl/categories-procs.tcl 5 Jun 2007 14:48:21 -0000 1.22.2.4 @@ -372,6 +372,14 @@ return $result } +ad_proc -public category::count_children { + {-category_id:required} +} { + counts all direct sub categories +} { + return [db_string select {}] +} + ad_proc -public category::get_parent { -category_id:required } { Index: openacs-4/packages/categories/tcl/categories-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/Attic/categories-procs.xql,v diff -u -r1.8.6.4 -r1.8.6.5 --- openacs-4/packages/categories/tcl/categories-procs.xql 31 May 2007 10:03:53 -0000 1.8.6.4 +++ openacs-4/packages/categories/tcl/categories-procs.xql 5 Jun 2007 14:48:21 -0000 1.8.6.5 @@ -1,5 +1,14 @@ + + + select count(*) + from categories + where parent_id=:category_id + + + + 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.20.2.2 -r1.20.2.3 --- openacs-4/packages/categories/tcl/category-trees-procs.tcl 31 May 2007 10:03:53 -0000 1.20.2.2 +++ openacs-4/packages/categories/tcl/category-trees-procs.tcl 5 Jun 2007 14:48:21 -0000 1.20.2.3 @@ -26,6 +26,21 @@ return [array get tree] } + ad_proc -public get_categories { + {-tree_id:required} + } { + returns the main categories of a given tree + } { + set locale [ad_conn locale] + set result [list] + set categories [db_list get_categories ""] + foreach category_id $categories { + lappend result $category_id + } + return $result + + } + ad_proc -public map { -tree_id:required -object_id:required Index: openacs-4/packages/categories/tcl/category-trees-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/Attic/category-trees-procs.xql,v diff -u -r1.8.2.2 -r1.8.2.3 --- openacs-4/packages/categories/tcl/category-trees-procs.xql 31 May 2007 10:03:53 -0000 1.8.2.2 +++ openacs-4/packages/categories/tcl/category-trees-procs.xql 5 Jun 2007 14:48:21 -0000 1.8.2.3 @@ -11,7 +11,17 @@ - + + + select c.category_id as category_id from categories c, category_translations ct + where parent_id is null + and tree_id = :tree_id + and c.category_id = ct.category_id + and locale = :locale + order by name + + +