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.5 -r1.3.2.6 --- openacs-4/packages/forums/lib/message/post.tcl 4 Dec 2004 20:44:12 -0000 1.3.2.5 +++ openacs-4/packages/forums/lib/message/post.tcl 13 Dec 2004 00:19:56 -0000 1.3.2.6 @@ -43,10 +43,6 @@ -datatype text \ -widget hidden -if { [exists_and_not_null content] && [exists_and_not_null format] } { - element set_properties message message_body -value [list $content $format] -} - if {[form is_request message]} { ############################## # Form initialisation @@ -71,7 +67,7 @@ set init_msg(attach_p) 0 form set_values message init_msg - + } elseif {[form is_valid message]} { ############################## @@ -83,11 +79,17 @@ parent_id \ subject \ message_body \ - format \ confirm_p \ subscribe_p \ anonymous_p \ attach_p + + ns_log notice " +DB -------------------------------------------------------------------------------- +DB DAVE debugging /var/lib/aolserver/openacs-5-1/packages/forums/lib/message/post.tcl +DB -------------------------------------------------------------------------------- +DB message_body = '${message_body}' +DB --------------------------------------------------------------------------------" if { [empty_string_p $anonymous_p] } { set anonymous_p 0 } @@ -102,20 +104,9 @@ set confirm_p 1 set subject.spellcheck ":nospell:" set content.spellcheck ":nospell:" - set content $message_body - set format $format + set content [template::util::richtext::get_property content $message_body] + set format [template::util::richtext::get_property format $message_body] - if {$format == "html"} { - set content "$content" - - } elseif {$format == "pre"} { - set content [ad_text_to_html $content] - set format "html" - } else { - set content [ad_quotehtml $content] - set format "html" - } - 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 @@ -144,25 +135,21 @@ } if { [string equal $action "post"] } { - 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] - } - - + ns_log notice " +DB -------------------------------------------------------------------------------- +DB DAVE debugging /var/lib/aolserver/openacs-5-1/packages/forums/lib/message/post.tcl +DB -------------------------------------------------------------------------------- +DB message_body = '${message_body}' +DB --------------------------------------------------------------------------------" + set content [template::util::richtext::get_property content $message_body] + set format [template::util::richtext::get_property format $message_body] forum::message::new \ -forum_id $forum_id \ -message_id $message_id \ -parent_id $parent_id \ -subject $subject \ -content $content \ - -format "text/html" \ + -format $format \ -user_id $displayed_user_id # DRB: Black magic cache flush call which will disappear when list builder is Index: openacs-4/packages/forums/lib/message/row.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/row.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/forums/lib/message/row.tcl 22 Jun 2004 16:53:41 -0000 1.1.2.1 +++ openacs-4/packages/forums/lib/message/row.tcl 13 Dec 2004 00:20:15 -0000 1.1.2.2 @@ -17,10 +17,11 @@ set table_bgcolor $bgcolor } -if { [string compare $message(format) "text/plain"] == 0 } { - set message(content) [ad_text_to_html -- $message(content)] -} +#if { [string compare $message(format) "text/plain"] == 0 } { +set message(content) [ad_html_text_convert -from $message(format) -to text/html -- $message(content)] +#} + # convert emoticons to images if the parameter is set if { [string is true [parameter::get -parameter DisplayEmoticonsAsImagesP -default 0]] } { set message(content) [forum::format::emoticons -content $message(content)] 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.3 -r1.2.2.4 --- openacs-4/packages/forums/tcl/form-procs.tcl 12 Oct 2004 22:10:50 -0000 1.2.2.3 +++ openacs-4/packages/forums/tcl/form-procs.tcl 13 Dec 2004 00:20:41 -0000 1.2.2.4 @@ -37,23 +37,10 @@ template::element create $form_name ${prefix}message_body \ -label [_ forums.Body] \ - -datatype text \ - -widget textarea \ + -datatype richtext \ + -widget richtext \ -html {rows 20 cols 60 wrap soft} \ - $optional_switch \ - -validate [list \ - html_security_check \ - "expr \{ \ - \[ns_queryget ${prefix}format\] != \"html\" || \ - \[empty_string_p \[set v_message \[ad_html_security_check \$value\]\]\] \ - \}" \ - "Message contains HTML tags that are not allowed."] - - template::element create $form_name ${prefix}format \ - -label "Format" \ - -datatype text \ - -widget select \ - -options {{"Preformatted Text" "pre"} {"Plain Text" "plain"} {HTML "html"}} + $optional_switch }