Index: openacs-4/contrib/packages/portal/tcl/element-parameter-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-parameter-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/tcl/element-parameter-procs.xql 25 Oct 2002 21:29:17 -0000 1.1 +++ openacs-4/contrib/packages/portal/tcl/element-parameter-procs.xql 8 Jan 2004 02:12:19 -0000 1.2 @@ -44,7 +44,7 @@ - + update portal_element_parameters set value = :value Index: openacs-4/contrib/packages/portal/tcl/element-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/tcl/element-procs-oracle.xql 25 Oct 2002 21:29:17 -0000 1.1 +++ openacs-4/contrib/packages/portal/tcl/element-procs-oracle.xql 8 Jan 2004 02:12:19 -0000 1.2 @@ -23,6 +23,26 @@ + + + insert into portal_element_parameters + (parameter_id, element_id, config_required_p, configured_p, key, value) + select portal_seq.nextval, :element_id, config_required_p, configured_p, key, value + from portal_datasource_parameters + where datasource_id = :datasource_id + + + + + + insert into portal_element_parameters + (parameter_id, element_id, config_required_p, configured_p, key, value) + select portal_seq.nextval, :element_id, config_required_p, configured_p, key, value + from portal_element_parameters + where element_id = :template_element_id + + + select sort_key as other_sort_key, Index: openacs-4/contrib/packages/portal/tcl/element-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/tcl/element-procs-postgresql.xql 25 Oct 2002 21:29:17 -0000 1.1 +++ openacs-4/contrib/packages/portal/tcl/element-procs-postgresql.xql 8 Jan 2004 02:12:19 -0000 1.2 @@ -23,6 +23,26 @@ + + + insert into portal_element_parameters + (parameter_id, element_id, config_required_p, configured_p, key, value) + select nextval('portal_seq'), :element_id, config_required_p, configured_p, key, value + from portal_datasource_parameters + where datasource_id = :datasource_id + + + + + + insert into portal_element_parameters + (parameter_id, element_id, config_required_p, configured_p, key, value) + select nextval('portal_seq'), :element_id, config_required_p, configured_p, key, value + from portal_element_parameters + where element_id = :template_element_id + + + select sort_key as other_sort_key, Index: openacs-4/contrib/packages/portal/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/tcl/element-procs.tcl 23 Sep 2003 04:09:50 -0000 1.2 +++ openacs-4/contrib/packages/portal/tcl/element-procs.tcl 8 Jan 2004 02:12:19 -0000 1.3 @@ -293,7 +293,8 @@ move a portal element between regions } { - set region [get_region -element_id $element_id] + array set element [get -element_id $element_id] + template::util::array_to_vars element if {[string equal $direction left]} { incr region -1 @@ -503,7 +504,7 @@ } - ad_proc -public add_element_parameters { + ad_proc -public add_parameters { {-portal_id:required} {-portlet_name:required} {-value:required} @@ -530,26 +531,26 @@ @param extra_params a list of extra key/value pairs to insert or append } { - if {[empty_string_p $param_action]} { - set param_action "overwrite" - } - # Find out if this portlet already exists in this page set element_id_list [get_list_from_datasource_name -portal_id $portal_id -datasource_name $portlet_name] if {[llength $element_id_list] == 0} { + + set page_id [portal::page::get_id -portal_id $portal_id -page_name $page_name] + + if {[string equal "" $force_region]} { + set force_region [choose_region -page_id $page_id] + } + db_transaction { # Tell portal to add this element to the page - set element_id [add_element \ - -portal_id $portal_id \ - -portlet_name $portlet_name \ - -pretty_name $pretty_name \ - -page_name $page_name \ - -force_region $force_region - ] + set element_id [new \ + -page_id $page_id \ + -region $force_region \ + -datasource_name $portlet_name \ + -name $pretty_name] - # There is already a value for the param which is overwritten portal::element::parameter::set_value -element_id $element_id -key $key -value $value if {![empty_string_p $extra_params]} { @@ -571,7 +572,7 @@ } elseif {[string equal $param_action "overwrite"]} { portal::element::parameter::set_value -element_id $element_id -key $key -value $value } else { - error "portal::add_element_parameters error: bad param action! $param_action 1" + error "portal::add_parameters error: bad param action! $param_action 1" } if {![empty_string_p $extra_params]} { @@ -588,7 +589,7 @@ -key [lindex $extra_params $x] \ -value [lindex $extra_params [expr $x + 1]] } else { - error "portal::add_element_parameters error: bad param action! $param_action 2" + error "portal::add_parameters error: bad param action! $param_action 2" } } } @@ -597,7 +598,7 @@ return $element_id } - ad_proc -public remove_element_parameters { + ad_proc -public remove_parameters { {-portal_id:required} {-portlet_name:required} {-value:required} Index: openacs-4/contrib/packages/portal/tcl/element-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/tcl/element-procs.xql 25 Oct 2002 21:29:17 -0000 1.1 +++ openacs-4/contrib/packages/portal/tcl/element-procs.xql 8 Jan 2004 02:12:19 -0000 1.2 @@ -28,16 +28,6 @@ - - - insert into portal_element_parameters - (parameter_id, element_id, config_required_p, configured_p, key, value) - select portal_seq.nextval, :element_id, config_required_p, configured_p, key, value - from portal_datasource_parameters - where datasource_id = :datasource_id - - - insert into portal_elements @@ -48,16 +38,6 @@ - - - insert into portal_element_parameters - (parameter_id, element_id, config_required_p, configured_p, key, value) - select portal_seq.nextval, :element_id, config_required_p, configured_p, key, value - from portal_element_parameters - where element_id = :template_element_id - - - delete Index: openacs-4/contrib/packages/portal/tcl/page-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/page-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/tcl/page-procs.tcl 3 Jan 2004 01:42:57 -0000 1.2 +++ openacs-4/contrib/packages/portal/tcl/page-procs.tcl 8 Jan 2004 02:12:19 -0000 1.3 @@ -30,18 +30,18 @@ ad_proc -public new { {-portal_id:required} {-name:required} - {-layout_name ""} + {-layout_name 2_column} } { - create a new page and associate it with the given portal_id + Create a new page and associate it with the given portal_id } { set layout_id [portal::layout::get_id_from_name -name $layout_name] - set extra_vars [ns_set create] - ns_set put $extra_vars portal_id $portal_id - ns_set put $extra_vars name $name - ns_set put $extra_vars layout_id $layout_id + set var_list [list \ + [list portal_id $portal_id] \ + [list name $name] \ + [list layout_id $layout_id]] - return [package_instantiate_object -extra_vars $extra_vars portal_page] + return [package_instantiate_object -var_list $var_list portal_page] } ad_proc -public delete { Index: openacs-4/contrib/packages/portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 3 Jan 2004 01:42:57 -0000 1.2 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 8 Jan 2004 02:12:19 -0000 1.3 @@ -155,7 +155,7 @@ set the fields of a portal } { array set portal_array $portal - template::util::array_to_vars portal + template::util::array_to_vars portal_array db_dml update_portal {} util_memoize_flush "portal::get_not_cached -portal_id $portal_id" Index: openacs-4/contrib/packages/portal/tcl/theme-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/theme-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/tcl/theme-procs.tcl 25 Oct 2002 21:29:17 -0000 1.1 +++ openacs-4/contrib/packages/portal/tcl/theme-procs.tcl 8 Jan 2004 02:12:19 -0000 1.2 @@ -46,10 +46,6 @@ returns a list of all the themes in the system as ns_sets with keys being: theme_id, name, description } { - return [util_memoize "portal::theme::get_list_not_cached"] - } - - ad_proc -private get_list_not_cached {} { return [db_list_of_ns_sets select_theme_list {}] } Index: openacs-4/contrib/packages/portal/tcl/theme-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/theme-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/tcl/theme-procs.xql 25 Oct 2002 21:29:17 -0000 1.1 +++ openacs-4/contrib/packages/portal/tcl/theme-procs.xql 8 Jan 2004 02:12:19 -0000 1.2 @@ -10,7 +10,7 @@ - + select theme_id, name,