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.107 -r1.108 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 23 Jan 2002 06:29:22 -0000 1.107 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 25 Jan 2002 20:04:45 -0000 1.108 @@ -164,6 +164,7 @@ ad_proc -public render { {-page_id ""} + {-page_num ""} {-hide_links_p "f"} {-render_style "individual"} portal_id @@ -182,10 +183,12 @@ set master_template [ad_parameter master_template] set css_path [ad_parameter css_path] - # if no page_id set, render current - if {[empty_string_p $page_id]} { - set page_id [get_current_page -portal_id $portal_id] - } + # if no page_num set, render page 0 + if {[empty_string_p $page_id] && [empty_string_p $page_num]} { + set page_id [get_page_id -portal_id $portal_id -sort_key 0] + } elseif {![empty_string_p $page_num]} { + set page_id [get_page_id -portal_id $portal_id -sort_key $page_num] + } # get the portal and layout db_1row portal_select {} -column_array portal @@ -212,7 +215,7 @@ set element_src "[www_path]/render_styles/${render_style}/render-element" set template " @portal.name@ - Page $portal(page_name) has no Elements" } else { append template " -

Page $portal(page_name) Elements +

Page $portal(page_name) [get_page_pretty_name -page_id $page]" - } - append html $separator - } - - return [append html $post_html] - + return [ad_dimensional -no_header \ + -no_bars \ + -link_all $link_all \ + -td_align $td_align \ + -pre_html $pre_html \ + -post_html $post_html \ + -extra_td_html $extra_td_html \ + -table_html_args $table_html_args \ + $ad_dim_struct \ + $link] } # @@ -873,12 +834,11 @@ # First, check if this portal 1) has a portal template and # 2) that that template has an element of this DS in it. If # so, copy stuff. If not, just insert normally. + if { [db_0or1row get_template_info_select {}] == 1 } { - if { [db_0or1row check_new {}] == 1 } { - db_transaction { set new_element_id [db_nextval acs_object_id_seq] - db_dml template_page_insert {} + db_1row get_target_page_id {} db_dml template_insert {} db_dml template_params_insert {} }