Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -N -r1.57 -r1.58 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 25 Mar 2008 23:15:59 -0000 1.57 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 26 Mar 2008 13:42:06 -0000 1.58 @@ -50,6 +50,8 @@ object slot answer + feedback_answer_correct + feedback_answer_incorrect } FormField set abstract 1 FormField instproc init {} { Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -N -r1.218 -r1.219 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 25 Mar 2008 22:52:13 -0000 1.218 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 26 Mar 2008 13:42:06 -0000 1.219 @@ -1276,6 +1276,12 @@ return $default_spec } + PageInstance instproc get_form {} { + set form [my get_from_template form] + if {[llength $form] == 2 && [lindex $form 1] eq "text/html"} {set form [lindex $form 0]} + return $form + } + PageInstance instproc get_form_id {} { return [my page_template] } @@ -1292,7 +1298,8 @@ #my log "-- fetching page_template = $page_template" ::xo::db::CrClass get_instance_from_db -item_id $form_id } - #my msg "form_id=$form_id, [$form_id name] $var?[::$form_id exists $var]" + #my msg "form_id=$form_id ([$form_id name]), $var ?[::$form_id exists $var] page instance=[::$form_id istype ::xowiki::PageInstance] -> [$form_id info class]" + if {[::$form_id istype ::xowiki::PageInstance]} {return [::$form_id property $var]} if {[::$form_id exists $var]} {return [::$form_id set $var]} return "" } @@ -1497,7 +1504,7 @@ return [my field_names_from_form] } - FormPage instproc field_names_from_form {} { + FormPage instproc field_names_from_form {{-form ""}} { # # this method returns the form attributes (including _*) # @@ -1508,7 +1515,7 @@ set template [lindex [my get_from_template text] 0] #set field_names [list _name _title _description _creator _nls_language _page_order] set field_names [list] - set form [lindex [my get_from_template form] 0] + if {$form eq ""} {set form [my get_form]} if {$form eq ""} { foreach {var _} [my template_vars $template] { #if {[string match _* $var]} continue @@ -1550,8 +1557,8 @@ return [next] } else { ::xowiki::Form requireFormCSS - set form [lindex [my get_from_template form] 0] - foreach {form_vars field_names} [my field_names_from_form] break + set form [my get_form] + foreach {form_vars field_names} [my field_names_from_form -form $form] break my array unset __field_in_form if {$form_vars} {foreach v $field_names {my set __field_in_form($v) 1}} set form_fields [my create_form_fields $field_names] Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -N -r1.135 -r1.136 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 25 Mar 2008 13:36:19 -0000 1.135 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 26 Mar 2008 13:42:06 -0000 1.136 @@ -723,9 +723,9 @@ return $form_fields } - FormPage instproc field_names {} { + FormPage instproc field_names {{-form ""}} { my instvar package_id - foreach {form_vars needed_attributes} [my field_names_from_form] break + foreach {form_vars needed_attributes} [my field_names_from_form -form $form] break #my msg "form_vars=$form_vars needed_attributes=$needed_attributes" my array unset __field_in_form if {$form_vars} {foreach v $needed_attributes {my set __field_in_form($v) 1}} @@ -758,7 +758,7 @@ return $field_names } - Page instproc field_names {} { + Page instproc field_names {{-form ""}} { array set dont_modify [list item_id 1 revision_id 1 object_id 1 object_title 1 page_id 1 name 1] set field_names [list] foreach field_name [[my info class] array names db_slot] { @@ -873,9 +873,14 @@ ::xowiki::Form requireFormCSS - set form [lindex [my get_from_template form] 0] + set form [my get_form] set anon_instances [my get_from_template anon_instances] + #my msg anon_instances=$anon_instances + #my msg form=$form + set field_names [my field_names -form $form] + set form_fields [my create_form_fields $field_names] + if {$form eq ""} { # # Since we have no form, we create it on the fly @@ -887,9 +892,6 @@ set formgiven 1 } - set field_names [my field_names] - set form_fields [my create_form_fields $field_names] - # check name field: # - if it is not required, hide it, # - if it is required but hidden, show it anyway