Index: openacs-4/contrib/packages/cop-ui/lib/contributions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/lib/contributions.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/cop-ui/lib/contributions.tcl 7 May 2004 17:25:39 -0000 1.3 +++ openacs-4/contrib/packages/cop-ui/lib/contributions.tcl 14 May 2004 11:30:15 -0000 1.4 @@ -3,43 +3,68 @@ # 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. +set root_node_id [ad_conn node_id] if {![info exists user_id]} { set user_id {} } if {![info exists category]} { set category {} } +if {[info exists supress]} { + foreach key $supress { + set hide($key) 1 + } +} +if {[info exists limit] + && [regexp {^[0-9]+$} $limit]} { + set limit " limit $limit" +} else { + set limit {} +} + +if {![info exists format]} { + set format table +} + if {[info exists root_node_id]} { set packages [cop::util::packages -node_id $root_node_id] } else { set packages {} } +if {![info exists hide(stars)]} { + lappend elements stars { + label "Rating" + display_template "@content.stars;noquote@" + } +} -lappend elements rating_img { - label "Rating" - display_template "@content.rating_img;noquote@" +if {![info exists hide(ratings)]} { + lappend elements ratings { + label \# + display_template "@content.ratings;noquote@" + html {align right} + } } -lappend elements ratings { - label \# - display_template "@content.ratings;noquote@" - html {align right} -} -lappend elements views { - label "Views" - html {align right} +if {![info exists hide(views)]} { + lappend elements views { + label "Views" + html {align right} + } } lappend elements object_title { label {Title} display_template {@content.title@} } -lappend elements object_type { - label {Type} +if {![info exists hide(object_type)]} { + lappend elements object_type { + label {Type} + } } lappend elements last_modified { @@ -48,6 +73,12 @@ html {align right} } +lappend elements new { + label {New} + display_template "@content.new;noquote@" + html {align right} +} + if {[empty_string_p $user_id]} { lappend elements name { label {Created by} @@ -60,11 +91,26 @@ -multirow content \ -key object_id \ -elements $elements \ + -selected_format $format \ -filters { user_id {} } \ + -formats { + table { + label Table + layout table + } + list { + label List + layout list + template { +