Class ::xowiki::Form
::xowiki::Form
create ...
Class Relations
- class: ::xo::db::CrClass
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xowiki::PageTemplate
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xo::db::CrClass create ::xowiki::Form \
-superclass ::xowiki::PageTemplate
Methods (to be applied on the object)
add_dom_attribute_value (scripted)
if {[$dom_node hasAttribute $attr]} {
set old_value [$dom_node getAttribute $attr]
if {$value ni $old_value} {
append value " " $old_value
} else {
set value $old_value
}
}
$dom_node setAttribute $attr $valuedisable_input_fields (scripted)
dom parse -html -- $form doc
$doc documentElement root
if {$root ne ""} {
:dom_disable_input_fields -with_submit $with_submit $root
set form [lindex [$root selectNodes //form] 0]
set marginForm [::template::CSS class "margin-form"]
if {$marginForm ne ""} {
Form add_dom_attribute_value $form class $marginForm
}
return [$root asHTML]
} else {
ns_log notice "Form $form is apparently empty"
}dom_disable_input_fields (scripted)
set fields [$root selectNodes "//button | //input | //optgroup | //option | //select | //textarea "]
set disabled [list]
foreach field $fields {
set type ""
if {[$field hasAttribute type]} {set type [$field getAttribute type]}
if {$type eq "submit" && !$with_submit} continue
if {$type eq "hidden"} continue
$field setAttribute disabled "disabled"
if {[$field hasAttribute name]} {
lappend disabled [$field getAttribute name]
}
}
return $disabledrequireFormCSS (scripted)
set css ${:extraCSS}
if {$css ne ""} {
::xo::Page requireCSS $css
}
Methods (to be applied on instances)
demarshall (scripted)
if {![info exists :anon_instances]} {
set :anon_instances "t"
}
nextfooter (scripted)
return [:include [list form-menu -form_item_id ${:item_id}]]form (setter)
form_constraints (setter)
get_form_constraints (scripted)
return [:form_constraints]
is_form (scripted)
return 1
marshall (scripted)
next
mime_type (setter)
render_content (scripted)
::xowiki::Form requireFormCSS
if {[lindex ${:text} 0] ne ""} {
set :do_substitutions 0
set html ""; set mime ""
lassign ${:text} html mime
set content [:substitute_markup $html]
} elseif {[lindex ${:form} 0] ne ""} {
set content [[self class] disable_input_fields [template::adp_parse_tags [lindex ${:form} 0]]]
} else {
set content ""
}
return $contentupdate (scripted)
::xo::dc transaction {
next
:instvar object_id form form_constraints
::xo::dc dml update_xowiki_form {update xowiki_form
set form = :form,form_constraints = :form_constraints where xowiki_form_id = :object_id
}
}xowiki_form_id (setter)