- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::Form
::xowiki::Form create ...
Class Relations
::xo::db::CrClass create ::xowiki::Form \ -superclass ::xowiki::PageTemplateMethods (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 -simple -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 [::xowiki::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 # Disabled fields are not transmitted from the form; # some applications expect hidden fields to be transmitted # to identify the context, so don't disable it... if {$type eq "hidden"} continue $field setAttribute disabled "disabled" if {[$field hasAttribute name]} { lappend disabled [$field getAttribute name] } } #set fa [$root selectNodes {//input[@name='__form_action']}] #if {$fa ne ""} { # $fa setAttribute value "view-form-data" #} return $disabledrequireFormCSS (scripted)
#:msg requireFormCSS set css ${:extraCSS} if {$css ne ""} { ::xo::Page requireCSS $css }Methods (to be applied on instances)
demarshall (scripted)
# Some older versions do not have anon_instances and no slots 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)
# We define it as a method to ease overloading. return [:form_constraints]is_form (scripted)
return 1marshall (scripted)
#set form_fields [:create_form_fields_from_form_constraints [:get_form_constraints]] #:log "--ff=$form_fields" # :build_instance_attribute_map $form_fields nextmime_type (setter)
render_content (scripted)
::xowiki::Form requireFormCSS # # We assume that the richtext is stored as 2-element list with # mime-type. # #:log "-- text='${:text}'" 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 ""} { # # The method "disable_input_fields" consists essentially of # # dom parse -simple $form doc # ... # return [$root asHTML] # # Unfortunately, this causes that some tags unknown to tdom # (like <adp:icon>) are converted to escaped tags (< ...). # This can be regarded as a bug. To avoid this problem, we # substitute here the adp_tags in advance. This needs more # investigation in other cases.... The potential harm in this # cases here is very little, but probably, there are other # cases as well where this might harm. # 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)
Variables
::xowiki::Form set __default_metaclass ::xotcl::Class ::xowiki::Form set __default_superclass ::xotcl::Object ::xowiki::Form set abstract_p f ::xowiki::Form set auto_save false ::xowiki::Form array set db_constraints {form {{default {}} {default {}}} form_constraints \ {{default {}} {default {}}}} ::xowiki::Form array set db_slot \ {page_order ::xowiki::Page::slot::page_order creator ::xowiki::Page::slot::creator page_id \ ::xowiki::Page::slot::page_id creation_date ::xo::db::Object::slot::creation_date \ anon_instances ::xowiki::PageTemplate::slot::anon_instances creation_user \ ::xo::db::Object::slot::creation_user object_id ::xo::db::Object::slot::object_id form \ ::xowiki::Form::slot::form page_template_id ::xowiki::PageTemplate::slot::page_template_id \ description ::xowiki::Page::slot::description creation_ip ::xo::db::Object::slot::creation_ip \ text ::xowiki::Page::slot::text nls_language ::xo::db::CrItem::slot::nls_language \ object_title ::xo::db::Object::slot::object_title package_id \ ::xo::db::Object::slot::package_id security_inherit_p \ ::xo::db::Object::slot::security_inherit_p context_id ::xo::db::Object::slot::context_id \ mime_type ::xo::db::CrItem::slot::mime_type name ::xo::db::CrItem::slot::name xowiki_form_id \ ::xowiki::Form::slot::xowiki_form_id title ::xowiki::Page::slot::title form_constraints \ ::xowiki::Form::slot::form_constraints item_id ::xo::db::CrItem::slot::item_id revision_id \ ::xo::db::CrItem::slot::revision_id publish_date ::xowiki::Page::slot::publish_date \ modifying_user ::xo::db::Object::slot::modifying_user last_modified \ ::xo::db::Object::slot::last_modified modifying_ip ::xo::db::Object::slot::modifying_ip} ::xowiki::Form set extraCSS {} ::xowiki::Form set folder_id -100 ::xowiki::Form set form ::xowiki::FormForm ::xowiki::Form set id_column xowiki_form_id ::xowiki::Form array set long_text_slots \ {form ::xowiki::Form::slot::form form_constraints ::xowiki::Form::slot::form_constraints} ::xowiki::Form set mime_type text/plain ::xowiki::Form set name_method {} ::xowiki::Form set non_cached_instance_var_patterns __* ::xowiki::Form set object_type ::xowiki::Form ::xowiki::Form set object_type_key 0000000000001111000110010000000100000000 ::xowiki::Form set pretty_name {#xowiki.Form_pretty_name#} ::xowiki::Form set pretty_plural {#xowiki.Form_pretty_plural#} ::xowiki::Form set security_inherit_p t ::xowiki::Form set sql_package_name ::xowiki::Form ::xowiki::Form set storage_type text ::xowiki::Form set supertype content_revision ::xowiki::Form set table_name xowiki_form ::xowiki::Form set with_table true
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables