Index: openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 21 Jan 2002 19:08:41 -0000 1.4 +++ openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 22 Jan 2002 01:31:52 -0000 1.5 @@ -99,7 +99,8 @@ :1 := portal_page.new ( pretty_name => :pretty_name, - portal_id => :portal_id + portal_id => :portal_id, + layout_id => :layout_id ); end; Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -r1.96 -r1.97 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 21 Jan 2002 22:08:19 -0000 1.96 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 22 Jan 2002 01:31:52 -0000 1.97 @@ -96,7 +96,7 @@ {-name "Untitled"} {-template_id ""} {-portal_template_p "f"} - {-layout_name "Simple 2-Column"} + {-layout_name ""} {-default_page_name ""} {-context_id ""} user_id @@ -107,8 +107,14 @@ @param user_id @param layout_name optional } { - db_1row layout_id_select {} - return [ db_exec_plsql create_new_portal_and_perms {}] + # get the default layout_id - simple2 + if {![empty_string_p $layout_name]} { + set layout_id [get_layout_id -layout_name $layout_name] + } else { + set layout_id [get_layout_id] + } + + return [db_exec_plsql create_new_portal_and_perms {}] } ad_proc -public delete { @@ -619,6 +625,7 @@ @return the id of the page @param portal_id } { + set layout_id [get_layout_id] return [db_exec_plsql page_create_insert {}] } @@ -1238,7 +1245,8 @@ ad_proc -private get_layout_id { {-page_num ""} {-page_id ""} - portal_id + {-layout_name "Simple 2-Column"} + {portal_id ""} } { Get the layout_id of a layout template for a portal page. @@ -1248,9 +1256,15 @@ } { if { ![empty_string_p $page_num] } { db_1row get_layout_id_num_select {} - } else { + } elseif { ![empty_string_p $page_id] } { db_1row get_layout_id_page_select {} + } elseif { ![empty_string_p $layout_name] } { + db_1row get_layout_id_name_select {} + } else { + ad_return_complaint 1 "portal::get_layout_id bad params!" + ns_log error "portal::get_layout_id bad params!" } + return $layout_id } Index: openacs-4/packages/new-portal/tcl/portal-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/new-portal/tcl/portal-procs.xql 21 Jan 2002 22:08:19 -0000 1.8 +++ openacs-4/packages/new-portal/tcl/portal-procs.xql 22 Jan 2002 01:31:52 -0000 1.9 @@ -19,14 +19,6 @@ - - - select layout_id from - portal_layouts where - name = :layout_name - - - delete from acs_permissions where object_id= :portal_id @@ -529,6 +521,12 @@ + + + select layout_id from portal_layouts where name = :layout_name + + + select 1 from portals where portal_id = :portal_id