Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.37 -r1.38 --- openacs-4/packages/dotlrn/dotlrn.info 22 Jan 2002 19:59:31 -0000 1.37 +++ openacs-4/packages/dotlrn/dotlrn.info 22 Jan 2002 20:02:29 -0000 1.38 @@ -249,10 +249,10 @@ - - - - + + + + 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.49 -r1.50 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 22 Jan 2002 16:02:46 -0000 1.49 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 22 Jan 2002 20:02:30 -0000 1.50 @@ -153,7 +153,7 @@ [portal::create \ -portal_template_p "t" \ -name "$pretty_name Portal Template" \ - -default_page_name [ad_parameter class_first_page_name] \ + -default_page_name [ad_parameter community_first_page_name] \ -context_id $community_id \ $user_id ] @@ -162,20 +162,15 @@ [portal::create \ -template_id $portal_template_id \ -name "$pretty_name Non-Member Portal" \ - -default_page_name [ad_parameter class_first_page_name] \ + -default_page_name [ad_parameter community_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] \ + -default_page_name [ad_parameter community_admin_first_page_name] \ -context_id $community_id \ -layout_name "Simple 1-Column" \ $user_id] Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 22 Jan 2002 03:37:49 -0000 1.16 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 22 Jan 2002 20:02:30 -0000 1.17 @@ -47,17 +47,31 @@ ns_set put $extra_vars type_id $type_id db_transaction { + + # get the first page name and theme + set page_name_and_layout_list [split [ad_parameter user_wsp_page_names "Untitled Page,Simple 2-Column" ] ";"] + set page_name_list [list] + set layout_list [list] + + # seperate name and theme + foreach item $page_name_and_layout_list { + lappend page_name_list [lindex [split $item ","] 0] + lappend layout_name_list [lindex [split $item ","] 1] + } + if {$rel_type == "dotlrn_full_user_rel"} { # Create a portal page for this user set portal_id [portal::create \ -name "Your dotLRN Workspace" \ - -default_page_name [ad_parameter user_wsp_first_page_name] \ + -default_page_name [lindex $page_name_list 0] \ + -layout_name [lindex $layout_name_list 0] \ $user_id] - # create the default pages from the ad_param - foreach name [split [ad_parameter user_wsp_page_names] ","] { - - portal::page_create -portal_id $portal_id -pretty_name $name + # create rest of the default pages from the ad_param + for {set i 1} {$i < [expr [llength $page_name_list]]} {incr i} { + portal::page_create -portal_id $portal_id \ + -pretty_name [lindex $page_name_list $i] \ + -layout_name [lindex $layout_name_list $i] } # manually switch back to the first page Index: openacs-4/packages/dotlrn/www/configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/configure.adp 21 Jan 2002 06:30:11 -0000 1.3 +++ openacs-4/packages/dotlrn/www/configure.adp 22 Jan 2002 20:02:30 -0000 1.4 @@ -1,6 +1,7 @@ Configure @name@ @portal_id@ +t

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.4 -r1.5 --- openacs-4/packages/dotlrn/www/master.tcl 21 Jan 2002 22:37:03 -0000 1.4 +++ openacs-4/packages/dotlrn/www/master.tcl 22 Jan 2002 20:02:30 -0000 1.5 @@ -3,17 +3,11 @@ # # if we have a portal_id show navbar -if {![empty_string_p $portal_id]} { +if {![empty_string_p $portal_id] && ![exists_and_not_null no_navbar_p]} { # 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 [portal::list_pages -portal_id $portal_id -link "switch-page" -pre_html ""] append navbar "
" -separator "
" -post_html "
- Calendar
- My Files
- Control Panel
" -separator "
" -post_html "
" # } else { Index: openacs-4/packages/dotlrn/www/one-community-portal-template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-portal-template.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/one-community-portal-template.adp 21 Jan 2002 06:30:11 -0000 1.2 +++ openacs-4/packages/dotlrn/www/one-community-portal-template.adp 22 Jan 2002 20:02:30 -0000 1.3 @@ -1,6 +1,7 @@ Configure this instance's template @portal_id@ +t

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.30 -r1.31 --- openacs-4/packages/new-portal/sql/oracle/api-create.sql 21 Jan 2002 22:08:19 -0000 1.30 +++ openacs-4/packages/new-portal/sql/oracle/api-create.sql 22 Jan 2002 20:02:39 -0000 1.31 @@ -179,8 +179,13 @@ ); if template_id is null then - select max(theme_id) into v_theme_id from portal_element_themes; + if portal.new.theme_id is null then + select max(theme_id) into v_theme_id from portal_element_themes; + else + v_theme_id := portal.new.theme_id; + end if; + if layout_id is null then select min(layout_id) into v_layout_id from portal_layouts; else 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.5 -r1.6 --- openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 22 Jan 2002 01:31:52 -0000 1.5 +++ openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 22 Jan 2002 20:02:40 -0000 1.6 @@ -14,6 +14,7 @@ template_id => :template_id, portal_template_p => :portal_template_p, default_page_name => :default_page_name, + theme_id => :theme_id, context_id => :context_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.98 -r1.99 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 22 Jan 2002 03:38:56 -0000 1.98 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 22 Jan 2002 20:02:40 -0000 1.99 @@ -97,6 +97,7 @@ {-template_id ""} {-portal_template_p "f"} {-layout_name ""} + {-theme_name ""} {-default_page_name ""} {-context_id ""} user_id @@ -114,6 +115,14 @@ set layout_id [get_layout_id] } + # get the default theme name from param, if no theme given + if {[empty_string_p $theme_name]} { + set theme_name [ad_parameter default_theme_name] + } + + set theme_id [get_theme_id_from_name -theme_name $theme_name] + + return [db_exec_plsql create_new_portal_and_perms {}] } @@ -274,19 +283,15 @@ } { Return a portal or portal template configuration page. All form targets point to file_stub-2. + + XXX BRUTALLY REFACTOR ME @param page_num the page of the portal to config, def 0 @param template_p is this portal a template? @param portal_id @return_url @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 @@ -328,29 +333,19 @@ " - # get the portal. - db_1row portal_select {} -column_array portal # XXXX page support - - # fake some elements for the in the template - set layout_id [get_layout_id -page_id $page_id $portal_id] - - db_foreach get_regions {} { - lappend fake_element_ids($region) $portal_id - } - - set element_list [array get fake_element_ids] - if { $template_p == "f" } { set element_src "[portal::www_path]/place-element" } else { set element_src "[portal::www_path]/template-place-element" } + set portal_name [get_name $portal_id] + set template " - Configuring @portal.name@ + Configuring @portal_name@

Go back

@@ -366,13 +361,54 @@ Add a new page: @page_data@ -

- Configure The Portal's Elements: - - " +

" + + set list_of_page_ids [list $page_id] + + if {[empty_string_p $page_id]} { + set list_of_page_ids [list_pages_tcl_list -portal_id $portal_id] + } + + foreach page_id $list_of_page_ids { + + # get the portal. + db_1row portal_select {} -column_array portal + + # get the numer of elements in this region + set element_count [db_string portal_element_count_select " + select count(*) + from portal_element_map + where page_id = :page_id"] + + + # fake some elements for the in the template + set layout_id [get_layout_id -page_id $page_id $portal_id] + + db_foreach get_regions {} { + lappend fake_element_ids($region) $portal_id + } + + set element_list [array get fake_element_ids] + + if {$element_count == 0} { + append template " + Page $portal(page_name) has no Elements

" + } else { + append template " + Configure Page $portal(page_name)'s Elements +

+ Debug: element_list $element_list, layout_id $layout_id +

+ : + + " + } + } + + # This hack is to work around the acs-templating system set __adp_stub "[get_server_root][www_path]/." set {master_template} \"master\" @@ -617,6 +653,7 @@ } ad_proc -public page_create { + {-layout_name ""} {-pretty_name:required} {-portal_id:required} } { @@ -625,7 +662,13 @@ @return the id of the page @param portal_id } { - set layout_id [get_layout_id] + # get the layout_id + 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 page_create_insert {}] } @@ -750,15 +793,12 @@ set min_region 0 foreach region $region_list { - ns_log notice "aks40 $region / $force_region" if {$force_region == $region} { set min_region $region break } } - ns_log notice "aks40 min region $min_region" - if {$min_region == 0} { # the region asked for was not in the list ns_log error "portal::add_element region $force_region not in layout $layout_id" @@ -1467,4 +1507,19 @@ } } + ad_proc -public get_theme_id_from_name { + {-theme_name:required} + } { + self explanatory + } { + if { [db_0or1row get_theme_id_from_name_select {} ]} { + return $theme_id + } else { + ns_log error "portal::get_theme_id_from_name_select bad theme_id!" + ad_return_complaint 1 "portal::get_theme_id_from_name_select bad theme_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.9 -r1.10 --- openacs-4/packages/new-portal/tcl/portal-procs.xql 22 Jan 2002 01:31:52 -0000 1.9 +++ openacs-4/packages/new-portal/tcl/portal-procs.xql 22 Jan 2002 20:02:40 -0000 1.10 @@ -81,12 +81,11 @@ - 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 + select p.name, p.portal_id, pl.filename as template, pp.pretty_name as page_name + from portals p, portal_layouts pl, portal_pages pp + where pp.portal_id = :portal_id + and pp.page_id = :page_id + and pp.portal_id = p.portal_id and pl.layout_id = pp.layout_id @@ -533,5 +532,12 @@ + + + select theme_id from portal_element_themes where name = :theme_name + + + + Index: openacs-4/packages/new-portal/www/place-element.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/place-element.adp,v diff -u -r1.20 -r1.21 --- openacs-4/packages/new-portal/www/place-element.adp 18 Dec 2001 21:28:09 -0000 1.20 +++ openacs-4/packages/new-portal/www/place-element.adp 22 Jan 2002 20:02:40 -0000 1.21 @@ -52,6 +52,12 @@ + +
+@other_page_html@ + +
+ 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.24 -r1.25 --- openacs-4/packages/new-portal/www/place-element.tcl 21 Jan 2002 22:08:19 -0000 1.24 +++ openacs-4/packages/new-portal/www/place-element.tcl 22 Jan 2002 20:02:40 -0000 1.25 @@ -1,6 +1,6 @@ # www/place-element.tcl ad_page_contract { - Place elements. + Place elements. IMPROVE ME @author Arjun Sanyal (arjun@openforce.net) @creation-date 9/28/2001 @@ -25,11 +25,11 @@ db_foreach select_elements_by_region { select element_id, pem.pretty_name as name, pem.sort_key, state - from portal_element_map pem, portal_current_page pcp + from portal_element_map pem, portal_pages pp where - pcp.portal_id = :portal_id - and pcp.page_id = :page_id - and pem.page_id = pcp.page_id + pp.portal_id = :portal_id + and pp.page_id = :page_id + and pem.page_id = pp.page_id and region = :region and state != 'hidden' order by sort_key } { @@ -62,11 +62,11 @@ db_foreach hidden_elements { select element_id, name - from portal_element_map pem, portal_current_page pcp + from portal_element_map pem, portal_pages pp where - pcp.portal_id = :portal_id - and pcp.page_id = :page_id - and pcp.page_id = pem.page_id + pp.portal_id = :portal_id + and pp.page_id = :page_id + and pp.page_id = pem.page_id and pem.state = 'hidden' order by name } { @@ -75,7 +75,20 @@ } -set dir "[portal::mount_point]/place-element-components" +# moving to other pages +set other_page_avail_p 0 +set other_page_html "