Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.32 -r1.33 --- openacs-4/packages/dotlrn/dotlrn.info 21 Jan 2002 19:07:55 -0000 1.32 +++ openacs-4/packages/dotlrn/dotlrn.info 21 Jan 2002 22:08:46 -0000 1.33 @@ -229,6 +229,8 @@ + + Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.47 -r1.48 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 21 Jan 2002 17:13:51 -0000 1.47 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 21 Jan 2002 22:08:46 -0000 1.48 @@ -153,6 +153,7 @@ [portal::create \ -portal_template_p "t" \ -name "$pretty_name Portal Template" \ + -default_page_name [ad_parameter class_first_page_name] \ -context_id $community_id \ $user_id ] @@ -161,13 +162,20 @@ [portal::create \ -template_id $portal_template_id \ -name "$pretty_name Non-Member Portal" \ + -default_page_name [ad_parameter class_first_page_name] \ -context_id $community_id \ $user_id] + ns_log notice "aks1 [db_string foobar { + select page_id + from portal_current_page + where portal_id = :portal_id}]" + # Create the admin page set admin_portal_id \ [portal::create \ -name "$pretty_name Administration Portal" \ + -default_page_name [ad_parameter class_admin_first_page_name] \ -context_id $community_id \ -layout_name "Simple 1-Column" \ $user_id] Index: openacs-4/packages/dotlrn/www/master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/master.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/master.tcl 21 Jan 2002 09:35:39 -0000 1.2 +++ openacs-4/packages/dotlrn/www/master.tcl 21 Jan 2002 22:08:46 -0000 1.3 @@ -2,17 +2,17 @@ # sloan specifc master # -# if page count > 1, show navbar +# if we have a portal_id show navbar if {![empty_string_p $portal_id]} { - if {[portal::page_count -portal_id $portal_id] > 1} { +# if {[portal::page_count -portal_id $portal_id] > 1} { set navbar "" append navbar [portal::list_pages -portal_id $portal_id -link "switch-page" -pre_html ""] append navbar "
" -separator "
" -post_html "
" - } else { - set navbar "" - } +# } else { +# set navbar "" +# } } else { set navbar "" } Index: openacs-4/packages/new-portal/sql/oracle/api-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/api-create.sql,v diff -u -r1.29 -r1.30 --- openacs-4/packages/new-portal/sql/oracle/api-create.sql 21 Jan 2002 19:08:41 -0000 1.29 +++ openacs-4/packages/new-portal/sql/oracle/api-create.sql 21 Jan 2002 22:08:19 -0000 1.30 @@ -90,7 +90,7 @@ if v_current_page_count = 0 then insert into portal_current_page - (portal_id, page_id) values (portal_id, v_page_id); + (portal_id, page_id) values (portal_page.new.portal_id, v_page_id); else update portal_current_page set page_id = v_page_id @@ -107,7 +107,9 @@ ) is begin - delete from portal_current_page where page_id = page_id; + delete from portal_current_page where page_id = portal_page.delete.page_id; + delete from portal_pages where page_id = portal_page.delete.page_id; + acs_object.delete(page_id); end delete; @@ -235,7 +237,6 @@ from portal_pages where portal_id = portal.delete.portal_id) loop - -- delete this portal's pages portal_page.delete ( page_id => page.page_id 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.95 -r1.96 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 21 Jan 2002 19:08:41 -0000 1.95 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 21 Jan 2002 22:08:19 -0000 1.96 @@ -142,7 +142,7 @@ } ad_proc -public render { - {-page_num 0} + {-page_id ""} {-hide_links_p "f"} {-render_style "individual"} portal_id @@ -161,9 +161,10 @@ set master_template [ad_parameter master_template] set css_path [ad_parameter css_path] -# if {[empty_string_p $page_num]} { -# set page_num [get_current_page -portal_id $portal_id] -# } + # if no page_id set, render current + if {[empty_string_p $page_id]} { + set page_id [get_current_page -portal_id $portal_id] + } # get the portal and layout db_1row portal_select {} -column_array portal @@ -195,7 +196,8 @@ element_src=\"@element_src@\" theme_id=@portal.theme_id@ portal_id=@portal.portal_id@ - hide_links_p=@hide_links_p@>" + hide_links_p=@hide_links_p@ + page_id=@page_id@ layout_id=@portal.layout_id@>" } # Necessary hack to work around the acs-templating system @@ -259,7 +261,7 @@ ad_proc -public configure { - {-page_num 0} + {-page_id ""} {-template_p "f"} portal_id return_url @@ -274,6 +276,11 @@ @return A portal configuration page } { + # if no page_id set, render current + if {[empty_string_p $page_id]} { + set page_id [get_current_page -portal_id $portal_id] + } + if { $template_p == "f" } { ad_require_permission $portal_id portal_read_portal ad_require_permission $portal_id portal_edit_portal @@ -321,7 +328,7 @@ # XXXX page support # fake some elements for the in the template - set layout_id [get_layout_id -page_num $page_num $portal_id] + set layout_id [get_layout_id -page_id $page_id $portal_id] db_foreach get_regions {} { lappend fake_element_ids($region) $portal_id @@ -358,7 +365,7 @@ + hide_links_p=f page_id=@page_id@ layout_id=@layout_id@> " # This hack is to work around the acs-templating system set __adp_stub "[get_server_root][www_path]/." 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.7 -r1.8 --- openacs-4/packages/new-portal/tcl/portal-procs.xql 21 Jan 2002 15:42:32 -0000 1.7 +++ openacs-4/packages/new-portal/tcl/portal-procs.xql 21 Jan 2002 22:08:19 -0000 1.8 @@ -41,21 +41,23 @@ - select p.name, p.portal_id, p.theme_id, pl.filename as layout_template - from portals p, portal_pages pp, portal_layouts pl - where :portal_id = pp.portal_id - and pp.portal_id = p.portal_id - and pp.layout_id = pl.layout_id - and pp.sort_key = :page_num + select p.name, pcp.portal_id, pl.filename as layout_template, + p.theme_id as theme_id, pp.layout_id as layout_id + from portals p, portal_current_page pcp, portal_layouts pl, portal_pages pp + where pcp.page_id = :page_id + and pcp.portal_id = :portal_id + and p.portal_id = pcp.portal_id + and pp.page_id = pcp.page_id + and pl.layout_id = pp.layout_id select element_id, region, pem.sort_key - from portal_element_map pem, portal_pages pp - where pp.portal_id = :portal_id - and pp.page_id = pem.page_id + from portal_element_map pem, portal_current_page pcp + where pcp.portal_id = :portal_id + and pcp.page_id = pem.page_id and state != 'hidden' order by region, sort_key @@ -87,12 +89,13 @@ - select p.name, p.portal_id, pp.layout_id, pl.filename as template, sort_key as page_num - from portals p, portal_pages pp, portal_layouts pl - where :portal_id = pp.portal_id - and pp.portal_id = p.portal_id - and pp.layout_id = pl.layout_id - and pp.sort_key = :page_num + select p.name, pcp.portal_id, pp.layout_id, pl.filename as template + from portals p, portal_current_page pcp, portal_layouts pl, portal_pages pp + where pcp.page_id = :page_id + and pcp.portal_id = :portal_id + and p.portal_id = pcp.portal_id + and pp.page_id = pcp.page_id + and pl.layout_id = pp.layout_id @@ -131,8 +134,9 @@ select state - from portal_element_map - where portal_id = :portal_id + from portal_element_map pem, portal_current_page pcp + where pcp.portal_id = :portal_id + and pem.page_id = pcp.page_id and element_id = :element_id @@ -141,17 +145,15 @@ update portal_element_map set state = 'pinned' - where portal_id = :portal_id - and element_id = :element_id + where element_id = :element_id update portal_element_map set state = 'full' - where portal_id = :portal_id - and element_id = :element_id + where element_id = :element_id Index: openacs-4/packages/new-portal/www/place-element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/place-element.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/new-portal/www/place-element.tcl 21 Jan 2002 06:29:55 -0000 1.23 +++ openacs-4/packages/new-portal/www/place-element.tcl 21 Jan 2002 22:08:19 -0000 1.24 @@ -12,7 +12,7 @@ element_multi:multirow } -set layout_id [portal::get_layout_id -page_num 0 $portal_id] +# this template gets its vars from the layout template (e.g. simple2.adp) db_1row select_num_regions " select count(*) as num_regions @@ -25,12 +25,13 @@ db_foreach select_elements_by_region { select element_id, pem.pretty_name as name, pem.sort_key, state - from portal_element_map pem, portal_pages pp - where - pp.portal_id = :portal_id - and pem.page_id = pp.page_id - and region = :region - and state != 'hidden' + from portal_element_map pem, portal_current_page pcp + where + pcp.portal_id = :portal_id + and pcp.page_id = :page_id + and pem.page_id = pcp.page_id + and region = :region + and state != 'hidden' order by sort_key } { set hideable_p [portal::get_element_param $element_id "hideable_p"] @@ -43,10 +44,11 @@ db_1row select_all_noimm_count \ "select count(*) as all_count -from portal_element_map pem, portal_pages pp +from portal_element_map pem, portal_pages pcp where -pp.portal_id = :portal_id -and pem.page_id = pp.page_id +pcp.portal_id = :portal_id +and pcp.page_id = :page_id +and pem.page_id = pcp.page_id and state != 'hidden' and region not like 'i%'" @@ -60,10 +62,11 @@ db_foreach hidden_elements { select element_id, name - from portal_element_map pem, portal_pages pp + from portal_element_map pem, portal_current_page pcp where - pp.portal_id = :portal_id - and pp.page_id = pem.page_id + pcp.portal_id = :portal_id + and pcp.page_id = :page_id + and pcp.page_id = pem.page_id and pem.state = 'hidden' order by name } { Index: openacs-4/packages/new-portal/www/template-place-element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/template-place-element.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/new-portal/www/template-place-element.tcl 21 Jan 2002 06:29:55 -0000 1.4 +++ openacs-4/packages/new-portal/www/template-place-element.tcl 21 Jan 2002 22:08:19 -0000 1.5 @@ -11,8 +11,9 @@ return_url:onevalue } -set layout_id [portal::get_layout_id -page_num 0 $portal_id] +# this template gets its vars from the layout template (e.g. simple2.adp) + db_1row select_num_regions " select count(*) as num_regions from portal_supported_regions @@ -23,10 +24,11 @@ template::multirow create element_multi element_id name sort_key state hideable_p shadeable_p description db_foreach select_elements_by_region { select pem.element_id, pem.name, pem.sort_key, state, pd.description - from portal_element_map pem, portal_datasources pd, portal_pages pp + from portal_element_map pem, portal_datasources pd, portal_current_page pcp where - pp.portal_id = :portal_id - and pem.page_id = pp.page_id + pcp.portal_id = :portal_id + and pcp.page_id = :page_id + and pem.page_id = pcp.page_id and pem.datasource_id = pd.datasource_id and region = :region and state != 'hidden' @@ -46,10 +48,11 @@ db_1row select_all_noimm_count \ "select count(*) as all_count - from portal_element_map pem, portal_pages pp + from portal_element_map pem, portal_current_page pcp where - pp.portal_id = :portal_id - and pp.page_id = pem.page_id + pcp.portal_id = :portal_id + and pcp.page_id = :page_id + and pcp.page_id = pem.page_id and state != 'hidden' and region not like 'i%'" @@ -62,10 +65,11 @@ db_foreach hidden_elements { select element_id, name - from portal_element_map pem, portal_pages pp + from portal_element_map pem, portal_current_page pcp where - pp.portal_id = :portal_id - and pp.page_id = pem.page_id + pcp.portal_id = :portal_id + and pcp.page_id = :page_id + and pcp.page_id = pem.page_id and pem.state = 'hidden' order by name } { Index: openacs-4/packages/new-portal/www/layouts/simple1.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/layouts/simple1.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/new-portal/www/layouts/simple1.adp 19 Jan 2002 21:59:48 -0000 1.1 +++ openacs-4/packages/new-portal/www/layouts/simple1.adp 21 Jan 2002 22:08:19 -0000 1.2 @@ -4,7 +4,16 @@ -
+
Index: openacs-4/packages/new-portal/www/layouts/simple2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/layouts/simple2.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/new-portal/www/layouts/simple2.adp 16 Jan 2002 21:43:36 -0000 1.6 +++ openacs-4/packages/new-portal/www/layouts/simple2.adp 21 Jan 2002 22:08:19 -0000 1.7 @@ -4,12 +4,30 @@ -
+
-
+