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 -r1.54 -r1.55 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 10 Mar 2008 13:16:02 -0000 1.54 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 12 Mar 2008 12:04:13 -0000 1.55 @@ -280,6 +280,25 @@ # which is in most cases a simple input fied of type string. ::html::input [my get_attributes type size maxlength id name value] {} } + + FormField instproc render_item {} { + ::html::div -class form-item-wrapper { + ::html::div -class form-label { + ::html::label -for [my id] { + ::html::t [my label] + } + if {[my required]} { + ::html::div -class form-required-mark { + ::html::t " (#acs-templating.required#)" + } + } + } + my render_form_widget + my render_help_text + my render_error_msg + html::t \n + } + } FormField instproc render_error_msg {} { if {[my error_msg] ne ""} { @@ -308,25 +327,6 @@ # This method will be overloaded in trn mode by a mixin. } - FormField instproc render_item {} { - ::html::div -class form-item-wrapper { - ::html::div -class form-label { - ::html::label -for [my id] { - ::html::t [my label] - } - if {[my required]} { - ::html::div -class form-required-mark { - ::html::t " (#acs-templating.required#)" - } - } - } - my render_form_widget - my render_help_text - my render_error_msg - html::t \n - } - } - FormField instproc localize {v} { # We localize in pretty_value the message keys in the # language of the item (not the connection item). @@ -360,14 +360,11 @@ Class FormField::submit_button -superclass FormField FormField::submit_button instproc initialize {} { my set type submit + my set value [::xo::localize [_ xowiki.Form-submit_button]] } FormField::submit_button instproc render_input {} { - my set value [::xo::localize [_ xowiki.Form-submit_button]] - ::html::div -class form-button { - #::html::br - ::html::input [my get_attributes type {CSSclass class} value] {} - my render_localizer - } + ::html::input [my get_attributes name type {CSSclass class} value] {} + my render_localizer } ########################################################### 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 -r1.132 -r1.133 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 12 Mar 2008 09:24:14 -0000 1.132 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 12 Mar 2008 12:04:13 -0000 1.133 @@ -855,6 +855,15 @@ } } + FormPage instproc render_form_action_buttons {{-CSSclass ""}} { + ::html::div -class form-button { + set f [::xowiki::FormField::submit_button new -destroy_on_cleanup \ + -name __form_button_ok \ + -CSSclass $CSSclass] + $f render_input + } + } + FormPage instproc edit { {-validation_errors ""} } { @@ -944,26 +953,6 @@ array set __ia [my set instance_attributes] my load_values_into_form_fields $form_fields foreach f $form_fields {set ff([$f name]) $f } -# foreach att $field_names { -# #my msg "setting HTML att $att" -# switch -glob $att { -# __* {} -# _* { -# set f [my lookup_form_field -name $att $form_fields] -# set varname [string range $att 1 end] -# $f value [my set $varname] -# } -# default { -# set f [my lookup_form_field -name $att $form_fields] -# #my msg "check $att f=$f [info exists __ia($att)]" -# if {[info exists __ia($att)]} { -# #my msg "setting $f ([$f info class]) value $__ia($att)" -# $f value $__ia($att) -# } -# } -# } -# set ff($att) $f -# } # for named entries, just set the entry fields to empty, # without changing the instance variables @@ -1043,17 +1032,16 @@ } } - # insert unreported errors and add a submit field at bottom + # insert unreported errors foreach f $form_fields { if {[$f set error_msg] ne "" && ![$f exists error_reported]} { $f render_error_msg } } - set f [::xowiki::FormField::submit_button new -destroy_on_cleanup \ - -name __form_button_ok \ - -CSSclass $submit_button_class] - $f render_input + # add a submit field(s) at bottom + my render_form_action_buttons -CSSclass $submit_button_class } + set form [lindex [$root selectNodes //form] 0] if {$form eq ""} { my msg "no form found in page [$page_template name]"