Index: openacs-4/packages/ams/tcl/ams-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs-postgresql.xql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 22 Jul 2005 07:49:17 -0000 1.12 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 6 Oct 2005 22:24:41 -0000 1.13 @@ -151,7 +151,7 @@ - + select alam.attribute_id, alam.section_heading, @@ -171,7 +171,7 @@ - + select ams_attribute_value__value(av.attribute_id,av.value_id) as value, widget,attribute_name,av.attribute_id from ams_attribute_values av, ams_attributes aa Index: openacs-4/packages/ams/tcl/ams-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/ams/tcl/ams-procs.tcl 9 Sep 2005 17:43:09 -0000 1.23 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 6 Oct 2005 22:24:41 -0000 1.24 @@ -374,6 +374,27 @@ {-format "text"} {-locale ""} } { + This returns a list with the first element as the pretty_attribute name + and the second the value. Cached +} { + return [util_memoize [list ams::values_not_cached \ + -package_key $package_key \ + -object_type $object_type \ + -list_name $list_name \ + -object_id $object_id \ + -format $format \ + -locale $locale]] +} + + +ad_proc -public ams::values_not_cached { + -package_key:required + -object_type:required + -list_name:required + -object_id:required + {-format "text"} + {-locale ""} +} { this returns a list with the first element as the pretty_attribute name and the second the value } { if { $format != "html" } { @@ -397,6 +418,7 @@ } } + ad_proc -public ams::value { -object_id:required -attribute_id @@ -405,6 +427,30 @@ {-locale ""} } { Return the value of an attribute for a certain object. You can + provide either the attribute_id or the attribute_name. Cached. + + @param object_id The object for which the value is stored + @param attribute_id The attribute_id of the attribute for which the value is retrieved + @param attribute_name Alternatively the attribute_name for the attribute + @return + @error +} { + return [util_memoize [list ams::value_not_cached \ + -object_id $object_id \ + -attribute_id $attribute_id \ + -attribute_name $attribute_name \ + -format $format \ + -locale $locale]] +} + +ad_proc -public ams::value_not_cached { + -object_id:required + -attribute_id + -attribute_name + {-format "html"} + {-locale ""} +} { + Return the value of an attribute for a certain object. You can provide either the attribute_id or the attribute_name @author Malte Sussdorff (sussdorff@sussdorff.de)