Index: openacs-4/packages/lorsm/templates/lorsm-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-default.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lorsm/templates/lorsm-default.tcl 24 Feb 2005 13:33:21 -0000 1.4 +++ openacs-4/packages/lorsm/templates/lorsm-default.tcl 21 Apr 2005 16:03:53 -0000 1.5 @@ -8,7 +8,7 @@ # It's a file. cr_write_content -revision_id $content(revision_id) ad_script_abort - } elseif { [string equal "text/css" $content(mime_type)]} { + } elseif { [string equal "text/css" $content(mime_type)] || [string equal "text/xml" $content(mime_type) ]} { # we treat CSS files as if they would be binaries and deliver # them straight to the browser (maybe we should do the same # thing for XML files (?) @@ -19,17 +19,22 @@ # Ordinary text/* mime type. template::util::array_to_vars content - - set text [cr_write_content -string -revision_id $revision_id] - - if { ![string equal "text/html" $content(mime_type)] && ![string equal "text/xml" $content(mime_type)] } { - set text [ad_html_text_convert -from $mime_type -to text/html $text] + + if { ![string equal "text/html" $content(mime_type)] || ![string equal "text/xml" $content(mime_type)]} { + set text [ad_html_text_convert -from $mime_type -to text/html $text] } } set imsitem_id [lorsm::get_ims_item_id] +set html_document_p 0 +if { [string eq $content(mime_type) "text/html"] && [regexp -nocase {} $text match] } { + set html_document_p 1 + # parent window + regsub -all -nocase {target=[^ |^>]+} $text {target="_parent"} text +} + # We set all this blank variables in the case that the ims_item does # not have a resource id