Index: openacs-4/packages/contacts/tcl/category-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/category-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/contacts/tcl/category-procs.tcl 18 May 2005 16:45:49 -0000 1.3 +++ openacs-4/packages/contacts/tcl/category-procs.tcl 4 Jun 2005 12:36:45 -0000 1.4 @@ -1,75 +1,75 @@ -ad_library { - - Support procs for the categorys in the contacts package - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - -} - - -namespace eval contacts::categories:: { - - - ad_proc -public enabled_p { - } { - returns 1 if categories are enabled or 0 if not - } { - if { [empty_string_p [category_tree::get_mapped_trees [ad_conn package_id]]] } { - return 0 - } else { - return 1 - } - } - - - ad_proc -public get_selects { - {-export_vars ""} - {-category_id ""} - } { - } { - # this is borrowed from project-manager but will be re-written - - - # Categories are arranged into category trees. - # Set up an array for each tree. The array contains the category for each tree - set package_id [ad_conn package_id] - - set category_select "" - set number_of_categories 0 - set last_tree "" - set category_select "" - - db_foreach get_categories {} { - - if {![string equal $tree_name $last_tree] } { - append category_select "" - } - - if {[string equal $cat_id $category_id]} { - set select "selected" - } else { - set select "" - } - - append category_select "" - - set last_tree $tree_name - incr number_of_categories - } - - if {$number_of_categories < 1} { - return "" - } - - set return_val "
$export_vars -
" - - return $return_val -} - -} - +ad_library { + + Support procs for the categorys in the contacts package + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + +} + + +namespace eval contacts::categories:: { + + + ad_proc -public enabled_p { + } { + returns 1 if categories are enabled or 0 if not + } { + if { [empty_string_p [category_tree::get_mapped_trees [ad_conn package_id]]] } { + return 0 + } else { + return 1 + } + } + + + ad_proc -public get_selects { + {-export_vars ""} + {-category_id ""} + } { + } { + # this is borrowed from project-manager but will be re-written + + + # Categories are arranged into category trees. + # Set up an array for each tree. The array contains the category for each tree + set package_id [ad_conn package_id] + + set category_select "" + set number_of_categories 0 + set last_tree "" + set category_select "" + + db_foreach get_categories {} { + + if {![string equal $tree_name $last_tree] } { + append category_select "" + } + + if {[string equal $cat_id $category_id]} { + set select "selected" + } else { + set select "" + } + + append category_select "" + + set last_tree $tree_name + incr number_of_categories + } + + if {$number_of_categories < 1} { + return "" + } + + set return_val "
$export_vars +
" + + return $return_val +} + +} +