Index: openacs-4/contrib/packages/cop-base/lib/cop-foot-orig.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/lib/cop-foot-orig.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/cop-base/lib/cop-foot-orig.adp 29 Apr 2004 15:56:05 -0000 1.1 @@ -0,0 +1,78 @@ +
Index: openacs-4/contrib/packages/cop-base/lib/cop-foot-orig.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/lib/cop-foot-orig.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/cop-base/lib/cop-foot-orig.tcl 29 Apr 2004 15:56:05 -0000 1.1 @@ -0,0 +1,70 @@ +# generic stuff we need +set url [cop::util::url] +set subsite [ad_conn subsite_id] +set user_id [ad_conn user_id] +set cur_pkg [ad_conn package_id] +set ratingicons [cop::rating::icon_base] + +db_1row obj_title {select o.object_type, pretty_name as tname, pretty_plural as tname_s, title as obj_title, package_id as obj_pkg, acs_object__name(object_id) as acs_name from acs_objects o, acs_object_types t where object_id = :displayed_object_id and t.object_type = o.object_type} +if {[empty_string_p $obj_title]} { + set obj_title EMPTY +} + +if {[empty_string_p $acs_name]} { + set acs_name EMPTY +} + +# get the clipboard info +cop::clipboard::clipboards -create_new -force_default [ad_conn user_id] clipboards +cop::clipboard::clipped $displayed_object_id [ad_conn user_id] clipped + +# record object view and get current count. +db_string record_view "select cop_object_record_view(:displayed_object_id, :user_id)" -default 0 +if {![db_0or1row views "select views, unique_views from cop_object_view_agg where object_id = :displayed_object_id"]} { + set views missing + set unique_views missing +} + + +# Stuff for ratings. +set rate_form [cop::rating::widget -object_one $displayed_object_id] +set current_rating [cop::rating::get -object_one $displayed_object_id -user_id $user_id] +array set ratings [cop::rating::aggregate::get -object_one $displayed_object_id] +if {[info exists ratings(ratings)]} { + set ratings(stars) [format %.1f [expr round($ratings(rating_sum)*2.0/$ratings(ratings))/2.0]] +} else { + set ratings(ratings) 0 +} +if {![empty_string_p $current_rating]} { + set stars [format %.1f $current_rating ] +} + + +# stuff for comments +# todo: suppress for things that should not be commentable. +set comment_link {} +append comment_link [general_comments_get_comments -print_content_p 1 $displayed_object_id [ad_return_url]] +append comment_link [general_comments_create_link -object_name "Name for $displayed_object_id" -link_attributes {class="button"} $displayed_object_id [ad_return_url] ] + + +# Stuff for related items +cop::relation::get_related -object_id $displayed_object_id -datasource related + + +# Category mapping stuff +# add category form +ad_form -action $url/categories/map -method GET -name catass -form { + {object_id:integer(hidden) + {value $displayed_object_id} + } + {container_id:integer(hidden) + {value {[ad_conn subsite_id]}} + } +} +category::ad_form::add_widgets -container_object_id [ad_conn subsite_id] -form_name catass + +# mapped categories: +set catass_list [category::list::get_pretty_list [category::get_mapped_categories $displayed_object_id]] + +# dummy for debug +set foo {} Index: openacs-4/contrib/packages/cop-base/lib/cop-footer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/lib/cop-footer.adp,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/cop-base/lib/cop-footer.adp 2 Apr 2004 01:50:49 -0000 1.3 +++ openacs-4/contrib/packages/cop-base/lib/cop-footer.adp 29 Apr 2004 15:56:05 -0000 1.4 @@ -1,81 +1,22 @@ -