Index: openacs-4/packages/edit-this-page/tcl/etp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs.tcl,v diff -u -r1.8.2.2 -r1.8.2.3 --- openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 21 Feb 2003 10:53:40 -0000 1.8.2.2 +++ openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 16 Mar 2003 15:47:24 -0000 1.8.2.3 @@ -472,14 +472,13 @@ return "$lookup_sql as $attribute_name" } -ad_proc -public get_etp_link { } { +ad_proc -public get_etp_url { } { @author Luke Pond @creation-date 2001-05-31 If the current package is an instance of Edit This Page, and the user has write access, returns - the html "Edit This Page" link which should be - displayed at the bottom of the page. + the URL to where you can edit the current page.

This may be called either from your master template, or from individual pages that are used within an ETP @@ -498,12 +497,35 @@ set name [etp::get_name] if { ![regexp "^etp" $name] } { - return "Edit This Page\n" + return "etp?[export_vars { name }]" } } return "" } +ad_proc -public get_etp_link { } { + @author Luke Pond + @creation-date 2001-05-31 + + If the current package is an instance of Edit This Page, + and the user has write access, returns + the html "Edit This Page" link which should be + displayed at the bottom of the page. +

+ This may be called either from your master template, + or from individual pages that are used within an ETP + package instance. It incurs 1 database hit to + do the permissions check. The package type is acquired + via the in-memory copy of the site-nodes layout. + +} { + set etp_url [get_etp_url] + if { ![empty_string_p $etp_url] } { + return "Edit This Page\n" + } + return {} +} + ad_proc -public get_name { } { @author Luke Pond @creation-date 2001-06-10