Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 11 Dec 2002 14:12:33 -0000 1.15 +++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 29 May 2003 18:05:59 -0000 1.16 @@ -31,28 +31,34 @@ set package_id [dotlrn_community::get_community_id] } -if {![exists_and_not_null template_portal_id]} { - set template_portal_id [dotlrn_community::get_portal_id] -} +# DRB: when previewing from the portals package no community is defined, we don't +# want to portlet to bomb in this case. -if {[exists_and_not_null return_url]} { - set referer $return_url -} +if { ![string equal $package_id ""] } { -if {![exists_and_not_null referer]} { - set referer [ad_conn url] -} + if {![exists_and_not_null template_portal_id]} { + set template_portal_id [dotlrn_community::get_portal_id] + } -set element_pretty_name [parameter::get_from_package_key -localize -package_key static-portlet -parameter static_admin_portlet_element_pretty_name] + if {[exists_and_not_null return_url]} { + set referer $return_url + } -db_multirow content select_content { - select content_id, - pretty_name - from static_portal_content - where package_id = :package_id -} { - set pretty_name [lang::util::localize $pretty_name] -} + if {![exists_and_not_null referer]} { + set referer [ad_conn url] + } + set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"] + set element_pretty_plural [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"] -set applet_url "[dotlrn_applet::get_url]/[static_portlet::my_package_key]" + ns_log notice "package_id = $package_id" + db_multirow content select_content { + select content_id, + pretty_name + from static_portal_content + where package_id = :package_id + } + + set applet_url "[dotlrn_applet::get_url]/[static_portlet::my_package_key]" + +}