# $Id: theme.itcl,v 1.2 2005/08/03 06:02:46 davidlallen Exp $ # Updated to save to update the confguration file proc action_gallery {chan path env} { global source_dir if {[string index $path 0] == "/"} { set parsedPath [split $path {/}] set fsid [lindex $parsedPath 1] if { $fsid == "import" } { puts $chan [html_start "JPG Imported"] gallery_import $chan [join [lrange $parsedPath 2 end] {/}] $env puts $chan [html_end] return } } set style { } puts $chan [html_start "Gallery Browser" "" $style] puts $chan {
" file delete $oldpath } } if { [catch {file rename $filepath "$source_dir/images/Gallery"}] == 1} { puts $chan "Error Moving File
" file delete $filepath } else { puts $chan "Successfully Loaded Image
"
}
}
}
} else {
puts $chan [html_form_start "POST" "/gallery/import/" "enctype='multipart/form-data'"]
puts $chan "Images must be in JPEG format with a .jpg extension.
"
puts $chan [html_table_start "" "" ""]
puts $chan [tr "" [td "Image File"] [td [html_form_input {file" accept="image/jpeg" size="48} "file" ""]]]
puts $chan [html_table_end]
puts $chan [html_form_input "submit" "submit" "Import"]
puts $chan [html_form_end]
}
puts $chan "
"
puts $chan [html_link "/gallery" "Back to Gallery"]
}
register_module "gallery" "Gallery" "View the image gallery"