+
+Convert these from the top down ("/", then the subsites mounted under "/", etc)
+
+You MUST convert the parent subsite ("/", most likely) before mounting your mgh subsite
+underneath.
+
You'll have to restart your server after you've finished converting your acs-subsites to mgh-subsites
+Existing subsites
+
Index: openacs-4/packages/layout-managed-subsite/subsites.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/Attic/subsites.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/subsites.tcl 26 Nov 2008 11:10:22 -0000 1.1
@@ -0,0 +1,36 @@
+ad_page_contract {
+
+ List acs-subsites and offer to convert them to mgh-subsites.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: subsites.tcl,v 1.1 2008/11/26 11:10:22 donb Exp $
+
+}
+
+db_multirow -extend {convert_url subsite_url} acs_subsites q {
+ select package_id as subsite_id
+ from apm_packages
+ where package_key = 'acs-subsite'
+ order by subsite_id
+} {
+ set convert_url [export_vars -base convert-subsites {subsite_id}]
+ set subsite_url [site_node::get_url_from_object_id -object_id $subsite_id]
+}
+
+template::list::create \
+ -name acs_subsites \
+ -multirow acs_subsites \
+ -key subsite_id \
+ -elements {
+ subsite_url {
+ label {Subsite URL}
+ }
+ convert {
+ label {Convert to a layout managed subsite}
+ link_url_col convert_url
+ link_html { title Convert class button }
+ display_template {Convert}
+ }
+ }
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 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
@@ -0,0 +1,43 @@
+
+
+
+ Action
+ Active Includelets
+ Add
+ Add checked applications
+ Add checked includelets
+ Add single application
+ Application
+ These applications support includelets and can be mounted under the current subsite:
+ Copy
+ Run the configuration wizard
+ The following parameters offer the administrator some control over the degree to which a user can configure their own personal page sets.
+ Delete
+ Delete checked elements
+ Description
+ Edit the layout manager master layout
+ Edit user layouts
+ Layout elements bound to "%package_key%" mounted at "%package_url%""
+ Includelet
+ Manage
+ Manage applications and Includelets
+ Manage Includelets
+ These applications and includelets are mounted under the current subsite:
+ Plain
+ Return to Add Applications
+ Singleton
+ State
+ Supported Includelets
+ Tabbed
+ Title
+ URL
+ Install the applications and includelet packages that you want to make available. The wizard will mount the applications you choose and make their includelets available.
+ This wizard will take you through the steps necessary to configure the current subsite to use the layout manager. Before configuring you should:
+ Decide the navigation style you wish this includelet and subsite to use.
+ Decide whether or not you want the parent subsite to display a layout manager page rather than its standard index page.
+ Decide whether or not individual users should have their own private pageset. pages, or whether you want to configure one pageset configuration to be shared by all visitors. Creating individual private pagesets is more flexible but also consumes more system resources.
+ Check "no" if you want users to share a single page set configuration. This is more efficient of system resources but only administrators will be able to reconfigure the layout.
+ Check "Yes" if you'd like the layout manager package to create each user their own custom page set configuration. This will allow users to to move includelets from column to column or page to page, to hide includelets, etc.
+ You can create new layout elements from the following includelets. Those marked as a "singleton" can only be created once, though you can make identical copies to display on multiple pages if you like:
+
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/add-applications.adp 26 Nov 2008 11:10:22 -0000 1.1
@@ -0,0 +1,7 @@
+#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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/add-applications.tcl 26 Nov 2008 11:10:22 -0000 1.1
@@ -0,0 +1,117 @@
+ad_page_contract {
+
+ Generate a list of applications that have supporting portlets.
+
+ The user's returned to the current page after installing the select application(s).
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: add-applications.tcl,v 1.1 2008/11/26 11:10:22 donb Exp $
+
+}
+
+set package_id [ad_conn package_id]
+if { ![info exists pageset_id] } {
+ set pageset_id [layout::pageset::get_master_template_id -package_id $package_id]
+}
+
+if { ![info exists return_url] } {
+}
+ set return_url [ad_conn url]?[ad_conn query]
+
+
+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]]
+
+set package_key_list [site_node::get_children \
+ -node_id [ad_conn subsite_node_id] \
+ -package_type apm_application \
+ -element package_key]
+
+db_multirow -extend {manage_url package_url includelets} mounted_applications get_mounted_applications {} {
+ set package_url [site_node::get_url_from_object_id -object_id $package_id]
+ set manage_url [export_vars -base [ad_conn package_url]admin/layouts/manage-includelets \
+ { pageset_id package_id package_url package_key {admin_url $return_url} }]
+ set includelets {}
+ foreach includelet [db_list_of_lists get_mounted_includelets {}] {
+ if { [lindex $includelet 1] == 1 } {
+ lappend includelets [lindex $includelet 0]
+ } else {
+ lappend includelets "[lindex $includelet 0]([lindex $includelet 1])"
+ }
+ }
+ set includelets [join $includelets ", "]
+}
+
+template::list::create \
+ -name mounted_applications \
+ -multirow mounted_applications \
+ -key package_key \
+ -elements {
+ package_key {
+ label {[_ layout-managed-subsite.Application]}
+ }
+ package_url {
+ label {[_ layout-managed-subsite.URL]}
+ }
+ 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] }
+ }
+ }
+
+db_multirow -extend {add_url includelets} available_applications get_available_applications {} {
+ set add_url [export_vars -base [ad_conn package_url]admin/layouts/add-applications-2 \
+ { pageset_id package_key return_url }]
+ set includelets [join [db_list get_available_includelets {}] ", "]
+}
+
+template::list::create \
+ -name available_applications \
+ -multirow available_applications \
+ -key package_key \
+ -bulk_actions "
+ {[_ layout-managed-subsite.Add_checked_applications]}
+ [ad_conn package_url]admin/layouts/add-applications-2
+ {[_ layout-managed-subsite.Add_checked_applications]}
+ " \
+ -bulk_action_export_vars {
+ package_key pageset_id return_url
+ } \
+ -elements {
+ package_key {
+ label {[_ layout-managed-subsite.Application]}
+ }
+ includelets {
+ label {[_ layout-managed-subsite.Supported_Includelets]}
+ }
+ add {
+ label {[_ layout-managed-subsite.Action]}
+ link_url_col add_url
+ link_html { title [_ layout-managed-subsite.Add_single_application] class button }
+ display_template {[_ layout-managed-subsite.Add]}
+ }
+ }
+
+# Now, if we're in the template wizard, generate the wizard form and buttons.
+set wizard_p [template::wizard::exists]
+if { $wizard_p } {
+
+ ad_form -name add-applications -form {
+ foo:text(hidden),optional
+ } -on_submit {
+ template::wizard::forward
+ }
+
+ template::wizard::submit add-applications -buttons {back next}
+}
+
+ad_return_template
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/add-applications.xql 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+ select distinct ap.package_key , ap.package_id
+ from layout_includelets li, apm_packages ap
+ where ap.package_id in ([join $package_id_list ,])
+ and apm_package__is_child(li.application, ap.package_key)
+
+
+
+
+
+ select li.title, count(*)
+ from layout_includelets li, layout_elements le
+ where le.package_id = :package_id
+ and le.includelet_name = li.name
+ group by li.title
+ order by li.title
+
+
+
+
+
+ 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 "','"]')
+ and apt.package_type = 'apm_application'
+
+
+
+
+
+ select title as includelet
+ from layout_includelets
+ where apm_package__is_child(application, :package_key)
+ order by title
+
+
+
+
Index: openacs-4/packages/layout-managed-subsite/lib/configure-configurability.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-configurability.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-configurability.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,2 @@
+#layout-managed-subsitesconfigure_configurability#
+
Index: openacs-4/packages/layout-managed-subsite/lib/configure-configurability.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-configurability.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-configurability.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,39 @@
+ad_page_contract {
+ Let the admin configure whether or not to present shade and hide buttons on includelets.
+} {
+}
+
+if { ![parameter::get -boolean -parameter CreatePrivatePortals] } {
+ rp_form_put wizard_submit_next wizard_submit_next
+ template::wizard::forward
+}
+
+ad_form -name configure-configurability -form {
+ {ShowShadeButton:boolean(radio)
+ {label "Show \"Shade\" button on includelet title bars?"}
+ {options {{Yes 1} {No 0}}}
+ {help_text "\"No\" will supress the display of \"shade\" widgets in includelet title bars"}
+ }
+ {ShowHideButton:boolean(radio)
+ {label "Show \"Hide\" button on includelet title bars?"}
+ {options {{Yes 1} {No 0}}}
+ {help_text "\"No\" will supress the display of \"hide\" widgets in includelet title bars"}
+ }
+ {ThemeChangeable:boolean(radio)
+ {label "Allow users to change the includelet decoration theme?"}
+ {options {{Yes 1} {No 0}}}
+ {help_text "\"Yes\" will allow the user to change the theme used to display their page set"}
+ }
+} -on_request {
+ set ShowShadeButton [parameter::get -boolean -parameter ShowShadeButton]
+ set ShowHideButton [parameter::get -boolean -parameter ShowHideButton]
+ set ThemeChangeable [parameter::get -boolean -parameter ThemeChangeable]
+ ad_set_form_values ShowShadeButton ShowHideButton
+} -on_submit {
+ parameter::set_value -parameter ShowShadeButton -value $ShowShadeButton
+ parameter::set_value -parameter ShowHideButton -value $ShowHideButton
+ parameter::set_value -parameter ThemeChangeable -value $ThemeChangeable
+ template::wizard::forward
+}
+
+template::wizard::submit configure-configurability -buttons {back next}
Index: openacs-4/packages/layout-managed-subsite/lib/configure-finish.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-finish.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-finish.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/packages/layout-managed-subsite/lib/configure-finish.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-finish.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-finish.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,11 @@
+# ad_form doesn't like an empty -form block so we've got to provide a dummy
+# field ...
+
+ad_form -name configure-finish -form {
+ foo:text(hidden),optional
+} -on_submit {
+ ad_returnredirect index
+ ad_script_abort
+}
+
+template::wizard::submit configure-finish -buttons {finish}
Index: openacs-4/packages/layout-managed-subsite/lib/configure-help.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-help.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-help.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,10 @@
+
+#layout-managed-subsite.wizard_intro#
+
+- #layout-managed-subsite.wizard_install_help#
+
- #layout-managed-subsite.wizard_user_pagesets_help#
+
- #layout-managed-subsite.wizard_navigation_help#
+
- #layout-managed-subsite.wizard_redirect_help#
+
+
+
Index: openacs-4/packages/layout-managed-subsite/lib/configure-help.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-help.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-help.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,10 @@
+# ad_form doesn't like an empty -form block so we've got to provide a dummy
+# field ...
+
+ad_form -name configure-help -form {
+ foo:text(hidden),optional
+} -on_submit {
+ template::wizard::forward
+}
+
+template::wizard::submit configure-help -buttons {back next}
Index: openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,4 @@
+#layout-managed-subsite.wizard_user_pageset_yes_help#
+
+#layout-managed-subsite.wizard_user_pageset_no_help#
+
Index: openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,19 @@
+ad_page_contract {
+ Let the admin configure whether or not we should create a pageset for every visitor.
+} {
+}
+
+ad_form -name configure-private-pagesets -form {
+ {CreatePrivatePageSets:boolean(radio)
+ {label "Create a page set for every user?"}
+ {options {{Yes 1} {No 0}}}
+ }
+} -on_request {
+ set CreatePrivatePageSets [parameter::get -boolean -parameter CreatePrivatePageSets]
+ ad_set_form_values CreatePrivatePageSets
+} -on_submit {
+ parameter::set_value -parameter CreatePrivatePageSets -value $CreatePrivatePageSets
+ template::wizard::forward
+}
+
+template::wizard::submit configure-private-pagesets -buttons {back next}
Index: openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,60 @@
+ad_page_contract {
+ Configure the layout manager package's interaction with the subsite package in the 'ole
+ look and feel department.
+} {
+}
+
+ad_form -name configure-subsite-integration -form {
+ {template_style:integer(radio)
+ {options {{"Tabbed navigation" 0}
+ {"Plain navigation (works best if there's only one layout manager page)" 1}
+ {"Use my existing custom master template" 2}}}
+ {values {0}}
+ {label "Choose master template?"}
+ }
+ {pageset_index_page_p:boolean(radio)
+ {options {{Yes 1} {No 0}}}
+ {values {1}}
+ {label "Should the parent subsite serve the layout manager package as its index page?"}
+ }
+ {show_single_button_navbar_p:boolean(radio)
+ {options {{Yes 1} {No 0}}}
+ {values {0}}
+ {label "Should we show the navigation tabs when there's only one of them?"}
+ }
+} -on_submit {
+
+ switch $template_style {
+
+ 0 {parameter::set_value \
+ -parameter DefaultMaster \
+ -package_id [ad_conn subsite_id] \
+ -value /packages/layout-managed-subsite/lib/tabbed-master
+ }
+
+ 1 {parameter::set_value \
+ -parameter DefaultMaster \
+ -package_id [ad_conn subsite_id] \
+ -value /packages/layout-managed-subsite/lib/plain-master
+ }
+
+ 2 {}
+
+ }
+
+ if { $pageset_index_page_p } {
+ parameter::set_value \
+ -parameter IndexInternalRedirectUrl \
+ -package_id [ad_conn subsite_id] \
+ -value /packages/layout-managed-subsite/www/
+ }
+
+ parameter::set_value \
+ -parameter ShowSingleButtonNavbar \
+ -package_id [ad_conn package_id] \
+ -value $show_single_button_navbar_p
+
+ template::wizard::forward
+}
+
+template::wizard::submit configure-subsite-integration -buttons {back next}
Index: openacs-4/packages/layout-managed-subsite/lib/layout-admin-includelet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/layout-admin-includelet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/layout-admin-includelet.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/packages/layout-managed-subsite/lib/layout-admin.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/layout-admin.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/layout-admin.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,8 @@
+
Index: openacs-4/packages/layout-managed-subsite/lib/layout-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/layout-admin.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/layout-admin.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,28 @@
+ad_page_contract {
+
+ Main administration page for the layout manager package. Return to the script which
+ has included us.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: layout-admin.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+}
+
+set package_id [layout::package_id]
+set base_url [site_node::get_url_from_object_id -object_id $package_id]
+set return_url [ad_conn url]?[ad_conn query]
+
+set package_edit_p [expr { ![info exists pageset_id] }]
+if { $package_edit_p } {
+ set pageset_id [layout::pageset::get_master_template_id -package_id $package_id]
+}
+
+set edit_pageset_template_url \
+ [export_vars -base ${base_url}pageset-configure {return_url pageset_id}]
+set configure_url [export_vars -base ${base_url}admin/layouts/configure {return_url pageset_id}]
+set add_applications_url [export_vars -base ${base_url}admin/layouts/add-applications {return_url pageset_id}]
+set user_pagesets_p [expr { [parameter::get -parameter CreatePrivatePageSets -package_id $package_id] && $package_edit_p }]
+if { $user_pagesets_p } {
+ set user_pagesets_url [export_vars -base ${base_url}admin/layouts/user-pagesets {pageset_id return_url}]
+}
+
Index: openacs-4/packages/layout-managed-subsite/lib/plain-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/plain-master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/plain-master.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,10 @@
+
+navigation
+@main_content_p@
+
+
+
+
+
+
+
Index: openacs-4/packages/layout-managed-subsite/lib/plain-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/plain-master.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/plain-master.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,34 @@
+ad_page_contract {
+
+ Build two-level tabbed navigation multirows for a pageset.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+
+ $Id: plain-master.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+}
+
+set user_id [ad_conn user_id]
+
+set subsite_node_id [site_node::get_node_id_from_object_id -object_id [ad_conn subsite_id]]
+set layout_manager_url \
+ [lindex [site_node::get_children \
+ -node_id $subsite_node_id \
+ -package_key layout-managed-subsite] 0]
+
+set package_id [site_node::get_object_id -node_id [site_node::get_node_id -url $layout_manager_url]]
+set package_node_id [site_node::get_node_id_from_object_id -object_id $package_id]
+
+set pageset_id [layout::pageset::get_user_pageset_id -package_id $package_id]
+
+# set a default title in case an included application page doesn't set it. Should move
+# to the doc() array approach in the future.
+set title ""
+
+# No expr tag in the templating system ...
+set main_content_p [expr { ![info exists page_num] }]
+
+if { $main_content_p } {
+ array set theme \
+ [layout::theme::get \
+ -name [layout::pageset::get_column_value -pageset_id $pageset_id -column theme]]
+}
Index: openacs-4/packages/layout-managed-subsite/lib/tabbed-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/tabbed-master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/tabbed-master.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,10 @@
+
+navigation
+@main_content_p@
+
+
+
+
+
+
+
Index: openacs-4/packages/layout-managed-subsite/lib/tabbed-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/tabbed-master.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/tabbed-master.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,70 @@
+ad_page_contract {
+
+ Build two-level tabbed navigation multirows for a pageset.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+
+ $Id: tabbed-master.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+}
+
+set user_id [ad_conn user_id]
+
+set layout_manager_id [layout::package_id]
+set layout_manager_node_id [site_node::get_node_id_from_object_id -object_id $layout_manager_id]
+set layout_manager_url [site_node::get_url_from_object_id -object_id $layout_manager_id]
+
+set pageset_id [layout::pageset::get_user_pageset_id -package_id $layout_manager_id]
+
+# set a default title in case an included application page doesn't set it. Should move
+# to the doc() array approach in the future.
+set title ""
+
+# Create the multirow so other code that add to this can do so with multirow append
+template::multirow create navigation group label href target \
+ title lang accesskey class id tabindex
+
+# Grab the pages for the user pageset
+db_multirow -cache_key pageset_${pageset_id}_multirow_${user_id} -append \
+ -unclobber -extend {group href target title lang accesskey class id} \
+ navigation select_pageset_pages {} {
+ set group main
+ set href [export_vars -base $layout_manager_url {{pageset_id $pageset_id} \
+ {page_num $tabindex}}]
+}
+
+subsite_navigation::define_pageflow -navigation_multirow navigation -group main -subgroup sub \
+ -show_applications_p [parameter::get -package_id [ad_conn subsite_id] \
+ -parameter ShowApplications -default 1] \
+ -no_tab_application_list [parameter::get -package_id [ad_conn subsite_id] \
+ -parameter NoTabApplicationList -default ""]
+
+if { [site_node::get_element -url [ad_conn package_url] -element parent_id] == \
+ $layout_manager_node_id } {
+ set instance_name [site_node::get_element -url [ad_conn package_url] \
+ -element instance_name]
+ template::multirow append navigation main $instance_name [ad_conn package_url] \
+ "" $instance_name "" [template::multirow size navigation] "" \
+ main-navigation-active [template::multirow size navigation]
+}
+
+set pageset_page_p 0
+array set page_url_map [parameter::get -package_id $layout_manager_id -parameter PageUrlMap -default ""]
+for { set i 1 } { $i <= [template::multirow size navigation] } { incr i } {
+ set tabindex [template::multirow get navigation $i tabindex]
+ if { [info exists page_url_map($tabindex)] &&
+ [regexp $page_url_map($tabindex) [ad_conn url]] ||
+ [info exists page_num] && $tabindex == $page_num } {
+ template::multirow set navigation $i id main-navigation-active
+ set pageset_page_p 1
+ break
+ }
+}
+
+if { !$pageset_page_p } {
+ array set theme \
+ [layout::theme::get \
+ -name [layout::pageset::get_column_value -pageset_id $pageset_id -column theme]]
+}
+
+# No expr tag in the templating system ...
+set main_content_p [expr { !$pageset_page_p }]
Index: openacs-4/packages/layout-managed-subsite/lib/tabbed-master.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/lib/tabbed-master.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/lib/tabbed-master.xql 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ select lp.name as label, lp.sort_key as tabindex
+ from layout_pages lp
+ where lp.pageset_id = :pageset_id
+ and exists (select 1
+ from layout_elements le, acs_object_party_privilege_map aoppm
+ where le.page_id = lp.page_id
+ and aoppm.object_id = le.package_id
+ and aoppm.party_id = :user_id
+ and aoppm.privilege = le.required_privilege)
+ order by lp.sort_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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/tcl/apm-callback-procs.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,68 @@
+ad_library {
+ Installation procs for layout_managed_subsite-bridge
+
+ @author Don Baccus (dhogaza@pacifier.com) Furfly (http://furfly.net)
+}
+
+namespace eval layout_managed_subsite {}
+namespace eval layout_managed_subsite::install {}
+
+ad_proc layout_managed_subsite::install::after_install {} {
+ Package after installation callback proc
+} {
+
+ db_transaction {
+
+ # Define a couple of includelets
+
+ layout::includelet::new \
+ -name layout_admin_includelet \
+ -description "Layout Administration" \
+ -title "Layout Administration" \
+ -application layout-managed-subsite \
+ -template /packages/layout-managed-subsite/lib/layout-admin-includelet \
+ -required_privilege admin
+
+ # Should define an acs-subsite-includelets package
+
+ layout::includelet::new \
+ -name subsites_includelet \
+ -description "Display Subsites" \
+ -title "Subsites" \
+ -application acs-subsite \
+ -template /packages/acs-subsite/lib/subsites
+
+ layout::includelet::new \
+ -name applications_includelet \
+ -description "Display Subsite Applications" \
+ -title "Applications" \
+ -application acs-subsite \
+ -template /packages/acs-subsite/lib/applications
+
+ subsite::new_subsite_theme \
+ -key layout_managed_subsite_tabbed \
+ -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}" \
+ -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
+ }
+}
+
+ad_proc -private layout_managed_subsite::install::after_upgrade {
+ {-from_version_name:required}
+ {-to_version_name:required}
+} {
+
+ Upgrade logic
+
+} {
+ apm_upgrade_logic \
+ -from_version_name $from_version_name \
+ -to_version_name $to_version_name \
+ -spec {
+ }
+}
Index: openacs-4/packages/layout-managed-subsite/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/index.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,38 @@
+
+@title;noquote@
+
+@title;noquote@
+
+
+Advanced Features
+
+
+
+
+ Core Services
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/index.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,26 @@
+# /packages/mbryzek-subsite/www/admin/index.tcl
+
+ad_page_contract {
+ @author Bryan Quinn (bquinn@arsdigita.com)
+ @author Michael Bryzek (mbryzek@arsdigita.com)
+
+ @creation-date August 15, 2000
+ @cvs-id $Id: index.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+} {
+} -properties {
+ context:onevalue
+ subsite_name:onevalue
+ acs_admin_url:onevalue
+ instance_name:onevalue
+ acs_automated_testing_url:onevalue
+ acs_lang_admin_url:onevalue
+}
+
+array set this_node [site_node::get -url [ad_conn url]]
+set title "$this_node(instance_name) Administration"
+
+set acs_admin_url [apm_package_url_from_key "acs-admin"]
+array set acs_admin_node [site_node::get -url $acs_admin_url]
+set acs_admin_name $acs_admin_node(instance_name)
+set sw_admin_p [permission::permission_p -party_id [ad_conn user_id] -object_id $acs_admin_node(object_id) -privilege admin]
+set convert_subsite_p [expr { [llength [apm_package_descendents [ad_conn package_key]]] > 0 }]
Index: openacs-4/packages/layout-managed-subsite/www/admin/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/index.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/index.xql 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ select p.instance_name
+ from apm_packages p
+ where p.package_id = :package_id
+
+
+
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications-2.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,37 @@
+ad_page_contract {
+
+ Add one or more package_keys to this instance of the layout manager package
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: add-applications-2.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+
+} {
+ package_key:multiple
+ return_url:notnull,optional
+}
+
+set added_package_keys [list]
+
+db_transaction {
+ foreach one_package_key $package_key {
+
+ # For some reason I'm getting dupes in my package_key list from the checkboxes
+ # set up by the list widget on the previous page.
+
+ if { [lsearch -exact $added_package_keys $one_package_key] == -1 } {
+
+ lappend added_package_keys $one_package_key
+
+ # Now mount the package_key under our URL
+ set package_key_id [subsite::auto_mount_application \
+ -node_id [ad_conn node_id] \
+ $one_package_key]
+
+ }
+ }
+}
+
+if { [info exists return_url] } {
+ ad_returnredirect $return_url
+}
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications-2.xql 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ select package_id
+ from layout_pagesets
+ where pageset_id = :pageset_id
+
+
+
+
+
+ select name
+ from layout_includelets
+ where application = :one_application
+ and internally_manged_p = 'f'
+
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,6 @@
+
+ Add applications and their includelets
+ @context;noquote@
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-applications.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,12 @@
+ad_page_contract {
+
+ Generate a list of applications that are supported by includelets.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: add-applications.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+}
+
+set context [list "Add Applications"]
+set return_url [ad_conn url]?[ad_conn query]
+ad_return_template
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-elements.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-elements.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/add-elements.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,40 @@
+ad_page_contract {
+
+ Add one or more includelets as new elements in the given pageset
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: add-elements.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+
+} {
+ pageset_id:naturalnum,notnull
+ package_id:naturalnum,notnull
+ name:notnull,multiple
+ return_url:notnull
+}
+
+permission::require_permission -object_id $pageset_id -privilege admin
+
+set added_names [list]
+
+db_transaction {
+ foreach one_name $name {
+
+ # For some reason I'm getting dupes in my name list from the checkboxes
+ # set up by the list widget on the previous page.
+
+ if { [lsearch -exact $added_names $one_name] == -1 } {
+
+ lappend added_names $one_name
+
+ layout::element::new \
+ -pageset_id $pageset_id \
+ -package_id $package_id \
+ -includelet_name $one_name \
+ -state hidden \
+ -initialize
+
+ }
+ }
+}
+ad_returnredirect $return_url
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,4 @@
+
+@title;noquote@
+@context;noquote@
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,33 @@
+ad_page_contract {
+
+ Main configuration page for the layout manager package. Defines the configuration
+ wizard and tracks state.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: configure.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+}
+
+layout::pageset::initialize -package_id [ad_conn package_id]
+
+# Now set up the wizard and off we go into configuration ecstasy!
+
+template::wizard::create -action configure -name configure -params {} -steps {
+ 1 -label "Welcome to the Layout Manager Configuration Wizard" -url /packages/layout-managed-subsite/lib/configure-help
+ 2 -label "Configure Private Page Sets" -url /packages/layout-managed-subsite/lib/configure-private-pagesets
+ 3 -label "Configure User Control Over Appearance" -url /packages/layout-managed-subsite/lib/configure-configurability
+ 4 -label "Add Applications" -url /packages/layout-managed-subsite/lib/add-applications
+ 5 -label "Configure Master Page Set Layout" -url /packages/layout-manager/lib/pageset-configure
+ 6 -label "Configure Subsite Integration" -url /packages/layout-managed-subsite/lib/configure-subsite-integration
+ 100 -label "Congratulations! Configuration Is Complete" -url /packages/layout-managed-subsite/lib/configure-finish
+}
+
+template::wizard::get_current_step
+
+# Beautify the context bar and title with the current wizard step's label.
+
+array set current_info [array get wizard:${wizard:current_id}]]
+set title $current_info(label)
+set context [list $title]
+
+ad_return_template
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,28 @@
+ad_page_contract {
+
+ Make exact copies of a set of elements.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: copy-elements.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+
+} {
+ element_id:naturalnum,notnull,multiple
+ return_url:notnull
+}
+
+set copied_element_ids [list]
+
+db_transaction {
+ foreach one_element_id $element_id {
+
+ # For some reason I'm getting dupes in my element_id list from the checkboxes
+ # set up by the list widget on the previous page.
+
+ if { [lsearch -exact $copied_element_ids $one_element_id] == -1 } {
+ lappend copied_element_ids $one_element_id
+ layout::element::copy -element_id $one_element_id -state hidden
+ }
+ }
+}
+ad_returnredirect $return_url
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/delete-elements.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/delete-elements.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/delete-elements.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,28 @@
+ad_page_contract {
+
+ Delete a set of elements.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: delete-elements.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+
+} {
+ element_id:naturalnum,notnull,multiple
+ return_url:notnull
+}
+
+set deleted_element_ids [list]
+
+db_transaction {
+ foreach one_element_id $element_id {
+
+ # For some reason I'm getting dupes in my element_id list from the checkboxes
+ # set up by the list widget on the previous page.
+
+ if { [lsearch -exact $deleted_element_ids $one_element_id] == -1 } {
+ lappend deleted_element_ids $one_element_id
+ layout::element::delete -element_id $one_element_id
+ }
+ }
+}
+ad_returnredirect $return_url
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/index.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,6 @@
+
+Configuration
+@context;noquote@
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/index.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,17 @@
+ad_page_contract {
+
+ Main administration page for the layout manager package
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: index.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+} { }
+
+if { ![layout::pageset::initialized] } {
+ ad_returnredirect configure
+ ad_script_abort
+}
+
+set context [list Admin]
+
+ad_return_template
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,12 @@
+
+ Manage One Binding
+ @context;noquote@
+ #layout-managed-subsite.layout_elements_bound#
+
+
#layout-managed-subsite.you_can_create#
+
+
+
+ #layout-managed-subsite.Return_to_Add_Applications#
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,98 @@
+ad_page_contract {
+
+ Manage a single datasource/pageset binding
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date
+ @cvs-id $Id: manage-includelets.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+} {
+ pageset_id:naturalnum,notnull
+ package_id:naturalnum,notnull
+ package_url:notnull
+ package_key:notnull
+ admin_url:notnull
+}
+
+set context [list "[_ layout-managed-subsite.Manage_Includelets]"]
+
+set return_url [ad_conn url]?[ad_conn query]
+db_multirow -unclobber -extend {copy_url delete_url} elements get_elements {} {
+ set delete_url [export_vars -base [ad_conn package_url]admin/layouts/delete-elements \
+ { pageset_id element_id admin_url return_url}]
+ set copy_url [export_vars -base [ad_conn package_url]admin/layouts/copy-elements \
+ { pageset_id element_id admin_url return_url}]
+}
+
+template::list::create \
+ -name elements \
+ -multirow elements \
+ -key element_id \
+ -bulk_actions "
+ {[_ layout-managed-subsite.Delete_checked_elements]}
+ [ad_conn package_url]admin/layouts/delete-elements
+ {[_ layout-managed-subsite.Delete_checked_elements]}
+ " \
+ -bulk_action_export_vars {
+ package_id element_id admin_url return_url
+ } \
+ -elements {
+ title {
+ label {[_ layout-managed-subsite.Title]}
+ }
+ includelet_name {
+ label {[_ layout-managed-subsite.Includelet]}
+ }
+ state {
+ label {[_ layout-managed-subsite.State]}
+ }
+ actions {
+ label {[_ layout-managed-subsite.Action]}
+ display_template {
+
+ #layout-managed-subsite.Delete#
+
+
+
+ #layout-managed-subsite.Copy#
+
+ }
+ }
+ }
+
+db_multirow -extend {add_url} includelets get_includelets {} {
+ set add_url [export_vars -base [ad_conn package_url]admin/layouts/add-elements \
+ { package_id pageset_id name title admin_url return_url}]
+ set singleton_p [ad_decode $singleton_p t Yes f No $singleton_p]
+}
+
+template::list::create \
+ -name includelets \
+ -multirow includelets \
+ -key name \
+ -bulk_actions "
+ {[_ layout-managed-subsite.Add_checked_includelets]}
+ [ad_conn package_url]admin/layouts/add-elements
+ {[_ layout-managed-subsite.Add_checked_includelets]}
+ " \
+ -bulk_action_export_vars {
+ package_id pageset_id return_url admin_url
+ } \
+ -elements {
+ name {
+ label {[_ layout-managed-subsite.Includelet]}
+ }
+ description {
+ label {[_ layout-managed-subsite.Description]}
+ }
+ singleton_p {
+ label {[_ layout-managed-subsite.Singleton]}
+ }
+ add {
+ label {[_ layout-managed-subsite.Action]}
+ link_url_col add_url
+ link_html { title [_ layout-managed-subsite.Add] class button }
+ display_template {[_ layout-managed-subsite.Add]}
+ }
+ }
+
+ad_return_template
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/Attic/manage-includelets.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.xql 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ select le.*
+ from layout_elements le
+ where le.package_id = :package_id
+ order by le.title
+
+
+
+
+
+ select li.*
+ from layout_includelets li
+ where apm_package__is_child(li.application, :package_key)
+ and li.internally_managed_p = 'f'
+ and not exists (select 1
+ from layout_elements le
+ where le.package_id = :package_id
+ and le.includelet_name = li.name
+ and li.singleton_p = 't')
+ order by li.name
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-admin-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-admin-master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-admin-master.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,9 @@
+
+
+
+Pageset: @name@
+
+Go back
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-show.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-show.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-show.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,6 @@
+
+ @referer;noquote@
+ @name;noquote@
+ @navbar;noquote@
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-show.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-show.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/pageset-show.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,17 @@
+ad_page_contract {
+ Just a test script to display the pageset.
+
+ @author AKS
+ @creation-date
+ @cvs-id $Id: pageset-show.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+} {
+ {referer:notnull}
+ {pageset_id:naturalnum,notnull}
+ {page_num 0}
+}
+
+set name [layout::pageset::get_column_value -pageset_id $pageset_id -column name]
+array set pageset [layout::pageset::get_render_data -pageset_id $pageset_id -page_num $page_num]
+
+ad_return_template
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,16 @@
+
+Welcome to the Layout Manager
+
+
+ There are no personal pagesets in the system.
+
+
+ Pagesets belonging to the current subsite:
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.tcl 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,12 @@
+ad_page_contract {
+ Page that displays a list of pagesets with edit links belonging to this layout manager instance.
+
+ @author Arjun Sanyal (arjun@openforce.net)
+ @creation-date
+ @cvs-id $Id: user-pagesets.tcl,v 1.1 2008/11/26 11:10:23 donb Exp $
+} { }
+
+set package_id [ad_conn package_id]
+db_multirow pagesets get_pagesetss {}
+
+ad_return_template
Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/user-pagesets.xql 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ select pageset_id, name
+ from layout_pagesets
+ where package_id = :package_id
+ and template_id is not null
+
+
+
+
Index: openacs-4/packages/layout-managed-subsite/www/doc/applications.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/applications.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/applications.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,18 @@
+
+Adding Applications
+Adding Applications
+After you decide whether or not to allow personal pagesets, the wizard will run
+the "add applications" admin page. This page will first list applications that have already
+been mounted (if they support includelets), their URL, and includelets that have been
+bound as layout elements to each application.
+Following this list (which is initially empty) is a list of applications which support
+includelets and are available to be mounted. Note that you can mount as many instances
+of each application as you want. This makes sense for some packages (content-includelet,
+for instance), but not for others (file-storage). You'll need to depend on your
+knowledge of each application to decide when it makes sense for you to mount a package
+more than once. Note that this is no different than when deciding how many instances of
+a package to mount when configuring a "normal" subsite outside the context of the
+Layout Manager Integration package.
+
When you mount an application, it will be listed in the top half of the page, with no
+layout elements bound to it. Click on the Manage Includelets action link. This is
+described on a separate documentation page.
Index: openacs-4/packages/layout-managed-subsite/www/doc/create-subsite.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/create-subsite.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/create-subsite.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,22 @@
+
+Create A Layout Managed Subsite
+Create A Layout Managed Subsite
+A layout managed subsite is created by either mounting a new subsite of type Layout Managed
+Subsite, or converting an existing subsite:
+
+
+- To create a new layout managed subsite, visit the parent subsite's advanced admin page.
+Choose the "create new subsite" option. If the Layout Managed Subsite package has been
+installed, the create new subsite form will display a select widget which will allow you
+to choose between "Subsite" (acs-subsite), "Layout Managed Subsite", and other subsite packages
+you may have installed. Choose the "Layout Managed Subsite" subsite type. You should also
+choose one of the OpenACS or Layout Managed Subsite themes, rather than the obsolete themes
+provided for backwards compatibility.
+
- To convert an existing subsite, visit that subsite's admin page. If the Layout Managed
+Subsite package has been installed, you'll see an option listed under "Subsite Administration"
+to convert the subsite type. That link leads to a form which includes a select widget listing
+the available subsite packages. Choose "Layout Managed Subsite".
+This is particularly useful if you want your main subsite, mounted at "/", to be a
+Layout Managed Subsite, because initial install always mounts an instance of the standard
+acs-subsite package at "/".
+
Index: openacs-4/packages/layout-managed-subsite/www/doc/includelets.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/includelets.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/includelets.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,25 @@
+
+Managing an application's includelets
+Managing an Application's Includelets
+When you enter the Manage Includelets page from the Add Applications page,
+you'll be presented with two lists. The first list contains layout elements that have
+been bound to this application within the pageset being configured. For each element
+the "title",
+internal "includelet name", "state" ("hidden" from users, or "full", displayed on a page),
+and a link to delete the element are displayed.
+Currently, you can only change element attributes like its title, theme and state from
+the page configuration UI. The only action you can take from the Manage Includelets
+page is to delete the element (which perversely can't be done from the page configuration
+page, mostly to keep users from destroying their environment if they're allowed to have
+personal pagesets).
+
Below this list is a list of includelets which can be bound to elements and added to
+the pageset being configured. You can add an includelet as a new layout element as many
+times as you want. For example, you might want to include an instance of the forums includlet
+on each page displayed to the user. To do so, add the includelet as a new layout element
+once for each layout page that will be created for the subsite, then add them individually to
+each page in the page configuration UI.
+
When you're done adding includelets or deleting elements, click on the "return
+to add applications" button. This will allow you to manage includelets and layout elements
+for another application, or to resume adding new applications. If you're running the
+wizard, when you're finished click the "next" button to advance to the next configuration
+step.
Index: openacs-4/packages/layout-managed-subsite/www/doc/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/index.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,23 @@
+
+Layout Managed Subsite Documentation
+Layout Managed Subsite Documentation
+Introduction
+The Layout Managed Subsite package provides the tools necessary to build a
+subsite centered around Layout Manager page sets, pages and includelets. It
+includes tabbed and plain master templates designed to work with the openacs default
+master templates introduced in OpenACS 5.4, admin UI to manage the mounting of
+applications that support includelets and the binding of includelets and application
+package instances into layout manager elements.
+It also provides a simple wizard that allows you to create your subsite step-by-step.
+This document briefly describes how to build a layout manager driven subsite using the wizard.
+
Table of Contents
+
Index: openacs-4/packages/layout-managed-subsite/www/doc/install.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/install.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/install.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,23 @@
+
+Install application and includelet packages
+Install Application and Includelet Packages
+Before you can build your subsite's layout using the Layout Managed Subsite
+package's wizard, you must install all of the packages you'd like to use with this
+subsite. If you forget some, you can install them afterwards and revisit the appropriate
+admin UI pages to add the includelets and their associated applications to the subsite,
+but it's easiest to do so before running the wizard.
+Each includelet package depends on an application package, typically a standalone package
+such as forums. In some cases, an includelet package will provide it's own application,
+for example the content-includelet package, which provides simple content management
+for an individual includelet but which is not meant to be used standalone outside of the
+Layout Manager environment.
+
The standard naming convention for includelet packages is to apply a "-includelets" suffix
+to a base application name. Thus forums-includelets is based in the forums
+application package, file-storage-includelets the file-storage package, etc.
+
Correctly implemented includelet packages will include a dependency on their base
+application package, and will be marked as a service, not application. To
+install an includelets package and its base application package, go to the acs-admin
+install software page, select services, and select the includelets you'd like to
+install.
+
After completion, restart AOLserver. These includelets and applications are now ready
+for use by the Layout Manager and Layout Managed Subsite packages.
Index: openacs-4/packages/layout-managed-subsite/www/doc/master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/master.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,20 @@
+
+Choose master template
+Choose the Master Template
+The Layout Managed Subsite package provides two custom master templates
+which render a loyout pageset in the context of the openacs default theme. On the
+wizard page that asks you to choose a master template, you may choose one of these
+two master templates or to leave the parent subsite's master template unchanged.
+The "plain" master is meant to be used with sites that just have a single "cover page"
+built from layout includelets, or provide their own navigation. No navigation between pages
+is provided.
+
The "tabbed" master, selected by default, provides a row of navigation tabs integrated
+with the navigation tabs generated by the openacs default master template. Each page is
+represented by a tab, and the page's title provides the label for the tab. As with
+the default openacs theme, other tabs ("Member", "Administration", etc) and subtabs for
+the "Administration" page (if enabled) are configured by modifying subsite parameters
+in the "Navigation Tabs" section.
+
The third option, which leaves the subsite master untouched, should only be used if
+you have implemented your own custom theme and master template that integrates navigation
+tools with layout manager pages. The default openacs master template doesn't work well
+with the Layout Manager.
Index: openacs-4/packages/layout-managed-subsite/www/doc/pageset-configuration.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/pageset-configuration.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/pageset-configuration.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,10 @@
+
+Pageset Configuration
+Pageset Configuration
+The pageset configuration tool allows you to determine the number of pages to be
+displayed; to place or remove elements from particular pages; to manage theming of
+the entire set of pages, individual pages, and individual elements; and to edit
+element titles.
+It's very similar to the configuration tool provided by .LRN's new-portal package, and
+should be self-explanatory. Similar restrictions apply, in particular you con't remove a page,
+ or change its layout if there are any elements placed on it.
Index: openacs-4/packages/layout-managed-subsite/www/doc/pagesets.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/pagesets.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/pagesets.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,30 @@
+
+Personal Pagesets or not?
+Personal Pagesets or not?
+Personal pagesets are not yet implemented
+A pageset is a set of pages managed by the Layout Manager as a unit. The
+first thing you must decide for your subsite is whether or not to provide each individual
+with their own configurable pageset, or one pageset shared by all.
+Advantages and disadvantages are:
+
+ - Personal pagesets allow each individual user to determine which layout elements
+ to display, the number of pages that make up the pageset, and the arrangement of
+ layout elements on individual pages. Unless they're an administrator of the
+ Layout Managed Subsite package, they will not be allowed to add new
+ applications to the subsite.
+
- The Layout Manager package heavily caches the database queries needed to
+ compute the information necessary to render layout pages and elements. When all
+ users share a single pageset, the number of queries that must be cached is quite
+ small. If users each have their own pageset, the number of queries that must be
+ cached is multipied by the number of users of the subsite. This can cause poor
+ cache performance or require a large cache size to be specified for the database
+ cache pool.
+
- Users might confuse themselves by accidently hiding layout elements, moving them
+ to an unfamiliar page, etc. This might increase the effort required to support
+ a site substantially.
+
- Having one shared layout pageset allows you to lay out the subsite precisely without
+ worrying about users specifying experimenting with odd themes for elements, etc. If
+ you're going to allow users to have their own layout pagesets, keep the graphic
+ design dead-simple! Resist the temptation to create themes that only work on the
+ left or right side of a page, for instance.
+
Index: openacs-4/packages/layout-managed-subsite/www/doc/wizard.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/doc/wizard.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/layout-managed-subsite/www/doc/wizard.adp 26 Nov 2008 11:10:23 -0000 1.1
@@ -0,0 +1,13 @@
+
+Layout Managed Subsite Wizard
+Layout Managed Subsite Wizard
+The wizard takes you through the process of mounting applications and binding
+includelets to them, creating pages, choosing navigation style, etc.
+When you add a Layout Managed Subsite instance, or convert an existing subsite,
+the wizard will be automatically run when you first visit the subsite. If you don't
+complete the wizard,
+the next time you visit you might see a blank page. To continue configuring the
+subsite in this case, visit the mounted subsite's admin directory, and choose the
+layout option. From that page, you can
+restart the wizard if you want (you can run any number of times), or visit
+the individual admin pages.