Index: openacs-4/packages/attachments/tcl/attachments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/attachments-procs.tcl,v diff -u -N -r1.9 -r1.9.2.1 --- openacs-4/packages/attachments/tcl/attachments-procs.tcl 10 Sep 2002 22:22:21 -0000 1.9 +++ openacs-4/packages/attachments/tcl/attachments-procs.tcl 27 May 2003 17:53:06 -0000 1.9.2.1 @@ -144,9 +144,14 @@ set lst [db_list_of_lists select_attachments {}] set lst_with_urls [list] - foreach el $lst { - set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id [lindex $el 0] -base_url $base_url]] - lappend lst_with_urls [concat $el $append_lst] + foreach item_id $lst { + if { [content_extlink::extlink_p -item_id $item_id] } { + set label [content_extlink::extlink_name -item_id $item_id] + } else { + set label [fs::get_object_name -object_id $item_id] + } + set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id $item_id -base_url $base_url]] + lappend lst_with_urls [concat [list $item_id $label] $append_lst] } return $lst_with_urls @@ -161,9 +166,14 @@ set lst [db_list_of_lists select_attachments {}] set lst_with_urls [list] - foreach el $lst { - set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id [lindex $el 0] -base_url $base_url]] - lappend lst_with_urls [concat $el $append_lst] + foreach item_id $lst { + if { [content_extlink::extlink_p -item_id $item_id] } { + set label [content_extlink::extlink_name -item_id $item_id] + } else { + set label [fs::get_object_name -object_id $item_id] + } + set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id $item_id -base_url $base_url]] + lappend lst_with_urls [concat [list $item_id $label] $append_lst] } return $lst_with_urls