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.10 -r1.11 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 31 May 2005 16:10:13 -0000 1.10 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 10 Jun 2005 09:43:22 -0000 1.11 @@ -1,17 +1,17 @@ - + select pretty_name from ams_attributes where attribute_id = :attribute_id - + - select pretty_pluralo + select pretty_plural from ams_attributes where attribute_id = :attribute_id 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.12 -r1.13 --- openacs-4/packages/ams/tcl/ams-procs.tcl 9 Jun 2005 16:12:05 -0000 1.12 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 10 Jun 2005 09:43:22 -0000 1.13 @@ -18,14 +18,30 @@ ad_proc -public attribute::pretty_name { {-attribute_id:required} } { - get the pretty_name of an attribute + get the pretty_name of an attribute. Cached } { + return [util_memoize [list ::attribute::pretty_name_not_cached -attribute_id $attribute_id]] +} + +ad_proc -public attribute::pretty_name_not_cached { + {-attribute_id:required} +} { + get the pretty_name of an attribute +} { return [db_string get_pretty_name {} -default {}] } ad_proc -public attribute::pretty_plural { {-attribute_id:required} } { + get the pretty_plural of an attribute. Cached +} { + return [util_memoize [list ::attribute::pretty_plural_not_cached -attribute_id $attribute_id]] +} + +ad_proc -public attribute::pretty_plural_not_cached { + {-attribute_id:required} +} { get the pretty_plural of an attribute } { return [db_string get_pretty_plural {} -default {}] @@ -191,6 +207,7 @@ Create a new ams option for an attribute } { + db_1row get_object_data { select object_type, attribute_name from ams_attributes where attribute_id = :attribute_id } set option [lang::util::convert_to_i18n -prefix "${object_type}_${attribute_name}" -text "$option"] set extra_vars [ns_set create]