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.3 -r1.4
--- openacs-4/packages/forums/lib/message/row.tcl 13 Jan 2005 13:58:15 -0000 1.3
+++ openacs-4/packages/forums/lib/message/row.tcl 27 Jan 2005 16:08:31 -0000 1.4
@@ -1,26 +1,21 @@
ad_page_contract {
- a message chunk to be included in a table listing of messages
+ a message chunk to be included in a listing of messages
- _so that has to be wrapped in a
_
-
@author yon (yon@openforce.net)
@author arjun (arjun@openforce.net)
@creation-date 2002-06-02
@cvs-id $Id$
}
-if {![exists_and_not_null bgcolor]} {
- set table_bgcolor [parameter::get -parameter table_bgcolor]
-} else {
- set table_bgcolor $bgcolor
+set viewer_id [ad_conn user_id]
+
+if {![exists_and_not_null rownum]} {
+ set rownum 1
}
-
-#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]] } {
@@ -38,3 +33,61 @@
if {[exists_and_not_null alt_template]} {
ad_return_template $alt_template
}
+
+
+if {![info exists message(message_id)]} {
+ set message(message_id) none
+}
+if {![info exists message(tree_level)]} {
+ set message(tree_level) 0
+}
+
+if {![exists_and_not_null level_exp]} {
+ set level_exp 0
+}
+
+if {![exists_and_not_null moderate_p]} {
+ set moderate_p 0
+}
+
+if {![exists_and_not_null message(reply_p)]} {
+ set message(reply_p) 0
+}
+
+if {![exists_and_not_null display_mode]} {
+ set display_mode dynamic_minimal
+}
+
+if { $moderate_p } {
+ set table_name "forums_messages"
+} else {
+ set table_name "forums_messages_approved"
+}
+
+set links ""
+
+set allow_edit_own_p [parameter::get -parameter AllowUsersToEditOwnPostsP -default 0]
+set own_p [expr [string equal $message(user_id) $viewer_id] && $allow_edit_own_p]
+
+switch -exact $display_mode {
+ flat {
+ ad_return_template "../lib/message/row-flat"
+ return
+ }
+ nested {
+ ad_return_template "../lib/message/row-nested"
+ return
+ }
+ threaded {
+ ad_return_template "../lib/message/row-threaded"
+ return
+ }
+ minimal {
+ ad_return_template "../lib/message/row-minimal"
+ return
+ }
+ default {
+ ad_return_template "../lib/message/row"
+ return
+ }
+}