Index: openacs-4/packages/forums/lib/message/post-confirm.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/post-confirm.adp,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/forums/lib/message/post-confirm.adp 17 Dec 2003 15:45:29 -0000 1.1
+++ openacs-4/packages/forums/lib/message/post-confirm.adp 9 Aug 2004 17:49:21 -0000 1.1.2.1
@@ -2,6 +2,7 @@
<% set table_border_color [parameter::get -parameter table_border_color] %>
+
Index: openacs-4/packages/forums/lib/message/post.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/post.tcl,v
diff -u -r1.3.2.2 -r1.3.2.3
--- openacs-4/packages/forums/lib/message/post.tcl 22 Jun 2004 16:53:41 -0000 1.3.2.2
+++ openacs-4/packages/forums/lib/message/post.tcl 9 Aug 2004 17:49:21 -0000 1.3.2.3
@@ -73,6 +73,7 @@
form set_values message init_msg
} elseif {[form is_valid message]} {
+
##############################
# Form processing
#
@@ -82,6 +83,7 @@
parent_id \
subject \
message_body \
+ format \
confirm_p \
subscribe_p \
anonymous_p \
@@ -96,12 +98,23 @@
0]
if { [string equal $action "preview"] } {
+
set confirm_p 1
set subject.spellcheck ":nospell:"
set content.spellcheck ":nospell:"
- set content [string trimright [template::util::richtext::get_property contents $message_body]]
- set format [string trimright [template::util::richtext::get_property format $message_body]]
- set exported_vars [export_vars -form {message_id forum_id parent_id subject {message_body $content} {message_body.format $format} confirm_p subject.spellcheck content.spellcheck anonymous_p attach_p}]
+ set content $message_body
+ set format $format
+
+ if {$format == "html"} {
+ set content "$content"
+ } elseif {$format == "pre"} {
+ set content [ad_text_to_html $content]
+
+ } else {
+ set content [ad_quotehtml $content]
+ }
+
+ set exported_vars [export_vars -form {message_id forum_id parent_id subject {message_body $content} format confirm_p subject.spellcheck content.spellcheck anonymous_p attach_p}]
set message(format) $format
set message(subject) $subject
@@ -129,15 +142,25 @@
}
if { [string equal $action "post"] } {
- set content [string trimright [template::util::richtext::get_property contents $message_body]]
- set format [string trimright [template::util::richtext::get_property format $message_body]]
+ set content $message_body
+ set format $format
+
+ if {$format == "html"} {
+ set content "$content"
+ } elseif {$format == "pre"} {
+ set content [ad_text_to_html $content]
+ } else {
+ set content [ad_quotehtml $content]
+ }
+
+
forum::message::new \
-forum_id $forum_id \
-message_id $message_id \
-parent_id $parent_id \
-subject $subject \
-content $content \
- -format $format \
+ -format "html" \
-user_id $displayed_user_id
if {[empty_string_p $parent_id]} {
Index: openacs-4/packages/forums/tcl/form-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/form-procs.tcl,v
diff -u -r1.2.2.1 -r1.2.2.2
--- openacs-4/packages/forums/tcl/form-procs.tcl 22 Jun 2004 16:53:43 -0000 1.2.2.1
+++ openacs-4/packages/forums/tcl/form-procs.tcl 9 Aug 2004 17:49:22 -0000 1.2.2.2
@@ -29,10 +29,15 @@
template::element create $form_name ${prefix}message_body \
-label [_ forums.Body] \
- -datatype richtext \
- -widget richtext \
- -html {rows 20 cols 60 wrap soft} \
+ -datatype text \
+ -widget textarea \
+ -html {rows 20 cols 60 wrap soft}
+ template::element create $form_name ${prefix}format \
+ -label "Format" \
+ -datatype text \
+ -widget select \
+ -options {{"Preformatted Text" "pre"} {"Plain Text" "plain"} {HTML "html"}}
##############################
# Form validation
@@ -58,6 +63,7 @@
template::element set_properties $form_name ${prefix}message_body \
-validate $content_val
+
}
ad_proc -public forums::form::post_message {
Index: openacs-4/packages/forums/www/message-post.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post.tcl,v
diff -u -r1.31.2.1 -r1.31.2.2
--- openacs-4/packages/forums/www/message-post.tcl 22 Jun 2004 16:53:44 -0000 1.31.2.1
+++ openacs-4/packages/forums/www/message-post.tcl 9 Aug 2004 17:49:22 -0000 1.31.2.2
@@ -80,3 +80,5 @@
ad_return_template "message-post-confirm"
}
+
+