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.3 -r1.4 --- openacs-4/packages/layout-managed-subsite/catalog/layout-managed-subsite.en_US.ISO-8859-1.xml 1 Dec 2008 20:16:18 -0000 1.3 +++ openacs-4/packages/layout-managed-subsite/catalog/layout-managed-subsite.en_US.ISO-8859-1.xml 3 Dec 2008 09:22:00 -0000 1.4 @@ -17,6 +17,7 @@ Configure Subsite Integration Congratulations! Configuration Is Complete Copy + Copy checked elements Choose master template? 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. @@ -34,6 +35,7 @@ Plain Plain navigation (works best if there's only one layout manager page) Return to Add Applications + Should we always show a tab for each mounted application? Should we show the navigation tabs for empty pages? Should we show the navigation tabs when there's only one of them? Service 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.2 -r1.3 --- openacs-4/packages/layout-managed-subsite/lib/add-applications.xql 30 Nov 2008 13:15:02 -0000 1.2 +++ openacs-4/packages/layout-managed-subsite/lib/add-applications.xql 3 Dec 2008 09:22:00 -0000 1.3 @@ -17,8 +17,9 @@ select li.title, count(*) - from layout_includelets li, layout_elements le - where le.package_id = :subsite_id + from layout_includelets li, layout_elements le, layout_pages lp + where lp.pageset_id = :pageset_id + and le.page_id = lp.page_id and le.includelet_name = li.name and li.application = :package_key group by li.title @@ -41,8 +42,10 @@ select li.title, count(*) - from layout_includelets li, layout_elements le - where le.package_id = :package_id + from layout_includelets li, layout_elements le, layout_pages lp + where lp.pageset_id = :pageset_id + and le.package_id = :package_id + and le.page_id = lp.page_id and le.includelet_name = li.name group by li.title order by li.title 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 -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.tcl 26 Nov 2008 11:10:23 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/lib/configure-private-pagesets.tcl 3 Dec 2008 09:22:00 -0000 1.2 @@ -1,6 +1,5 @@ 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 { 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 -r1.2 -r1.3 --- openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.tcl 1 Dec 2008 20:16:18 -0000 1.2 +++ openacs-4/packages/layout-managed-subsite/lib/configure-subsite-integration.tcl 3 Dec 2008 09:22:00 -0000 1.3 @@ -1,6 +1,5 @@ ad_page_contract { - Configure the layout manager package's interaction with the subsite package in the 'ole - look and feel department. + Configure the layout managed subsite package's look and feel. } { } @@ -22,6 +21,11 @@ {values {0}} {label "[_ layout-managed-subsite.show_empty_pages]"} } + {show_applications_p:boolean(radio) + {options {{Yes 1} {No 0}}} + {values {1}} + {label "[_ layout-managed-subsite.show_applications]"} + } } -on_submit { switch $template_style { @@ -44,6 +48,11 @@ -package_id [ad_conn package_id] \ -value $show_empty_pages_p + parameter::set_value \ + -parameter ShowApplications \ + -package_id [ad_conn package_id] \ + -value $show_applications_p + template::wizard::forward } 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 -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/lib/tabbed-master.tcl 26 Nov 2008 11:10:23 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/lib/tabbed-master.tcl 3 Dec 2008 09:22:00 -0000 1.2 @@ -32,19 +32,26 @@ {page_num $tabindex}}] } +set show_applications_p [parameter::get -package_id [ad_conn subsite_id] \ + -parameter ShowApplications -default 1] +set no_tab_application_list [parameter::get -package_id [ad_conn subsite_id] \ + -parameter NoTabApplicationList -default ""] + 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 ""] + -show_applications_p $show_applications_p \ + -no_tab_application_list $no_tab_application_list -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] +if { !$show_applications_p } { + array set package_node [site_node::get_from_url -exact -url [ad_conn package_url]] + if { $package_node(parent_id) == $layout_manager_node_id && + [lsearch -exact $no_tab_application_list $package_node(package_key)] == -1 } { + set instance_name [site_node::get_element -url [ad_conn package_url] \ + -element instance_name] + template::multirow append navigation main $package_node(instance_name) \ + [ad_conn package_url] "" $package_node(instance_name) "" \ + [template::multirow size navigation] "" \ + main-navigation-active [template::multirow size navigation] + } } set pageset_page_p 0 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 -r1.2 -r1.3 --- openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.tcl 1 Dec 2008 20:16:18 -0000 1.2 +++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/configure.tcl 3 Dec 2008 09:22:00 -0000 1.3 @@ -8,10 +8,10 @@ @cvs-id $Id$ } -layout::pageset::initialize -package_id [ad_conn package_id] - # Now set up the wizard and off we go into configuration ecstasy! +layout::pageset::initialize -package_id [ad_conn package_id] + template::wizard::create -action configure -name configure -params {} -steps { 1 -label "[_ layout-managed-subsite.Welcome]" -url /packages/layout-managed-subsite/lib/configure-help 2 -label "[_ layout-managed-subsite.Configure_Private_Page_Sets]" -url /packages/layout-managed-subsite/lib/configure-private-pagesets @@ -21,13 +21,11 @@ 6 -label "[_ layout-managed-subsite.Configure_Subsite]" -url /packages/layout-managed-subsite/lib/configure-subsite-integration 100 -label "[_ layout-managed-subsite.Congratulations]" -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 foo [array get current_info] set title $current_info(label) set context [list $title] 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 -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.tcl 26 Nov 2008 11:10:23 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.tcl 3 Dec 2008 09:22:00 -0000 1.2 @@ -21,7 +21,14 @@ 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 + array set element [layout::element::get -element_id $one_element_id] + set page_id $element(page_id) + set page_column $element(page_column) + set sort_key [db_string get_sort_key {}] + layout::element::clone \ + -element_id $one_element_id \ + -sort_key $sort_key \ + -state hidden } } } Index: openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/copy-elements.xql 3 Dec 2008 09:22:00 -0000 1.1 @@ -0,0 +1,14 @@ + + + + + + + select max(layout_elements.sort_key) + 1 + from layout_elements + where page_id = :page_id + and page_column = :page_column + + + + 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 -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.tcl 26 Nov 2008 11:10:23 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.tcl 3 Dec 2008 09:22:00 -0000 1.2 @@ -31,6 +31,9 @@ {[_ layout-managed-subsite.Delete_checked_elements]} [ad_conn package_url]admin/layouts/delete-elements {[_ layout-managed-subsite.Delete_checked_elements]} + {[_ layout-managed-subsite.Copy_checked_elements]} + [ad_conn package_url]admin/layouts/copy-elements + {[_ layout-managed-subsite.Copy_checked_elements]} " \ -bulk_action_export_vars { package_id element_id admin_url return_url 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 -r1.1 -r1.2 --- openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.xql 26 Nov 2008 11:10:23 -0000 1.1 +++ openacs-4/packages/layout-managed-subsite/www/admin/layouts/manage-includelets.xql 3 Dec 2008 09:22:00 -0000 1.2 @@ -5,8 +5,10 @@ select le.* - from layout_elements le + from layout_elements le, layout_pages lp where le.package_id = :package_id + and lp.page_id = le.page_id + and lp.pageset_id = :pageset_id order by le.title Index: openacs-4/packages/layout-manager/catalog/layout-manager.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/catalog/layout-manager.en_US.ISO-8859-1.xml,v diff -u -r1.3 -r1.4 --- openacs-4/packages/layout-manager/catalog/layout-manager.en_US.ISO-8859-1.xml 26 Nov 2008 11:13:52 -0000 1.3 +++ openacs-4/packages/layout-manager/catalog/layout-manager.en_US.ISO-8859-1.xml 3 Dec 2008 09:22:00 -0000 1.4 @@ -7,5 +7,18 @@ Left sidebar Right sidebar Left and right sidebars + Add hidden portlet + Add a new page + Configure + Page + Page Set theme + Rename + Revert + Revert to the default layout + No elements on this page + Template + Theme + The page set package hasn't been configured yet. + Update Index: openacs-4/packages/layout-manager/lib/page-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/lib/page-configure.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/layout-manager/lib/page-configure.adp 30 Jul 2008 11:59:33 -0000 1.2 +++ openacs-4/packages/layout-manager/lib/page-configure.adp 3 Dec 2008 09:22:00 -0000 1.3 @@ -7,19 +7,19 @@ - Page: + #layout-manager.Page#: - + - Theme: + #layout-manager.Theme#: @@ -33,30 +33,29 @@ - + - - - - - - - - Template: - - - selected> - @page_templates.description@ - - - - - - - + + + + + + + #layout-manager.Template#: + + + selected> + @page_templates.description@ + + + + + + + @@ -66,7 +65,7 @@ - No Elements on this page + #layout-manager.no_elements# @@ -81,19 +80,19 @@ - - - - - - - - - - + + + + + + + + + + Index: openacs-4/packages/layout-manager/lib/pageset-configure-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/lib/pageset-configure-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-manager/lib/pageset-configure-2.tcl 30 Jul 2008 11:59:33 -0000 1.1 +++ openacs-4/packages/layout-manager/lib/pageset-configure-2.tcl 3 Dec 2008 09:22:00 -0000 1.2 @@ -99,6 +99,11 @@ } change_page_template { + layout::page::adjust_element_columns \ + -page_id $page_id \ + -columns [layout::page_template::get_column_value \ + -name $page_template \ + -column columns] layout::page::set_column_value \ -page_id $page_id \ -column page_template \ Index: openacs-4/packages/layout-manager/lib/pageset-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/lib/pageset-configure.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-manager/lib/pageset-configure.adp 22 Jul 2008 07:31:02 -0000 1.1 +++ openacs-4/packages/layout-manager/lib/pageset-configure.adp 3 Dec 2008 09:22:00 -0000 1.2 @@ -2,13 +2,13 @@ - Page Set Theme: + #layout-manager.pageset_theme#: selected>@themes.description@ - + @@ -22,7 +22,7 @@ @hidden_elements.title@ - + @@ -35,7 +35,7 @@ - Add a new page: + #layout-manager.add_page#: @@ -45,8 +45,8 @@ - Revert to the default arrangement: - + #layout-manager.revert_layout#: + Index: openacs-4/packages/layout-manager/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/tcl/element-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/layout-manager/tcl/element-procs.tcl 30 Aug 2008 00:34:10 -0000 1.4 +++ openacs-4/packages/layout-manager/tcl/element-procs.tcl 3 Dec 2008 09:22:00 -0000 1.5 @@ -390,30 +390,38 @@ } -ad_proc layout::element::copy { +ad_proc layout::element::clone { -element_id:required - {-page_name ""} + {-name ""} + {-title ""} + {-theme ""} + {-required_privilege ""} + {-page_id ""} {-page_column ""} - {-state full} + {-state ""} + {-sort_key ""} } { - Make a copy of an existing element, including its parameters. + Make a copy of an existing element, including its parameters. By default, + the element will be copied to the end of its current page and column with its + current name, title, theme, required_privilege and state. @param element_id The existing element to copy from. - @param page_name The name of the page to place the copy on. + @param name The name to give to the copy. + @param title The title to give to the copy. + @param theme The theme to give to the copy. + @param required_privilege The privilege on the base package required of the user. + @param page_id The id of the page to place the copy on. @param page_column The column in which to place the copy. + @param state The state to assign the copy. + @return The element_id of the new copy of the element. -} { - set page_id [layout::element::get_column_value -element_id $element_id -column page_id] - if { $page_column eq "" } { - set page_column [layout::element::choose_page_column -page_id $page_id] - } - +} { set new_element_id [db_nextval layout_seq] db_transaction { - db_dml copy_element {} - db_dml copy_element_parameters {} + db_dml clone_element {} + db_dml clone_element_parameters {} } return $new_element_id Index: openacs-4/packages/layout-manager/tcl/element-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/tcl/element-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/layout-manager/tcl/element-procs.xql 30 Aug 2008 00:34:10 -0000 1.2 +++ openacs-4/packages/layout-manager/tcl/element-procs.xql 3 Dec 2008 09:22:00 -0000 1.3 @@ -16,35 +16,35 @@ :theme, :state, coalesce((select max(layout_elements.sort_key) + 1 - from layout_elements - where page_id = :page_id - and page_column = :page_column), 1), + from layout_elements + where page_id = :page_id + and page_column = :page_column), + 1), layout_includelets.required_privilege, :package_id from layout_includelets where layout_includelets.name = :includelet_name - + insert into layout_elements (element_id, includelet_name, name, title, page_id, page_column, theme, state, sort_key, required_privilege, package_id) - select :new_element_id, includelet_name, name, title, :page_id, :page_column, - theme, :state, - coalesce((select max(layout_elements.sort_key) + 1 - from layout_elements - where page_id = :page_id - and page_column = :page_column), 1), - required_privilege, - package_id - from layout_elements - where element_id = :element_id + select :new_element_id, le.includelet_name, coalesce(:name, le.name), + coalesce(:title, le.title), coalesce(:page_id, le.page_id), + coalesce(:page_column, le.page_column), coalesce(:theme, le.theme), + coalesce(:state, le.state), + coalesce(:sort_key, sort_key), + coalesce(:required_privilege, required_privilege), + package_id + from layout_elements le + where le.element_id = :element_id - + insert into layout_element_parameters (element_id, key, value) Index: openacs-4/packages/layout-manager/tcl/page-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/tcl/page-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-manager/tcl/page-procs.tcl 22 Jul 2008 07:31:03 -0000 1.1 +++ openacs-4/packages/layout-manager/tcl/page-procs.tcl 3 Dec 2008 09:22:00 -0000 1.2 @@ -49,6 +49,45 @@ layout::page::flush -page_id $page_id } +ad_proc layout::page::clone { + -page_id:required + {-pageset_id ""} + {-name ""} + {-page_template ""} + {-theme ""} + {-sort_key ""} +} { + Create a clone of an existing page and the elements it contains. By default + the new page will be appended to the existing page's pageset. + + @param page_id The id of the page to clone. + @param pageset_id The id of the pageset to place the cloned page in. + @param name The page name (used for navigation). + @param page_template The page template to use to render this page. + @param sort_key Where in the page order to put the page. +} { + set new_page_id [db_nextval layout_seq] + db_transaction { + db_dml insert_page {} + foreach element_id [layout::page::get_elements -page_id $page_id] { + layout::element::clone -element_id $element_id -page_id $new_page_id + } + } + layout::pageset::flush -pageset_id $pageset_id + return $page_id +} + +ad_proc -private layout::page::get_elements { + -page_id:required +} { + Return the elements bound to this page. + + @param page_id The id of the page + @return A list of element_ids bound to the page +} { + return [db_list -cache_key page_${page_id}_get_elements get_elements {}] +} + ad_proc -private layout::page::get { -page_id:required } { @@ -179,6 +218,27 @@ } } +ad_proc layout::page::adjust_element_columns { + -page_id:required + -columns:required +} { + Adjust the elements on the page so that their column values are less than or equal + two the columns parameters. Used when the number of columns on a page is changed. + + @parame page_id The id of the page we're interested in. + @params columns The number of columns on the page. +} { + foreach element_id [layout::page::get_elements -page_id $page_id] { + if { [layout::element::get_column_value -element_id $element_id -column page_column] + > $columns } { + layout::element::set_column_value \ + -element_id $element_id \ + -column page_column \ + -value $columns + } + } +} + ad_proc -private layout::page::flush { -page_id:required } { @@ -188,3 +248,4 @@ } { db_flush_cache -cache_key_pattern page_${page_id}_* } + Index: openacs-4/packages/layout-manager/tcl/page-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/tcl/page-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-manager/tcl/page-procs.xql 22 Jul 2008 07:31:03 -0000 1.1 +++ openacs-4/packages/layout-manager/tcl/page-procs.xql 3 Dec 2008 09:22:00 -0000 1.2 @@ -40,6 +40,27 @@ + + + insert into layout_pages + (page_id, name, pageset_id, page_template, theme, sort_key) + select :new_page_id, coalesce(:name, lp.name), coalesce(:pageset_id, pageset_id), + coalesce(:page_template, lp.page_template), coalesce(:theme, lp.theme), + coalesce(:sort_key, sort_key) + from layout_pages lp + where lp.page_id = :page_id + + + + + + select element_id + from layout_elements + where page_id=:page_id + order by element_id + + + select * Index: openacs-4/packages/layout-manager/tcl/pageset-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/tcl/pageset-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/layout-manager/tcl/pageset-procs.tcl 26 Aug 2008 20:36:41 -0000 1.2 +++ openacs-4/packages/layout-manager/tcl/pageset-procs.tcl 3 Dec 2008 09:22:00 -0000 1.3 @@ -18,6 +18,7 @@ {-owner_privileges {read write admin}} {-theme default} {-package_id ""} + {-template_id ""} } { Create a new page set for the passed in owner_id. create pages passed in the page_list. @@ -50,7 +51,8 @@ {p_context_id $context_id} {p_owner_id $owner_id} {p_theme $theme} - {p_package_id $package_id}}] + {p_package_id $package_id} + {p_template_id $template_id}}] set pageset_id [package_instantiate_object -var_list $var_list layout_pageset] @@ -69,6 +71,52 @@ return $pageset_id } +ad_proc layout::pageset::clone { + -pageset_id:required + {-owner_id ""} + {-name ""} + {-theme ""} + {-package_id ""} + {-template_id ""} + {-owner_privileges {read write admin}} +} { + Clone the given pageset. By default all of the existing pageset attributes + will be copied into the new copy of the pageset. + + @param pageset_id The id of the pageset to clone. + @param owner_id The optional owner of the new pageset. + @param name The optional name of the new pageset. + @param theme The optional theme name for the new pageset. + @param package_id The optional id of the package the new pageset will be mapped to. + @param owner_privilges List of privileges to assign to the owner of the new copy. +} { + array set pageset [layout::pageset::get -pageset_id $pageset_id] + if { $owner_id eq "" } { + set owner_id $pageset(owner_id) + } + if { $name eq "" } { + set name $pageset(name) + } + if { $theme eq "" } { + set theme $pageset(theme) + } + if { $package_id eq "" } { + set package_id $pageset(package_id) + } + db_transaction { + set new_pageset_id [layout::pageset::new \ + -owner_id $owner_id \ + -name $name \ + -theme $theme \ + -package_id $package_id \ + -owner_privileges $owner_privileges] + foreach page_id [layout::pageset::get_pages -pageset_id $pageset_id] { + layout::page::clone -page_id $page_id -pageset_id $new_pageset_id + } + } + return $new_pageset_id +} + ad_proc layout::pageset::delete { -pageset_id:required } { @@ -79,6 +127,14 @@ layout::pageset::flush -pageset_id $pageset_id } +ad_proc layout::pageset::get_pages { + -pageset_id:required +} { + Return a list of page ids corresponding to the pages mapped to the given pageset. +} { + return [db_list -cache_key pageset_${pageset_id}_get_pages get_pages {}] +} + ad_proc -private layout::pageset::get { -pageset_id:required } { @@ -144,14 +200,11 @@ set master_template_id [layout::pageset::get_master_template_id -package_id $package_id] -# DRB: this needs to be rewritten - set pageset_id [layout::pageset::new \ - -owner_id $owner_id \ - -name "Portal for $user_name" \ - -template_id $master_template_id \ - -context_id [ad_conn package_id] \ - -initialize_elements] - + set pageset_id [layout::pageset::clone \ + -pageset_id $master_template_id \ + -owner_id $owner_id \ + -name "Portal for $user_name" \ + -template_id $master_template_id] } return $pageset_id } Index: openacs-4/packages/layout-manager/tcl/pageset-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/tcl/pageset-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/layout-manager/tcl/pageset-procs.xql 22 Jul 2008 07:31:03 -0000 1.1 +++ openacs-4/packages/layout-manager/tcl/pageset-procs.xql 3 Dec 2008 09:22:00 -0000 1.2 @@ -19,6 +19,15 @@ + + + select page_id + from layout_pages + where pageset_id = :pageset_id + order by page_id + + + select * Index: openacs-4/packages/layout-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/www/Attic/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/layout-manager/www/index.tcl 26 Nov 2008 11:13:52 -0000 1.3 +++ openacs-4/packages/layout-manager/www/index.tcl 3 Dec 2008 09:22:00 -0000 1.4 @@ -21,7 +21,9 @@ ad_returnredirect [site_node::get_url_from_object_id -object_id $package_id]admin/layouts ad_script_abort } else { - ad_return_exception_template -params {{custom_message "The page set package hasn't been configured yet."}} /packages/acs-subsite/www/shared/report-error + ad_return_exception_template \ + -params {{custom_message "[_ layout-manager.uninitialized]"}} \ + /packages/acs-subsite/www/shared/report-error } } Index: openacs-4/packages/layout-manager/www/pageset-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/layout-manager/www/pageset-configure.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/layout-manager/www/pageset-configure.tcl 26 Nov 2008 11:13:53 -0000 1.3 +++ openacs-4/packages/layout-manager/www/pageset-configure.tcl 3 Dec 2008 09:22:00 -0000 1.4 @@ -10,7 +10,7 @@ permission::require_permission -object_id $pageset_id -privilege write -set title "Configure" +set title "[_ layout-manager.Configure]" set context [list $title] set return_url [ad_conn url]?[ad_conn query]