Index: openacs-4/contrib/packages/portal/lib/tabbed-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/tabbed-master.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/portal/lib/tabbed-master.tcl 19 Mar 2004 00:41:22 -0000 1.4 +++ openacs-4/contrib/packages/portal/lib/tabbed-master.tcl 21 Mar 2004 02:39:56 -0000 1.5 @@ -25,6 +25,7 @@ set portal_url [lindex [site_node::get_children -node_id $subsite_node_id -package_key portal] 0] set package_id [site_node::get_object_id -node_id [site_node::get_node_id -url $portal_url]] +set package_node_id [site_node::get_node_id_from_object_id -object_id $package_id] set portal_page_p 0 set user_portal_id [portal::get_user_portal_id -package_id $package_id] @@ -56,8 +57,11 @@ array set site_node [site_node::get_from_url \ -url [ad_conn package_url] \ -exact] +set foo [site_node::get_from_url \ + -url [ad_conn package_url] \ + -exact] -if { $site_node(parent_id) == $package_id } { +if { $site_node(parent_id) == $package_node_id } { set application $site_node(instance_name) } elseif {$site_node(object_id) == $package_id } { set portal_page_p 1 Index: openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-element.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-element.adp,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-element.adp 14 Mar 2004 03:38:25 -0000 1.2 +++ openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-element.adp 21 Mar 2004 02:39:57 -0000 1.3 @@ -17,13 +17,5 @@ # %> - - -@element.name;noquote@ -@element.resource_dir;noquote@ -@element.element_id;noquote@ -@element.shadeable_p;noquote@ -@element.shaded_p;noquote@ -@element.hideable_p;noquote@ - +@element.name;noquote@ Index: openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.adp,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.adp 14 Mar 2004 03:38:25 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.adp 21 Mar 2004 02:39:57 -0000 1.2 @@ -1,9 +1,14 @@ - - - + + @page.name@ + f + f + f + + + Index: openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.tcl 14 Mar 2004 03:38:25 -0000 1.1 +++ openacs-4/contrib/packages/portal/lib/render-styles/all-in-one/render-page.tcl 21 Mar 2004 02:39:57 -0000 1.2 @@ -32,4 +32,11 @@ } array set page [portal::page::get_render_data -render_style all-in-one -page_id $page_id] + +# This is a kludge for the admin portal ... themes should be a subsite not portal thin +# anyway. + +array set theme [portal::theme::get \ + -theme_id [portal::get_theme_id -portal_id [portal::get_user_portal_id]]] + set elements_exist_p [expr {[llength $page(element_list)] > 0}] Index: openacs-4/contrib/packages/portal/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/apm-callback-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/contrib/packages/portal/tcl/apm-callback-procs.tcl 18 Mar 2004 18:14:14 -0000 1.8 +++ openacs-4/contrib/packages/portal/tcl/apm-callback-procs.tcl 21 Mar 2004 02:39:57 -0000 1.9 @@ -28,7 +28,7 @@ set var_list { {name 1_column} {description "One column"} - {filename layouts/simple1} + {filename /packages/portal/lib/layouts/simple1} } set layout_id [package_instantiate_object -var_list $var_list portal_layout] @@ -40,7 +40,7 @@ set var_list { {name 2_column} {description "Two columns"} - {filename layouts/simple2} + {filename /packages/portal/lib/layouts/simple2} } set layout_id [package_instantiate_object -var_list $var_list portal_layout] @@ -57,7 +57,7 @@ set var_list { {name 3_column} {description "Three columns"} - {filename layouts/simple3} + {filename /packages/portal/lib/layouts/simple3} } set layout_id [package_instantiate_object -var_list $var_list portal_layout] @@ -81,23 +81,23 @@ set var_list { {name default} {description "Default OpenACS Theme"} - {filename themes/standard-theme} + {filename /packages/portal/lib/themes/standard-theme} {resource_dir /resources/portal/themes/standard-theme} } package_instantiate_object -var_list $var_list portal_theme set var_list { {name blank} {description "No graphics"} - {filename themes/nada-theme} + {filename /packages/portal/lib/themes/nada-theme} {resource_dir /resources/portal/themes/nada-theme} } package_instantiate_object -var_list $var_list portal_theme set var_list { {name deco} {description "An Art Deco Theme"} - {filename themes/deco-theme} + {filename /packages/portal/lib/themes/deco-theme} {resource_dir /resources/portal/themes/deco-theme} } package_instantiate_object -var_list $var_list portal_theme Index: openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl 13 Mar 2004 00:40:26 -0000 1.6 +++ openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl 21 Mar 2004 02:39:57 -0000 1.7 @@ -69,6 +69,7 @@ set datasource(admin_p) f set datasource(shadeable_p) t set datasource(hideable_p) t + set datasource(params) {} array set datasource $spec @@ -94,29 +95,17 @@ foreach {param value} $datasource(params) { - if { ![regexp {^([^ \t:]+)(?::([a-zA-Z0-9_,(|)]*))} \ - $param match param_name flags] } { - ad_return -code error "Parameter name '$param' doesn't have the right format. It must be var\[:flag\[,flag ...\]\]" - } + # set defaults for attributes - these are IGNORED and I (DRB) only left + # them in the datamodel to make re-integration with .LRN ever-so-slightly easy. - # set defaults for attributes set config_required_p f set configured_p f - # now set the parameter flags - foreach flag [split [string tolower $flags] ","] { - switch -exact $flag { - configured { set configured_p t } - config_required { set config_required_p t} - default { ad_return -code error "\"$flag\" is not a legal portal datasource attribute" } - } - } - # and define the parameter set_def_param -datasource_id $datasource_id \ -config_required_p $config_required_p \ -configured_p $configured_p \ - -key $param_name \ + -key $param \ -value $value } Index: openacs-4/contrib/packages/portal/tcl/element-parameter-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-parameter-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/tcl/element-parameter-procs.tcl 12 Mar 2004 04:54:04 -0000 1.2 +++ openacs-4/contrib/packages/portal/tcl/element-parameter-procs.tcl 21 Mar 2004 02:39:57 -0000 1.3 @@ -41,11 +41,11 @@ ad_proc -private delete { {-element_id:required} {-key:required} - {-value} + {-parameter_id} } { removes a value for a parameter or all values for that parameter. } { - if {[info exists $value]} { + if {[info exists $parameter_id]} { db_dml delete_one_parameter_value {} } else { db_dml delete_parameter {} @@ -64,6 +64,7 @@ ad_proc -public set_value { {-element_id:required} {-key:required} + {-parameter_id:required} {-value:required} } { set the value of a parameter 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.3 -r1.4 --- openacs-4/contrib/packages/portal/tcl/element-parameter-procs.xql 12 Mar 2004 04:54:04 -0000 1.3 +++ openacs-4/contrib/packages/portal/tcl/element-parameter-procs.xql 21 Mar 2004 02:39:57 -0000 1.4 @@ -5,14 +5,9 @@ insert into portal_element_parameters - (parameter_id, element_id, configured_p, key, value) - select :parameter_id, :element_id, 't', :key, :value - from dual - where not exists (select parameter_id - from portal_element_parameters - where element_id = :element_id - and key = :key - and value= :value) + (parameter_id, element_id, configured_p, key, value) + values + (:parameter_id, :element_id, 't', :key, :value) @@ -21,8 +16,8 @@ delete from portal_element_parameters where element_id = :element_id - and key = :key - and value = :value + and key = :key + and parameter_id = :parameter_id @@ -31,7 +26,7 @@ delete from portal_element_parameters where element_id = :element_id - and key = :key + and key = :key @@ -40,7 +35,7 @@ select value from portal_element_parameters where element_id = :element_id - and key = :key + and key = :key @@ -49,7 +44,8 @@ update portal_element_parameters set value = :value where element_id = :element_id - and key = :key + and key = :key + and parameter_id = :parameter_id 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.14 -r1.15 --- openacs-4/contrib/packages/portal/tcl/element-procs.tcl 18 Mar 2004 18:14:14 -0000 1.14 +++ openacs-4/contrib/packages/portal/tcl/element-procs.tcl 21 Mar 2004 02:39:57 -0000 1.15 @@ -417,7 +417,7 @@ -portal_id [portal::page::get_portal_id -page_id $element(page_id)] \ ] \ ] - set element(filename) "/packages/portal/lib/$theme(filename)" + set element(filename) "$theme(filename)" set element(resource_dir) "$theme(resource_dir)" if {!$edit_p} { 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.6 -r1.7 --- openacs-4/contrib/packages/portal/tcl/page-procs.tcl 14 Mar 2004 01:16:32 -0000 1.6 +++ openacs-4/contrib/packages/portal/tcl/page-procs.tcl 21 Mar 2004 02:39:57 -0000 1.7 @@ -165,7 +165,7 @@ array set page [get -page_id $page_id] set layout_id [get_layout_id -page_id $page_id] db_1row layout_select {} - set page(layout_filename) "/packages/portal/lib/$layout_filename" + set page(layout_filename) "$layout_filename" set page(element_src) "/packages/portal/lib/render-styles/${render_style}/render-element" db_foreach element_select {} -column_array entry { 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.23 -r1.24 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 19 Mar 2004 00:41:23 -0000 1.23 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 21 Mar 2004 02:39:57 -0000 1.24 @@ -317,8 +317,12 @@ } # get the portal and layout db_1row portal_select {} -column_array portal - set page_id $portal(page_id) set portal(page_src) "/packages/portal/lib/render-styles/${render_style}/render-page" + + # Render the admin page in the theme the admin is accustomed to + if { $portal_id == [get_admin_portal_id] } { + set portal(theme_id) [portal::get_theme_id -portal_id [get_user_portal_id]] + } return [array get portal] } @@ -763,7 +767,7 @@ portal::new \ -name "Portal Administration" \ -owner_id [ad_conn package_id] \ - -theme_name blank \ + -page_list {{"Portal Administration" 2_column}} \ -owner_privileges {} } Index: openacs-4/contrib/packages/portal/www/admin/add-applications-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/www/admin/add-applications-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/portal/www/admin/add-applications-2.tcl 12 Mar 2004 04:54:04 -0000 1.4 +++ openacs-4/contrib/packages/portal/www/admin/add-applications-2.tcl 21 Mar 2004 02:39:57 -0000 1.5 @@ -42,7 +42,7 @@ -state hidden \ -datasource_name $user_datasource] - portal::element::parameter::set_value \ + portal::element::parameter::new \ -element_id $element_id \ -key package_id \ -value $application_id @@ -61,7 +61,7 @@ -portal_id $admin_portal_id \ -datasource_name $admin_datasource] - portal::element::parameter::set_value \ + portal::element::parameter::new \ -element_id $element_id \ -key package_id \ -value $application_id