- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::PageInstanceEditForm
::xowiki::PageInstanceEditForm create ... \
[ -f.name (default "= inform") ] \
[ -f.nls_language (default "nls_language:text(hidden)") ] \
[ -f.page_template (default "page_template:text(hidden)") ] \
[ -field_list_bottom (default "page_template description nls_language") ] \
[ -field_list_top (default "item_id name page_order title creator") ] \
[ -textfieldspec (default "text(textarea),nospell {html {cols 60 rows 5}}") ] \
[ -with_categories (default "true") ]
Class Relations
::xotcl::Class create ::xowiki::PageInstanceEditForm \ -superclass ::xowiki::WikiFormMethods (to be applied on instances)
edit_data (scripted)
:log "-- " set __ia [${:data} set instance_attributes] foreach var ${:page_instance_form_atts} { dict set __ia $var [:var $var] } ${:data} set instance_attributes $__ia set item_id [next] :log "-- edit_data item_id=$item_id" return $item_idedit_request (scripted)
:log "-- " next set __ia [${:data} set instance_attributes] foreach var ${:page_instance_form_atts} { if {[dict exists $__ia $var]} {:var $var [list [dict get $__ia $var]]} }f.name (setter)
f.nls_language (setter)
f.page_template (setter)
field_list_bottom (setter)
field_list_top (setter)
init (scripted)
set item_id [${:data} form_parameter item_id:int32] # # make sure to have page template object loaded # set page_template_id [${:data} form_parameter page_template ""] if {$page_template_id eq ""} { set page_template_id [${:data} set page_template] } set template [::xo::db::CrClass get_instance_from_db -item_id $page_template_id] set dont_edit [concat [[${:data} info class] array names db_slot] [::xo::db::CrClass set common_query_atts]] set category_spec [${:data} get_short_spec @categories] foreach f [split $category_spec ,] { if {$f eq "off"} {set :with_categories false} } # # compute list of form instance attributes # set :page_instance_form_atts [list] foreach {var _} [${:data} template_vars [$template set text]] { if {$var ni $dont_edit} {lappend :page_instance_form_atts $var} } set :field_list [concat [:field_list_top] ${:page_instance_form_atts} [:field_list_bottom]] # # get widget specs from folder. # All other specs are taken form attributes or form constraints. # The widget_spec functionality might be deprecated in the future. # foreach __var ${:page_instance_form_atts} { set spec [${:data} widget_spec_from_folder_object $__var [$template set name]] if {$spec ne ""} { set :f.$__var "$__var:$spec" } } :edit_page_title [${:data} get_from_template title] next #:log "--fields = [:fields]"new_data (scripted)
set __vars {folder_id item_id page_template return_url} set object_type [[${:data} info class] object_type] #:log "-- class=[${:data} info class] object_type=$object_type $__vars" foreach __v $__vars {set $__v [${:data} from_parameter $__v] ""} set item_id [next] set link [${:data} pretty_link] :submit_link [export_vars -no_base_encode -base $link {{m edit} $__vars}] # :log "-- submit_link = [:submit_link]" return $item_idtextfieldspec (setter)
tidy (scripted)
# nothing
with_categories (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables