Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -r1.185 -r1.186 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 4 Mar 2008 20:49:50 -0000 1.185 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 11 Mar 2008 19:31:30 -0000 1.186 @@ -2465,3 +2465,23 @@ } } + +ad_proc portal::portlet_visible_p { + -portal_id + -portlet_name +} { + Check if a portlet is on a portal + + @param portal_id ID of portal to check + @param portlet_name Name of the portlet to look for + + @return 0 if portlet does not exist, 1 if it exists + +} { + set ds_id [get_datasource_id $portlet_name] + if {[db_string portlet_visible "" -default 0]} { + return 1 + } else { + return 0 + } +} Index: openacs-4/packages/new-portal/tcl/portal-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.xql,v diff -u -r1.48 -r1.49 --- openacs-4/packages/new-portal/tcl/portal-procs.xql 20 Dec 2007 13:49:54 -0000 1.48 +++ openacs-4/packages/new-portal/tcl/portal-procs.xql 11 Mar 2008 19:31:30 -0000 1.49 @@ -808,4 +808,18 @@ + + + select 1 + from portal_element_map, + portal_pages + where portal_pages.portal_id = :portal_id + and portal_element_map.datasource_id = :ds_id + and portal_element_map.page_id = portal_pages.page_id + and portal_element_map.state <> 'hidden' + order by portal_element_map.pretty_name + + + +