Index: openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl,v diff -u -N -r1.41.2.30 -r1.41.2.31 --- openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 13 Aug 2020 18:16:34 -0000 1.41.2.30 +++ openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 26 Aug 2020 18:34:59 -0000 1.41.2.31 @@ -660,6 +660,34 @@ ::xo::Package instforward exists_form_parameter {%set :context} %proc ::xo::Package instforward returnredirect {%set :context} %proc + ::xo::Package instproc instantiate_forms { + -forms:required + {-default_lang ""} + {-parent_id ""} + } { + set form_item_ids [list] + foreach item_ref [split $forms |] { + # + # The following regexp should include the majority of valid + # items refs. + # + if {![regexp {^[[:alnum:]:./_-]+$} $item_ref]} { + error "invalid form specification '$item_ref'" + } + #:log "trying to get $item_ref // parent_id $parent_id" + set page [:get_page_from_item_ref \ + -use_prototype_pages true \ + -use_package_path true \ + -parent_id $parent_id \ + $item_ref] + #:log "weblog form $item_ref => $page" + if {$page ne ""} { + lappend form_item_ids [$page item_id] + } + } + #:log "instantiate: parent_id=$parent_id-forms=$forms -> $form_item_ids" + return $form_item_ids + } ::xo::Package instproc get_parameter {attribute {default ""}} { set package_id ${:id} set parameter_obj [::xo::parameter get_parameter_object \