Index: openacs-4/packages/categories/lib/contributions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/lib/contributions.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/categories/lib/contributions.tcl 7 Aug 2017 23:48:05 -0000 1.5 +++ openacs-4/packages/categories/lib/contributions.tcl 3 Sep 2024 15:37:36 -0000 1.6 @@ -1,38 +1,28 @@ -# Display the site contributions -# If user_id set it will be limited by that user otherwise all users. -# if limit set then only limit items will be displayed. -# if root_node_id exists then only return things under root node. +ad_include_contract { + Display the site contributions + If user_id set it will be limited by that user otherwise all users. + If limit set then only limit items will be displayed. + If root_node_id exists then only return things under root node. +} { + {user_id:integer ""} + {category:integer ""} + {suppress:multiple ""} + {limit:naturalnum ""} + {format:token table} +} + set root_node_id [ad_conn node_id] -if {![info exists user_id]} { - set user_id {} +foreach key $suppress { + set hide($key) 1 } -if {![info exists category]} { - set category {} -} -if {[info exists suppress]} { - foreach key $suppress { - set hide($key) 1 - } -} -if {[info exists limit] - && [regexp {^[0-9]+$} $limit]} { +if {$limit ne ""} { set limit " limit $limit" -} else { - set limit {} } -if {![info exists format]} { - set format table -} +set packages [subsite::util::packages -node_id $root_node_id] -if {[info exists root_node_id]} { - set packages [subsite::util::packages -node_id $root_node_id] -} else { - set packages {} -} - lappend elements object_title { label {Title} display_template {@content.title@} @@ -104,7 +94,7 @@ } } -set now [clock_to_ansi [clock seconds]] +set now [lc_clock_to_ansi [clock seconds]] set restrict {} @@ -117,7 +107,7 @@ } if {$packages ne ""} { - append restrict "\nand o.package_id in ([join $packages ,])" + append restrict "\nand o.package_id in ([ns_dbquotelist $packages])" } # JCDXXX: TODO: need to get the dimension to display, need to find the right CoP, permissions