Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 5 Mar 2002 07:18:40 -0000 1.33 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 6 Mar 2002 05:13:36 -0000 1.34 @@ -87,8 +87,6 @@ set group_calendar_id \ [calendar_create [ad_conn "user_id"] "f" $cal_name] - ns_log notice "aks14 $cal_name: group_calendar_id $group_calendar_id" - # add this element to the portal template. # do this directly, don't use calendar_portlet::add_self_to_page here set portal_template_id \ @@ -104,6 +102,20 @@ portal::set_element_param \ $element_id "calendar_id" $group_calendar_id + # add the "full calendar" portlet to the commnuity's "calendar" page, + # similar to the same thing on a user's wsp. use the get_user_def_page + # func here too + set page_id [portal::get_page_id \ + -portal_id $portal_template_id \ + -page_name [get_user_default_page] \ + ] + + set element_id [calendar_full_portlet::add_self_to_page \ + -page_id $page_id \ + $portal_template_id \ + $group_calendar_id + ] + # Add the admin portlet, too set admin_portal_id \ [dotlrn_community::get_community_admin_portal_id $community_id] Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 5 Mar 2002 07:18:47 -0000 1.34 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 6 Mar 2002 05:13:45 -0000 1.35 @@ -39,6 +39,12 @@ return "My Files" } + ad_proc -public get_community_default_page {} { + return the user default page to add the portlet to + } { + return "File Storage" + } + ad_proc -public add_applet { } { Used for one-time init - must be repeatable! @@ -122,9 +128,19 @@ # set up the DS for the portal template # that's the private folder_id there fs_portlet::make_self_available $pt_id - fs_portlet::add_self_to_page $pt_id $package_id $folder_id - # return the package_id + # add the portlet to the "file storage" page for this comm + set page_id [portal::get_page_id \ + -portal_id $pt_id \ + -page_name [get_community_default_page] \ + ] + + fs_portlet::add_self_to_page \ + -page_id $page_id \ + $pt_id \ + $package_id \ + $folder_id + return $package_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.116 -r1.117 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 21 Feb 2002 19:01:11 -0000 1.116 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 6 Mar 2002 05:14:08 -0000 1.117 @@ -106,6 +106,7 @@ {-theme_name ""} {-default_page_name ""} {-context_id ""} + {-csv_list ""} user_id } { Create a new portal for the passed in user id. @@ -114,6 +115,26 @@ @param user_id @param layout_name optional } { + # if we have a cvs list in the form "page_name1, layout1; + # page_name2, layout2...", we get the required first page_name + # and first page layout from it, overriding any other params + + if {![empty_string_p $csv_list]} { + set page_name_and_layout_list [split $csv_list ";"] + set page_name_list [list] + set layout_name_list [list] + + # seperate name and layout + foreach item $page_name_and_layout_list { + lappend page_name_list [lindex [split $item ","] 0] + lappend layout_name_list [lindex [split $item ","] 1] + } + + set default_page_name [lindex $page_name_list 0] + set layout_name [lindex $layout_name_list 0] + } + + # get the default layout_id - simple2 if {![empty_string_p $layout_name]} { set layout_id [get_layout_id -layout_name $layout_name] @@ -128,8 +149,23 @@ set theme_id [get_theme_id_from_name -theme_name $theme_name] + db_transaction { + # create the portal and the first page + set portal_id [db_exec_plsql create_new_portal_and_perms {}] - return [db_exec_plsql create_new_portal_and_perms {}] + if {![empty_string_p $csv_list]} { + # if there are more pages in the csv_list, create them + 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] + } + } + + } + + + return $portal_id } ad_proc -public delete { @@ -1088,12 +1124,18 @@ # do the callback for the ::show proc # evaulate the datasource. - if { [catch { set element(content) \ - [datasource_call \ - $element(datasource_id) "Show" [list [array get config] ]] } \ - errmsg ] } { - ns_log error "*** portal::render_element show callback Error! ***\n\n $errmsg\n\n" - ad_return_complaint 1 "*** portal::render_element show callback Error! ***
$errmsg\n\n" + if { [catch { set element(content) \ + [datasource_call \ + $element(datasource_id) \ + "Show" \ + [list [array get config]] + ]\ + } \ + errmsg \ + ] \ + } { + ns_log error "aks86 *** portal::render_element show callback Error! ***\n\n $errmsg\n\n" + ad_return_complaint 1 "*** portal::render_element show callback Error! ***
$errmsg\n\n" } # We use the actual pretty name from the DB (ben) @@ -1154,7 +1196,9 @@ $element(datasource_id) "Show" [list [array get config] ]] } \ errmsg ] } { ns_log error "*** portal::render_element show callback Error! ***\n\n $errmsg\n\n" + ad_return -error ad_return_complaint 1 "*** portal::render_element show callback Error! ***
$errmsg\n\n" + } set element(name) \ Index: openacs-4/packages/new-portal/www/render_styles/individual/render-element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/render_styles/individual/render-element.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/new-portal/www/render_styles/individual/render-element.tcl 18 Feb 2002 19:51:24 -0000 1.3 +++ openacs-4/packages/new-portal/www/render_styles/individual/render-element.tcl 6 Mar 2002 05:14:08 -0000 1.4 @@ -10,23 +10,25 @@ region:onevalue } -# get the complete, evaluated element. -# if there's an error, report it. if { [catch {set element_data [portal::evaluate_element $element_id $theme_id] } errmsg ] } { - - ns_log Error "aks18 render-element.tcl (after eval): $errmsg" - if { [ad_parameter show_datasource_errors_p] == 1} { - set element(content) "
-
| ||||||
+
+ |
+