Index: openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl,v diff -u -r1.1.1.1.14.1 -r1.1.1.1.14.2 --- openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl 28 Sep 2005 18:18:20 -0000 1.1.1.1.14.1 +++ openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl 5 Oct 2005 17:37:44 -0000 1.1.1.1.14.2 @@ -105,3 +105,14 @@ -parameter $parameter \ -value $value } + +ad_proc -public -callback subsite::url { + -package_id:required + -object_id:required + {-type ""} +} { + Callback for creating a URL for an object_id. THis is usually called in /o.vuh, but + you could think of scenarios where using this hook makes sense as well. + + The type let's you define what kind of URL you are looking for (e.g. admin/edit/display) +} - Index: openacs-4/packages/acs-subsite/www/o.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/o.vuh,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/acs-subsite/www/o.vuh 8 Feb 2005 08:29:11 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/o.vuh 5 Oct 2005 17:37:45 -0000 1.3.2.1 @@ -60,7 +60,15 @@ return } -set page_url [acs_sc::invoke -contract FtsContentProvider -operation url -impl $object_type -call_args [list $object_id]] +# Try to retrieve the page url using a callback that makes use of upvar + +set page_url [lindex [callback -catch -impl $object_type subsite::url -object_id $object_id -package_id $package_id -type "display"] 0] + +# If this did not work, try again with the Service contract +if {[empty_string_p $page_url]} { + set page_url [acs_sc::invoke -contract FtsContentProvider -operation url -impl $object_type -call_args [list $object_id]] +} + if {![empty_string_p $page_url]} { ad_returnredirect $page_url$anchor } else {