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.2.2 -r1.5.2.3 --- openacs-4/packages/categories/lib/contributions.tcl 3 May 2020 17:39:48 -0000 1.5.2.2 +++ openacs-4/packages/categories/lib/contributions.tcl 14 Jul 2022 15:08:12 -0000 1.5.2.3 @@ -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@}