Index: openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml 9 Oct 2003 13:43:15 -0000 1.15
+++ openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml 10 Oct 2003 17:09:43 -0000 1.16
@@ -24,6 +24,7 @@
disabled
Edit
edit
+ Edit again
Edit forum
Edit Message:
Email
@@ -84,6 +85,7 @@
parent ID
Pending
Pending Threads
+ Post
Post a Message
Post a New Message
Post a Reply
@@ -94,6 +96,7 @@
Posting history for
Posting Policy
Presentation
+ Preview
Re:
reject
Rejected
Index: openacs-4/packages/forums/www/message-post-confirm.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post-confirm.adp,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/forums/www/message-post-confirm.adp 28 Aug 2003 09:41:54 -0000 1.10
+++ openacs-4/packages/forums/www/message-post-confirm.adp 10 Oct 2003 17:09:44 -0000 1.11
@@ -37,7 +37,8 @@
-
+
+
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.25 -r1.26
--- openacs-4/packages/forums/www/message-post.tcl 9 Oct 2003 11:20:58 -0000 1.25
+++ openacs-4/packages/forums/www/message-post.tcl 10 Oct 2003 17:09:44 -0000 1.26
@@ -18,13 +18,23 @@
}
}
+if { ![empty_string_p [ns_queryget formbutton:post]] } {
+ set action post
+} elseif { ![empty_string_p [ns_queryget formbutton:preview]] } {
+ set action preview
+} elseif { ![empty_string_p [ns_queryget formbutton:edit]] } {
+ set action edit
+} else {
+ set action ""
+}
+
set user_id [ad_conn user_id]
# get the colors from the params
set table_border_color [parameter::get -parameter table_border_color]
set table_bgcolor [parameter::get -parameter table_bgcolor]
-form create message
+form create message -edit_buttons [list [list [_ forums.Post] post] [list [_ forums.Preview] preview]]
element create message message_id \
-label [_ forums.Message_ID] \
@@ -114,7 +124,7 @@
set anonymous_p 0
}
- if {!$confirm_p} {
+ if { [string equal $action "preview"] } {
forum::get -forum_id $forum_id -array forum
set confirm_p 1
@@ -154,76 +164,80 @@
return
}
- if { [empty_string_p $anonymous_p] } {
- set anonymous_p 0
- }
- if { $anonymous_p } {
- set post_as_user_id 0
- } else {
- set post_as_user_id $user_id
- }
-
- forum::message::new \
- -forum_id $forum_id \
- -message_id $message_id \
- -parent_id $parent_id \
- -subject $subject \
- -content $content \
- -html_p $html_p \
- -user_id $post_as_user_id
+ if { [string equal $action "post"] } {
+ if { [empty_string_p $anonymous_p] } {
+ set anonymous_p 0
+ }
+ if { $anonymous_p } {
+ set post_as_user_id 0
+ } else {
+ set post_as_user_id $user_id
+ }
+
+ forum::message::new \
+ -forum_id $forum_id \
+ -message_id $message_id \
+ -parent_id $parent_id \
+ -subject $subject \
+ -content $content \
+ -html_p $html_p \
+ -user_id $post_as_user_id
- if {[empty_string_p $parent_id]} {
- set redirect_url "[ad_conn package_url]message-view?message_id=$message_id"
- } else {
- set redirect_url "[ad_conn package_url]message-view?message_id=$parent_id"
- }
+ if {[empty_string_p $parent_id]} {
+ set redirect_url "[ad_conn package_url]message-view?message_id=$message_id"
+ } else {
+ set redirect_url "[ad_conn package_url]message-view?message_id=$parent_id"
+ }
- # Wrap the notifications URL
- if {![empty_string_p $subscribe_p] && $subscribe_p && [empty_string_p $parent_id]} {
- set notification_url [notification::display::subscribe_url \
- -type forums_message_notif \
- -object_id $message_id \
- -url $redirect_url \
- -user_id [ad_conn user_id] \
- ]
+ # Wrap the notifications URL
+ if {![empty_string_p $subscribe_p] && $subscribe_p && [empty_string_p $parent_id]} {
+ set notification_url [notification::display::subscribe_url \
+ -type forums_message_notif \
+ -object_id $message_id \
+ -url $redirect_url \
+ -user_id [ad_conn user_id] \
+ ]
- # redirect to notification stuff
- set redirect_url $notification_url
- }
+ # redirect to notification stuff
+ set redirect_url $notification_url
+ }
- # Wrap the attachments URL
- if {$attachments_enabled_p} {
- form get_values message attach_p
+ # Wrap the attachments URL
+ if {$attachments_enabled_p} {
+ form get_values message attach_p
- if {$attach_p} {
- set redirect_url [attachments::add_attachment_url -object_id $message_id -return_url $redirect_url -pretty_name "[_ forums.Forum_Posting] \"$subject\""]
- }
- }
-
- # Do the redirection
- ad_returnredirect $redirect_url
+ if {$attach_p} {
+ set redirect_url [attachments::add_attachment_url -object_id $message_id -return_url $redirect_url -pretty_name "[_ forums.Forum_Posting] \"$subject\""]
+ }
+ }
+
+ # Do the redirection
+ ad_returnredirect $redirect_url
- ad_script_abort
+ ad_script_abort
+ }
}
set message_id [db_nextval acs_object_id_seq]
#set subject ""
-if {![empty_string_p $parent_id]} {
+if { ![empty_string_p $parent_id] } {
# get the parent message information
forum::message::get -message_id $parent_id -array parent_message
set forum_id $parent_message(forum_id)
- set subject "[_ forums.Re] $parent_message(subject)"
-
- # trim multiple leading Re:
- regsub {^(\s*Re:\s*)*} $subject {Re: } subject
-
+ if { [form is_request message] } {
+ set subject "[_ forums.Re] $parent_message(subject)"
+
+ # trim multiple leading Re:
+ regsub {^(\s*Re:\s*)*} $subject {Re: } subject
+ }
+
# see if they're allowed to add to this thread
forum::security::require_post_message -message_id $parent_id
} else {
# no parent_id, therefore new thread
# require thread creation privs
- forum::security::require_post_forum -forum_id $forum_id
+ forum::security::require_post_forum -forum_id $forum_id
}
forum::get -forum_id $forum_id -array forum
@@ -247,11 +261,3 @@
lappend context [_ forums.Post_a_Message]
}
-ad_return_template
-
-
-
-
-
-
-