Index: openacs-4/packages/forums/lib/message/threads-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/threads-chunk.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/forums/lib/message/threads-chunk.tcl 13 Jan 2005 13:58:15 -0000 1.3 +++ openacs-4/packages/forums/lib/message/threads-chunk.tcl 26 May 2005 12:22:38 -0000 1.4 @@ -1,17 +1,20 @@ ad_page_contract { - one forum view @author Ben Adida (ben@openforce.net) @creation-date 2002-05-24 @cvs-id $Id$ - } # Get forum data + forum::get -forum_id $forum_id -array forum -if { $moderate_p } { +if {![info exists base_url]} { + set base_url "" +} + +if {$moderate_p} { set replies reply_count } else { set replies approved_reply_count @@ -21,35 +24,38 @@ # new postings are allowed if -# 1. Users can create new threads AND the posting policy is open or moderated -# 2. User is a moderator or adminsitrator +# 1. Users can create new threads AND the posting policy is open or +# moderated 2. User is a moderator or adminsitrator -if {([forum::new_questions_allowed_p -forum_id $forum_id] && ($forum(posting_policy) == "open" || $forum(posting_policy) == "moderated")) || [template::util::is_true $permissions(admin_p)] || [template::util::is_true $permissions(moderate_p)] } { - lappend actions [_ forums.Post_a_New_Message] [export_vars -base "message-post" { forum_id }] {} +if {([forum::new_questions_allowed_p \ + -forum_id $forum_id] + && ($forum(posting_policy) == "open" || $forum(posting_policy) == "moderated")) || [template::util::is_true $admin_p] || [template::util::is_true $moderate_p]} { + lappend actions [_ forums.Post_a_New_Message] [export_vars \ + -base "${base_url}message-post" {forum_id}] {} } -if { [template::util::is_true $permissions(admin_p)] } { - lappend actions [_ forums.Administer] [export_vars -base "admin/forum-edit" { forum_id {return_url [ad_return_url]}}] {} +if {[template::util::is_true $admin_p]} { + lappend actions [_ forums.Administer] [export_vars \ + -base "${base_url}admin/forum-edit" {forum_id {return_url [ad_return_url]}}] {} } -if { [template::util::is_true $permissions(moderate_p)] } { - lappend actions [_ forums.ManageModerate] [export_vars -base "moderate/forum" { forum_id }] {} +if {[template::util::is_true $moderate_p]} { + lappend actions [_ forums.ManageModerate] [export_vars \ + -base "${base_url}moderate/forum" {forum_id}] {} } template::list::create \ -name messages \ -multirow messages \ -page_size 30 \ -page_query_name messages_select_paginate \ - -pass_properties { moderate_p } \ + -pass_properties {moderate_p} \ -actions $actions \ -elements { subject { label "#forums.Subject#" link_url_col message_url - display_template { - @messages.subject@ - @messages.subject@ + display_template {@messages.subject@ @messages.subject@ } } state_pretty { @@ -63,7 +69,7 @@ n_messages { label "#forums.Replies#" display_col n_messages_pretty - html { align right } + html {align right} } posting_date { label "#forums.First_Post#" @@ -102,37 +108,38 @@ forum_id {} } -db_multirow -extend { +db_multirow -extend { last_child_post_pretty posting_date_pretty message_url user_url n_messages_pretty - state_pretty -} messages messages_select {} { - set last_child_post_ansi [lc_time_system_to_conn $last_child_post_ansi] - set last_child_post_pretty [lc_time_fmt $last_child_post_ansi "%x %X"] + state_pretty} messages messages_select {} { + set last_child_post_ansi [lc_time_system_to_conn $last_child_post_ansi] + set last_child_post_pretty [lc_time_fmt $last_child_post_ansi "%x %X"] - set posting_date_ansi [lc_time_system_to_conn $posting_date_ansi] - set posting_date_pretty [lc_time_fmt $posting_date_ansi "%x %X"] + set posting_date_ansi [lc_time_system_to_conn $posting_date_ansi] + set posting_date_pretty [lc_time_fmt $posting_date_ansi "%x %X"] - set message_url [export_vars -base "message-view" { message_id }] - set user_url [export_vars -base "user-history" { user_id }] - set n_messages_pretty [lc_numeric $n_messages] + set message_url [export_vars \ + -base "${base_url}message-view" {message_id}] + set user_url [export_vars \ + -base "${base_url}user-history" {user_id}] + set n_messages_pretty [lc_numeric $n_messages] - switch $state { - pending { - set state_pretty [_ forums.Pending] - } - rejected { - set state_pretty [_ forums.Rejected] - } - default { - set state_pretty {} - } + switch $state { + pending { + set state_pretty [_ forums.Pending] + } + rejected { + set state_pretty [_ forums.Rejected] + } + default { + set state_pretty {} + } + } } -} if {[exists_and_not_null alt_template]} { - ad_return_template $alt_template + ad_return_template $alt_template } Index: openacs-4/packages/forums/www/forum-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.adp,v diff -u -r1.29 -r1.30 --- openacs-4/packages/forums/www/forum-view.adp 29 Mar 2005 15:32:13 -0000 1.29 +++ openacs-4/packages/forums/www/forum-view.adp 26 May 2005 12:22:38 -0000 1.30 @@ -13,7 +13,7 @@ - + @notification_chunk;noquote@
@notification_chunk;noquote@