Index: openacs-4/packages/edit-this-page/tcl/etp-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-init.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/edit-this-page/tcl/etp-init.tcl 10 Sep 2002 22:22:52 -0000 1.4 +++ openacs-4/packages/edit-this-page/tcl/etp-init.tcl 4 Apr 2003 15:20:28 -0000 1.5 @@ -30,14 +30,14 @@ etp::define_application default { index_template packages/edit-this-page/templates/article-index - index_content_type content_revision + index_content_type etp_page_revision index_object_name "subtopic" index_title_attr_name "Title" index_description_attr_name "Description" index_content_attr_name "Content" content_template packages/edit-this-page/templates/article-content - content_content_type content_revision + content_content_type etp_page_revision content_object_name "page" content_title_attr_name "Title" content_description_attr_name "Description" Index: openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql 10 Dec 2001 19:02:02 -0000 1.9 +++ openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql 4 Apr 2003 15:20:28 -0000 1.10 @@ -2,13 +2,19 @@ postgresql7.1 + + +select site_node__url(node_id) as package_url from site_nodes where object_id = (select package_id from cr_folders where folder_id= (select parent_id from cr_items where latest_revision = :object_id)) + + + select acs_object_type__create_type ( :content_type, :pretty_name, :pretty_plural, - 'content_revision', + 'etp_page_revision', :content_type, :content_type, null, 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 -r1.9 --- openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 10 Sep 2002 22:22:52 -0000 1.8 +++ openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 4 Apr 2003 15:20:28 -0000 1.9 @@ -80,8 +80,12 @@ if {![info exists content_types]} { array set content_types [list] } - + + # probably should use content_type functions instead + # DaveB + # anyway we make sure new types are children of etp_page_revision # ensure an entry in acs_object_types + if { ![db_0or1row object_type_exists ""] } { db_exec_plsql object_type_create "" } @@ -111,6 +115,10 @@ } set content_types($content_type) $attribute_metadata_with_ids + # add service contract implementations for content_type if necessary + # creates search service contract implementation if it doesn't + # already exist + etp::create_search_impl -content_type $content_type } @@ -240,6 +248,7 @@
  • revision_id
  • title
  • context_bar +
  • context
  • description
  • publish_date
  • content @@ -312,8 +321,10 @@ # add in the context bar if { $name == "index" } { set cb [ad_context_bar] + set context [list] } else { set cb [ad_context_bar $pa(title)] + set context [list $pa(title)] } # remove the "Your Workspace" link, so we can cache this context # bar and it will work for everyone @@ -324,6 +335,7 @@ set cb [lreplace $cb 0 1] } set pa(context_bar) $cb + set pa(context) $context return [array get pa] } @@ -337,14 +349,13 @@ } { set extended_attributes "" if { ![empty_string_p $content_type] && - ![string equal $content_type "content_revision"] } { + ![string equal $content_type "etp_page_revision"] } { variable content_types set attributes $content_types($content_type) foreach attribute_desc $attributes { set lookup_sql [etp::get_attribute_lookup_sql $attribute_desc] - ns_log Error "LU: $lookup_sql" append extended_attributes ",\n $lookup_sql" } } @@ -460,14 +471,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 @@ -486,12 +496,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 Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/edit-this-page/tcl/etp-sc-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/edit-this-page/tcl/etp-sc-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/edit-this-page/tcl/etp-sc-procs.xql'. Fisheye: No comparison available. Pass `N' to diff?