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.12 -r1.13 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 3 Oct 2001 16:18:18 -0000 1.12 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 3 Oct 2001 17:49:43 -0000 1.13 @@ -82,8 +82,8 @@ ad_proc -public portal_add_element { portal_id ds_name } { Add an element anywhere to a portal given a datasource name - @return 1 on success - @param user_id + @return the id of the new element + @param portal_id ds_name @author Arjun Sanyal (arjun@openforce.net) @creation-date 9/28/2001 } { @@ -141,10 +141,54 @@ } # The caller must now set the necessary params or else! + return $new_element_id +} + + +ad_proc -public portal_set_element_param { element_id key value } { + Set an element param + + @return 1 on success + @param element_id + @param key + @param value + @author Arjun Sanyal (arjun@openforce.net) + @creation-date 9/28/2001 +} { + + db_dml upadate_parms " + update portal_element_parameters set value = :value + where element_id = :element_id and + key = :key" + return 1 + } +ad_proc -public portal_get_element_param { element_id key } { + Get an element param. Returns the value of the param. + + @return the value of the param + @param element_id + @param key + @author Arjun Sanyal (arjun@openforce.net) + @creation-date 9/28/2001 +} { + + if { [db_0or1row get_parm " + select value + from portal_element_parameters + where element_id = :element_id and + key = :key"] } { + return $value + } else { + ad_return_complaint 1 "portal_get_element_param: Invalid element_id and/or key given." + ad_script_abort + } +} + + ad_proc -public portal_render_portal { portal_id } { Get a portal by id. If it's not found, say so. @@ -186,27 +230,21 @@ ad_script_abort } - set __adp_stub "/web/arjun/openacs-4/packages/new-portal/www/" + set __adp_stub "[full_portal_path]/www/" set code [template::adp_compile -string $template] - ns_log Notice "AKS19 code: $code" set output [template::adp_eval code] - ns_log Notice "AKS19 out: $output" - if {![empty_string_p $output]} { set mime_type [template::get_mime_type] set header_preamble [template::get_mime_header_preamble $mime_type] ns_return 200 $mime_type "$header_preamble $output" } - - return - } ad_proc -public portal_setup_element_src { portal_id } { - Setup the element src - hack + Setup the element src @return @param element_id @@ -215,12 +253,11 @@ @creation-date Sept 2001 } { return "[portal_path]/www/render-element" - } ad_proc -public portal_setup_element_list { portal_id } { - Setup the element list - hack + Setup the element list @return @param element_id