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.10 -r1.11 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 29 Jan 2004 03:50:59 -0000 1.10 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 1 Feb 2004 03:08:11 -0000 1.11 @@ -61,6 +61,7 @@ ad_proc -public new { {-party_id:required} + {-package_id:required} {-name Untitled} {-template_id ""} {-context_id ""} @@ -71,6 +72,7 @@ the page_list. @party_id The party which owns the new portal + @package_id The package_id of this portal package instance @name The name of the portal @template_id The template used to render the portal if the default is not to be used @@ -84,12 +86,20 @@ } { db_transaction { - set var_list [list \ - [list name $name] \ - [list template_id $template_id] \ - [list context_id $context_id] \ - [list party_id $party_id]] +# set var_list [list \ +# [list name $name] \ +# [list template_id $template_id] \ +# [list context_id $context_id] \ +# [list party_id $party_id] \ +# [list package_id $package_id]] + set var_list [subst { + {name $name} + {template_id $template_id} + {context_id $context_id} + {party_id $party_id} + {package_id $package_id}}] + set portal_id [package_instantiate_object -var_list $var_list portal] foreach privilege $party_privileges { @@ -138,6 +148,7 @@ ad_proc -public get_portal_id { {-party_id:required} + {-package_id:required} } { Get the portal_id for a party. I (DRB) am not going to bother caching this for the time being ... @@ -202,6 +213,18 @@ return $portal(template_id) } + ad_proc -public get_master_template_id { + -package_id:required + } { + Get the master template id, i.e. the portal used to create all other + portals, for the given portal instance. + + @param package_id The package_id of the portal instance we're interested in + @return The portal_id of the master portal template for the given portal instance + } { + return [get_portal_id -party_id "" -package_id $package_id] + } + ad_proc -public get_page_count { {-portal_id:required} } {