Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.410 -r1.411 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 29 Jun 2010 08:52:12 -0000 1.410 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 30 Jun 2010 12:38:58 -0000 1.411 @@ -2093,17 +2093,29 @@ -mod_user [::xo::get_user_name $creation_user] \ -size [file size [my full_file_name]] - if {[string match image/* $mime_type]} { - set l [Link new -volatile \ - -page [self] -query $query \ - -type image -name $name -lang "" \ - -stripped_name $stripped_name -label $label \ - -parent_id $parent_id -item_id $item_id -package_id $package_id] - set image "
[$l render]
" - } else { - set image "" + if {$mime_type eq "application/octet-stream"} { + # We can fix for viewing the content-type for a view types + if {[string match *tcl $stripped_name]} { + set mime_type text/plain + } } - return "$image[$t asHTML]\n

$description

" + + switch -glob $mime_type { + image/* { + set l [Link new -volatile \ + -page [self] -query $query \ + -type image -name $name -lang "" \ + -stripped_name $stripped_name -label $label \ + -parent_id $parent_id -item_id $item_id -package_id $package_id] + set preview "
[$l render]
" + } + text/plain { + set text [::xowiki::read_file [my full_file_name]] + set preview "
[::xowiki::Includelet html_encode $text]
" + } + default {set preview ""} + } + return "$preview[$t asHTML]\n

$description

" } PodcastItem instproc render_content {} {