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.51 -r1.52 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 8 Jun 2007 12:04:14 -0000 1.51 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 21 Jun 2007 11:32:17 -0000 1.52 @@ -296,6 +296,69 @@ return $html } + FormInstance instproc edit {} { + my instvar page_template doc root package_id + + set form [lindex [my get_from_template form] 0] + my log "--forminstance form='$form'" + set anon_instances [my get_from_template anon_instances] + #set form_constraints [my get_from_template form_constraints] + #my log "--forminstance anon_instances='$anon_instances' fc='$form_constraints'" + my log "--forminstance anon_instances='$anon_instances'" + if {$form eq ""} { + #next -autoname $anon_instances -form_constraints $form_constraints + next -autoname $anon_instances + } else { + dom parse -simple -html $form doc + $doc documentElement root + + ::require_html_procs + $root firstChild fcn + $root insertBeforeFromScript { + ::html::input -type hidden -name __object_name -value [my name] + } $fcn + + if {$anon_instances eq "f"} { + $root insertBeforeFromScript { + ::html::div -class form-item-wrapper { + ::html::div -class form-label { + ::html::label -for __name { + ::html::t "#xowiki.name#" + } + } + ::html::div -class form-widget { + ::html::input -type text -name __name -value [my set name] + } + } + ::html::div -class form-item-wrapper { + ::html::div -class form-label { + ::html::label -for __title { + ::html::t "#xowiki.title#: " + } + } + ::html::div -class form-widget { + ::html::input -type text -name __title -value [my set title] + } + } + #::html::hr + } $fcn + } + $root appendFromList [list input [list type submit] {}] + + set form [lindex [$root selectNodes //form] 0] + if {$form eq ""} { + my msg "no form found in page [$page_template name]" + } else { + $form setAttribute action [$package_id pretty_link [my name]]?m=save-form-data method POST + } + my set_form_data + set result [$root asHTML] + my view $result + } + } + + + File instproc download {} { my instvar text mime_type package_id item_id revision_id $package_id set mime_type $mime_type