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.3 -r1.8.6.4
--- openacs-4/packages/categories/tcl/categories-procs.xql 31 May 2007 07:15:09 -0000 1.8.6.3
+++ openacs-4/packages/categories/tcl/categories-procs.xql 31 May 2007 10:03:53 -0000 1.8.6.4
@@ -138,7 +138,6 @@
-
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.1 -r1.20.2.2
--- openacs-4/packages/categories/tcl/category-trees-procs.tcl 27 May 2007 19:40:24 -0000 1.20.2.1
+++ openacs-4/packages/categories/tcl/category-trees-procs.tcl 31 May 2007 10:03:53 -0000 1.20.2.2
@@ -230,6 +230,22 @@
return $result
}
+ ad_proc -public get_id_by_object_title {
+ {-title}
+ } {
+ Gets the id of a category_tree given an object title (object_type=category).
+ This is highly useful as the category_tree object title will not change if you change the
+ name (label) of the category_tree, so you can access the category_tree even if the label has changed.
+ Why would you want this? E.g. if you have the category widget and want to get only one specific tree
+ displayed and not all of them.
+
+ @param title object title of the category to retrieve
+ @return the category_tree_id or empty string it no category was found
+ @author Malte Sussdorff (malte.sussdorff@cognovis.de)
+ } {
+ return [db_string get_tree_id {} -default ""]
+ }
+
ad_proc -public get_mapped_trees_from_object_list { object_id_list {locale ""}} {
Get the category trees mapped to a list of objects.
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.1 -r1.8.2.2
--- openacs-4/packages/categories/tcl/category-trees-procs.xql 27 May 2007 19:40:24 -0000 1.8.2.1
+++ openacs-4/packages/categories/tcl/category-trees-procs.xql 31 May 2007 10:03:53 -0000 1.8.2.2
@@ -35,6 +35,16 @@
+
+
+
+ select object_id
+ from acs_objects
+ where title = :title
+ and object_type = 'category_tree'
+
+
+
Index: openacs-4/packages/categories/tcl/widget-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/widget-procs.tcl,v
diff -u -r1.19 -r1.19.2.1
--- openacs-4/packages/categories/tcl/widget-procs.tcl 31 Jul 2006 20:31:11 -0000 1.19
+++ openacs-4/packages/categories/tcl/widget-procs.tcl 31 May 2007 10:03:53 -0000 1.19.2.1
@@ -14,9 +14,24 @@
namespace eval template::data::transform {}
namespace eval template::data::validate {}
-ad_proc -public template::widget::category { element_reference tag_attributes } {
- # author: Timo Hentschel (timo@timohentschel.de)
-
+ad_proc -public template::widget::category {
+ element_reference
+ tag_attributes
+} {
+ Display the category widget. This has a multitude of options:
+
+ - value: Values should be a list of two items: the object_id being viewed and the object_id which the trees are mapped to.
+ This will get the mapped trees (if no value provided defaults to package_id) and the mapped categories for the object_id. If you
+ do not provide a value, the following options are used:
+
- category_application_id>
+ - category_object_id
+ - category_tree_id
+ - category_subtree_id
+ - category_assign_single_p
+ - category_require_category_p
+
+ @author: Timo Hentschel (timo@timohentschel.de)
+} {
upvar $element_reference element
if { [info exists element(html)] } {