Index: openacs-4/packages/contacts/www/message-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/message-ae.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/contacts/www/message-ae.tcl 11 May 2006 13:49:02 -0000 1.10 +++ openacs-4/packages/contacts/www/message-ae.tcl 14 Dec 2006 09:13:23 -0000 1.11 @@ -79,13 +79,37 @@ } oo_mailing { set banner_options [util::find_all_files -extension jpg -path "[acs_root_dir][parameter::get_from_package_key -package_key contacts -parameter OOMailingPath]/banner"] - set banner_options [concat [list ""] $banner_options] - append form_elements { - {banner:text(select),optional - {label "[_ contacts.Banner]"} - {help_text "[_ contacts.Banner_help_text]"} - {options $banner_options} + if {![string eq $banner_options ""]} { + set banner_options [concat [list ""] $banner_options] + append form_elements { + {banner:text(select),optional + {label "[_ contacts.Banner]"} + {help_text "[_ contacts.Banner_help_text]"} + {options $banner_options} + } } + } + + set oo_mailing_path "[acs_root_dir][parameter::get_from_package_key -package_key contacts -parameter OOMailingPath]/" + set oo_template_options "" + if {![catch {glob -path $oo_mailing_path -type d *} path_list]} { + foreach template_path $path_list { + lappend oo_template_options [list [file tail $template_path] $template_path] + } + } + + if {![string eq $oo_template_options ""]} { + set oo_template_options [concat [list ""] $oo_template_options] + append form_elements { + {oo_template:text(select),optional + {label "[_ contacts.OOTemplate]"} + {help_text "[_ contacts.OOTemplate_help_text]"} + {options $oo_template_options} + } + } + } + + append form_elements { {content:richtext(richtext) {label "[_ contacts.Message]"} {html {cols 70 rows 24}}} {ps:text(text),optional {label "[_ contacts.PS]"} @@ -120,7 +144,7 @@ db_1row get_data { select * from contact_messages where item_id = :item_id } if { $message_type != "email" } { set content [list $content $content_format] - } + } } -on_submit { @@ -154,6 +178,7 @@ -content_format $content_format \ -locale $locale \ -banner $banner \ + -oo_template $oo_template \ -ps $ps } -after_submit {