Index: openacs-4/packages/layout-managed-subsite/catalog/layout-managed-subsite.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/catalog/layout-managed-subsite.en_US.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/catalog/layout-managed-subsite.en_US.ISO-8859-1.xml 26 Nov 2008 11:10:22 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/catalog/layout-managed-subsite.en_US.ISO-8859-1.xml 30 Nov 2008 13:15:02 -0000 1.2 @@ -25,6 +25,8 @@ These applications and includelets are mounted under the current subsite: Plain Return to Add Applications + Service + The following services support includelets which can be added to this subsite: Singleton State Supported Includelets Index: openacs-4/packages/layout-managed-subsite/lib/add-applications.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/add-applications.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/lib/add-applications.adp 26 Nov 2008 11:10:22 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/lib/add-applications.adp 30 Nov 2008 13:15:02 -0000 1.2 @@ -1,3 +1,5 @@ +

#layout-managed-subsite.services#

+

#layout-managed-subsite.mounted_applications#

#layout-managed-subsite.available_applications#

Index: openacs-4/packages/layout-managed-subsite/lib/add-applications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/add-applications.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/lib/add-applications.tcl 26 Nov 2008 11:10:22 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/lib/add-applications.tcl 30 Nov 2008 13:15:02 -0000 1.2 @@ -10,22 +10,57 @@ } -set package_id [ad_conn package_id] +set subsite_id [ad_conn subsite_id] +set subsite_url [ad_conn subsite_url] +set subsite_node_id [ad_conn subsite_node_id] + if { ![info exists pageset_id] } { - set pageset_id [layout::pageset::get_master_template_id -package_id $package_id] + set pageset_id [layout::pageset::get_master_template_id -package_id $subsite_id] } if { ![info exists return_url] } { -} set return_url [ad_conn url]?[ad_conn query] +} +db_multirow -extend {manage_url package_url includelets} services get_services {} { + set manage_url [export_vars -base [ad_conn package_url]admin/layouts/manage-includelets \ + { pageset_id {package_url $subsite_url} {package_id $subsite_id} + package_key {admin_url $return_url} }] + set includelets {} + foreach includelet [db_list_of_lists get_service_includelets {}] { + if { [lindex $includelet 1] == 1 } { + lappend includelets [lindex $includelet 0] + } else { + lappend includelets "[lindex $includelet 0]([lindex $includelet 1])" + } + } + set includelets [join $includelets ", "] +} -set package_id_list [concat [site_node::get_children \ - -node_id [ad_conn subsite_node_id] \ - -package_type apm_application \ - -element package_id] \ - [ad_conn subsite_id]] +template::list::create \ + -name services \ + -multirow services \ + -key package_key \ + -elements { + package_key { + label {[_ layout-managed-subsite.Service]} + } + includelets { + label {[_ layout-managed-subsite.Active_Includelets]} + } + manage { + label {[_ layout-managed-subsite.Action]} + link_url_col manage_url + link_html { title #layout-managed-subsite.Manage_Includelets# class button } + display_template { [_ layout-managed-subsite.Manage_Includelets] } + } + } +set package_id_list [site_node::get_children \ + -node_id [ad_conn subsite_node_id] \ + -package_type apm_application \ + -element package_id] + set package_key_list [site_node::get_children \ -node_id [ad_conn subsite_node_id] \ -package_type apm_application \ Index: openacs-4/packages/layout-managed-subsite/lib/add-applications.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/add-applications.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/lib/add-applications.xql 26 Nov 2008 11:10:23 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/lib/add-applications.xql 30 Nov 2008 13:15:02 -0000 1.2 @@ -2,12 +2,39 @@ + + + select apt.package_key + from apm_package_types apt + where exists (select 1 + from layout_includelets li + where apt.package_key = li.application) + and apt.package_type = 'apm_service' + order by apt.package_key + + + + + + select li.title, count(*) + from layout_includelets li, layout_elements le + where le.package_id = :subsite_id + and le.includelet_name = li.name + and li.application = :package_key + group by li.title + order by li.title + + + select distinct ap.package_key , ap.package_id - from layout_includelets li, apm_packages ap - where ap.package_id in ([join $package_id_list ,]) + from layout_includelets li, apm_packages ap, site_nodes s, apm_package_types apt + where s.parent_id = :subsite_node_id + and s.object_id = ap.package_id and apm_package__is_child(li.application, ap.package_key) + and apt.package_key = ap.package_key + and apt.package_type = 'apm_application' @@ -27,10 +54,15 @@ select apt.package_key from apm_package_types apt where exists (select 1 - from layout_includelets li - where apt.package_key = li.application) - and not apt.package_key in ('[join $package_key_list "','"]') + from layout_includelets li, site_nodes s + where apm_package__is_child(li.application, apt.package_key)) + and not exists (select 1 + from site_nodes s, apm_packages ap + where s.parent_id = :subsite_node_id + and s.object_id = ap.package_id + and ap.package_key = apt.package_key) and apt.package_type = 'apm_application' + order by apt.package_key Index: openacs-4/packages/layout-managed-subsite/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/tcl/apm-callback-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/layout-managed-subsite/tcl/apm-callback-procs.tcl 28 Nov 2008 19:23:01 -0000 1.2 +++ openacs-4/packages/layout-managed-subsite/tcl/apm-callback-procs.tcl 30 Nov 2008 13:15:03 -0000 1.3 @@ -42,8 +42,8 @@ -name "Layout Managed Subsite Tabbed" \ -template /packages/layout-managed-subsite/lib/tabbed-master \ -css "{/resources/openacs-default-theme/styles/default-master.css all} - {/resources/openacs-default-theme/styles/forms.css all} - {/resources/openacs-default-theme/styles/lists.css all}" \ + {/resources/acs-templating/forms.css all} + {/resources/acs-templating/lists.css all}" \ -form_template /packages/acs-templating/resources/forms/standard \ -list_template /packages/acs-templating/resources/lists/table \ -list_filter_template /packages/acs-templating/resources/lists/filters