Index: openacs-4/contrib/packages/portal/lib/add-applications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/add-applications.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/add-applications.tcl 12 Mar 2004 04:54:03 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/add-applications.tcl 13 Mar 2004 00:40:26 -0000 1.2 @@ -50,7 +50,7 @@ } } -# Now, if we're in the template wizard, generate the wizard form. +# Now, if we're in the template wizard, generate the wizard form and buttons. if { $wizard_p } { Index: openacs-4/contrib/packages/portal/lib/page-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/page-configure.adp,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/lib/page-configure.adp 27 Feb 2004 23:58:15 -0000 1.2 +++ openacs-4/contrib/packages/portal/lib/page-configure.adp 13 Mar 2004 00:40:26 -0000 1.3 @@ -6,8 +6,9 @@
-
+ Page: + @@ -18,7 +19,8 @@
- + + @@ -43,7 +45,8 @@
No Elements on this page - + + Index: openacs-4/contrib/packages/portal/lib/page-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/page-configure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/page-configure.tcl 27 Feb 2004 01:13:14 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/page-configure.tcl 13 Mar 2004 00:40:26 -0000 1.2 @@ -6,6 +6,9 @@ } +set return_url [ad_conn url]?[ad_conn query] +set package_url [ad_conn package_url] + # We'll pass the array set format page info to the region configure template set page_list [portal::page::get_not_cached -page_id $page_id] Index: openacs-4/contrib/packages/portal/lib/portal-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/portal-configure.adp,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/portal-configure.adp 12 Mar 2004 04:54:03 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/portal-configure.adp 13 Mar 2004 00:40:26 -0000 1.2 @@ -1,5 +1,5 @@ - - + + + + @@ -31,8 +31,8 @@

- - + + Add a new page: @@ -41,10 +41,14 @@ -

- + + Revert to the default arrangement:
+ + + + Index: openacs-4/contrib/packages/portal/lib/portal-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/portal-configure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/portal-configure.tcl 12 Mar 2004 04:54:03 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/portal-configure.tcl 13 Mar 2004 00:40:26 -0000 1.2 @@ -5,17 +5,18 @@ @author Don Baccus (dhogaza@pacifier.com) } { - portal_id:integer,notnull } -permission::require_permission -object_id $portal_id -privilege write - -set title "Configure" -set context [list $title] set return_url [ad_conn url]?[ad_conn query] +set package_url [ad_conn package_url] -# Get a bunch of data for various configuration options we'll offer the user. +# If we're called from the configuration wizard, portal_id is not defined but we +# know we're configuting the master template. +if { ![info exists portal_id] } { + set portal_id [portal::get_master_template_id] +} + set current_theme_id [portal::get_theme_id -portal_id $portal_id] set first_page_id [lindex [portal::get_page_list -portal_id $portal_id] 0] db_multirow themes select_themes {} @@ -25,4 +26,18 @@ set new_page_num [expr {$page_count + 1}] set template_id [portal::get_template_id -portal_id $portal_id] +# 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/contrib/packages/portal/lib/region-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/region-configure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/region-configure.tcl 27 Feb 2004 01:13:14 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/region-configure.tcl 13 Mar 2004 00:40:26 -0000 1.2 @@ -1,3 +1,13 @@ +ad_page_contract { + + Configure a portal page region (i.e. column) + + @author Don Baccus (dhogaza@pacifier.com) + +} + +set return_url [ad_conn url]?[ad_conn query] + array set page $page_list # queries need these as a bindvar ... @@ -32,29 +42,32 @@ # Set up the "hide" option if { [string is true $hideable_p] } { set hide_url \ - [export_vars -base portal-configure-2 {{op hide} portal_id page_id element_id}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op hide} portal_id page_id element_id return_url}] } else { set hide_url "" } # Set up the "move up" option if possible if { $element_num > 1} { set up_url \ - [export_vars -base portal-configure-2 {{op move_up} portal_id element_id page_id}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op move_up} portal_id element_id page_id return_url}] } elseif { ![string equal $prev_page_id ""] } { set up_url \ - [export_vars -base portal-configure-2 \ - {{op move_to_page} portal_id element_id {page_id $prev_page_id}}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op move_to_page} portal_id element_id {page_id $prev_page_id} return_url}] } # Set up the "move down" option if possible if { $element_num < $element_count } { set down_url \ - [export_vars -base portal-configure-2 {{op move_down} portal_id element_id page_id}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op move_down} portal_id element_id page_id return_url}] } elseif { ![string equal $next_page_id ""] } { set down_url \ - [export_vars -base portal-configure-2 \ - {{op move_to_page} portal_id element_id {page_id $next_page_id}}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op move_to_page} portal_id element_id {page_id $next_page_id} return_url}] } # If there's more than one region, let the user move the portlet to the right or left @@ -63,15 +76,15 @@ # if there's space to the right, let them move the portlet right if { $region < $region_count } { set right_url \ - [export_vars -base portal-configure-2 \ - {{op move_right} portal_id element_id region}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op move_right} portal_id element_id region return_url}] } # If there's space to the left, let them move the portlet left if { $region > 1 } { set left_url \ - [export_vars -base portal-configure-2 \ - {{op move_left} portal_id element_id region}] + [export_vars -base [ad_conn package_url]portal-configure-2 \ + {{op move_left} portal_id element_id region return_url}] } } Index: openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl 12 Mar 2004 04:54:04 -0000 1.5 +++ openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl 13 Mar 2004 00:40:26 -0000 1.6 @@ -71,7 +71,6 @@ set datasource(hideable_p) t array set datasource $spec -ns_log Notice "Huh? setting admin_p: $datasource(admin_p)" # Default datasource description to its name if { ![info exists datasource(description)] } { Index: openacs-4/contrib/packages/portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 12 Mar 2004 04:54:04 -0000 1.17 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 13 Mar 2004 00:40:26 -0000 1.18 @@ -62,7 +62,7 @@ @owner_id The object (usually a party) which owns the new portal @name The name of the portal @template_id If set, copy this portal's elements into the new portal - @context_id The new portal object's context_id + @context_id The new portal object's context_id (defaults to package_id) @page_list The list of pages to create within the portal @owner_privileges A list of privileges to grant the party on the new portal. Normally the default list (read, write, admin) will be correct if the party @@ -73,6 +73,10 @@ } { + if { [string equal $context_id ""] } { + set context_id [ad_conn package_id] + } + db_transaction { set var_list [subst { @@ -85,7 +89,7 @@ set portal_id [package_instantiate_object -var_list $var_list portal] foreach privilege $owner_privileges { - permission::grant -owner_id $owner_id -object_id $portal_id -privilege $privilege + permission::grant -party_id $owner_id -object_id $portal_id -privilege $privilege } if {[empty_string_p $template_id]} { Index: openacs-4/contrib/packages/portal/www/admin/configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/www/admin/configure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/www/admin/configure.tcl 12 Mar 2004 04:54:04 -0000 1.1 +++ openacs-4/contrib/packages/portal/www/admin/configure.tcl 13 Mar 2004 00:40:27 -0000 1.2 @@ -19,7 +19,7 @@ 3 -label "Configure User Control Over Appearance" -url /packages/portal/lib/configure-configurability 4 -label "Configure User \"My Account\" and \"Configure\" Pages" -url /packages/portal/lib/configure-extra-user-pages 5 -label "Add Applications" -url /packages/portal/lib/add-applications - 6 -label "Configure Portal Layout" -url /packages/portal/lib/portal-configure + 6 -label "Configure Master Portal Template Layout" -url /packages/portal/lib/portal-configure 100 -label "Congratulations! Configuration Is Complete" -url /packages/portal/lib/configure-finish } Index: openacs-4/contrib/packages/portal/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/www/admin/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/contrib/packages/portal/www/admin/index.tcl 12 Mar 2004 04:54:04 -0000 1.7 +++ openacs-4/contrib/packages/portal/www/admin/index.tcl 13 Mar 2004 00:40:27 -0000 1.8 @@ -32,7 +32,8 @@ set package_id [ad_conn package_id] set edit_portal_template_url \ - [export_vars -base ../portal-configure {{referer index} {portal_id $master_template_id}}] + [export_vars -base ../portal-configure \ + {{referer index} {portal_id [portal::get_master_template_id]}}] db_1row count_uninstalled_applications {} ad_return_template