Index: openacs-4/packages/edit-this-page/tcl/etp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs.tcl,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 12 Jan 2004 13:37:08 -0000 1.17 +++ openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 13 Jan 2005 13:58:04 -0000 1.18 @@ -221,13 +221,15 @@ } -ad_proc -public get_page_attributes { } { +ad_proc -public get_page_attributes { + {-package_id} +} { @author Luke Pond @creation-date 2001-05-31 @param Optionally may specify an object type containing - extended page attributes to be returned. + extended page attributes to be returned. @return Creates the pa variable in the caller's context. - + Creates an array variable called pa in the caller's stack frame, containing all attributes necessary to render the current page. These attributes include the standard elements from the cr_revisions @@ -260,16 +262,20 @@ # running out of memory set max_age [ad_parameter cache_max_age edit-this-page] - + +if {![exists_and_not_null package_id]} { + set package_id [ad_conn package_id] +} set name [etp::get_name] + set content_type [etp::get_content_type $name] upvar pa pa if { [catch { if {[empty_string_p [ad_conn -get revision_id]]} { # asking for the live published revision - set code "etp::get_pa [ad_conn package_id] $name $content_type" + set code "etp::get_pa $package_id $name $content_type" array set pa [util_memoize $code $max_age] } else { # an admin is browsing other revisions - do not use caching. @@ -291,6 +297,7 @@ # further processing on this page ad_script_abort } + } @@ -321,8 +328,10 @@ if {[empty_string_p $pa(mime_type)]} { set pa(mime_type) "text/html" } - set pa(content) [template::util::richtext get_property html_value [list $pa(content) $pa(mime_type)]] + if {![string equal "text/html" $pa(mime_type)]} { + set pa(content) [template::util::richtext get_property html_value [list $pa(content) $pa(mime_type)]] + } # add in the context bar if { $name == "index" } { set cb [ad_context_bar] @@ -601,7 +610,9 @@ and currently is never cached. } { - set package_id [ad_conn package_id] + if ![exists_and_not_null package_id] { + set package_id [ad_conn package_id] + } set content_type [etp::get_content_type] set result_name "content_items"