Index: openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 10 Mar 2003 19:19:14 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 2 Aug 2003 00:40:01 -0000 1.8 @@ -344,6 +344,10 @@ signature for the whole list. For :array it also expects one signature only, taken on the [array get] form of the array. +
cached +
This syntax will check to see if a value is being passed in for this variable. If it is not, it will then look in + cache for this variable in the package that this page is located, and get this value if it exists. +
date
Pluggable filter, installed by default, that makes sure the array validates as a date. Use this filter with :array to do automatic date filtering. To use it, set up in your HTML form @@ -956,6 +960,28 @@ foreach formal_name $apc_formals { upvar 1 $formal_name var + + if { [info exists apc_internal_filter($formal_name:cached)] } { + if { ![ad_page_contract_get_validation_passed_p $formal_name] && ![info exists apc_internal_filter($formal_name:notnull)] && (![info exists apc_default_value($formal_name)] || [empty_string_p $apc_default_value($formal_name)]) } { + if { [info exists apc_internal_filter($formal_name:array)] } { + # This is an array variable, so we need to loop through each name.* variable for this package we have ... + set array_list "" + foreach arrayvar [ns_cache names util_memoize] { + if [regexp [list [ad_conn session_id] [ad_conn package_id] "$formal_name."] $arrayvar] { + set arrayvar [lindex $arrayvar [expr [llength $arrayvar] - 1]] + if { ![empty_string_p $array_list] } { + append array_list " " + } + set arrayvar_formal [string range $arrayvar [expr [string first "." $arrayvar] + 1] [string length $arrayvar]] + append array_list "{$arrayvar_formal} {[ad_get_client_property [ad_conn package_id] $arrayvar]}" + } + } + set apc_default_value($formal_name) $array_list + } else { + set apc_default_value($formal_name) [ad_get_client_property [ad_conn package_id] $formal_name] + } + } + } if { [ad_page_contract_get_validation_passed_p $formal_name] } { @@ -1124,6 +1150,7 @@ trim {internal} notnull {internal} verify {internal} + cached {internal} } nsv_array set ad_page_contract_filter_rules [list]