- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::FileForm
::xowiki::FileForm create ... \
[ -f.name (default "= optional,help_text=#xowiki.File-name-help_text#") ] \
[ -f.text (default "upload_file:file(file),optional {label #xowiki.content#} {html {size 30}} ") ] \
[ -f.title (default "= optional") ] \
[ -field_list (default "item_id name page_order text title creator description") ] \
[ -html (default " enctype multipart/form-data ") ] \
[ -validate (default " {upload_file {\[::xowiki::validate_file\]} {For new entries, a upload file must be provided}} {page_order {\[::xowiki::validate_form_field page_order\]} {Page Order invalid; might only contain upper and lowercase letters, underscore, digits and dots}} {name {\[::xowiki::validate_name\]} {Another item with this name exists already in this folder}} ") ]
Class Relations
::xotcl::Class create ::xowiki::FileForm \ -superclass ::xowiki::WikiFormMethods (to be applied on instances)
edit_data (scripted)
#:get_uploaded_file return [next]f.name (setter)
f.text (setter)
f.title (setter)
field_list (setter)
get_uploaded_file (scripted)
#:log "--F... [ns_conn url] [ns_conn query] form vars = [ns_set array [ns_getform]]" set upload_file [${:data} form_parameter upload_file] # :log "--F... upload_file = $upload_file" if {$upload_file ne "" && $upload_file ne "{}"} { ${:data} set upload_file $upload_file ${:data} set import_file [${:data} form_parameter upload_file.tmpfile] set mime_type [${:data} form_parameter upload_file.content-type] if {[::xo::dc 0or1row check_mimetype { select 1 from cr_mime_types where mime_type = :mime_type }] == 0 || $mime_type eq "application/octet-stream" || $mime_type eq "application/force-download"} { set guessed_mime_type [::xowiki::guesstype $upload_file] #:msg guess=$guessed_mime_type if {$guessed_mime_type ne "*/*"} { set mime_type $guessed_mime_type } } ${:data} set mime_type $mime_type } elseif {[${:data} name] ne ""} { # :log "--F no upload_file provided [lsort [${:data} info vars]]" if {[${:data} exists mime_type]} { :log "--mime_type=[${:data} set mime_type]" #:log " text=[${:data} set text]" regexp {^[^:]+:(.*)$} [${:data} set name] _ upload_file ${:data} set upload_file $upload_file ${:data} set import_file [${:data} full_file_name] # :log "--F upload_file $upload_file import_file [${:data} full_file_name]" #:log " import_type=[${:data} set import_file]" } } else { # :log "--F no name and no upload file" ${:data} set upload_file "" }html (setter)
new_data (scripted)
#:get_uploaded_file return [next]tidy (scripted)
# nothing
validate (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables