Index: openacs-4/packages/dotlrn/www/community-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-2.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/dotlrn/www/community-edit-2.tcl 9 Nov 2008 23:29:23 -0000 1.17 +++ openacs-4/packages/dotlrn/www/community-edit-2.tcl 3 Apr 2009 15:07:13 -0000 1.18 @@ -35,7 +35,13 @@ set creation_ip [ad_conn peeraddr] set community_id [dotlrn_community::get_community_id] dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id -set page_title [_ dotlrn.Preview] + +set doc(title) [_ dotlrn.Preview] +set context [list \ + [list one-community-admin [_ dotlrn.Admin]] \ + [list community-edit [_ dotlrn.Edit_Properties]] \ + $doc(title)] + set header_text [dotlrn_community::get_community_header_name $community_id] # Image stuff @@ -89,6 +95,12 @@ # if it's a new upload, create the item if { [empty_string_p $item_id]} { set item_id [content::item::new -name $logo_name -parent_id $parent_id -content_type image] + + # since it's just the header logo, which can't be accessed outside of + # the community anyway, let everyone have access to see it. That way + # it won't cause any trouble later on when we try to implement + # try-before-you-buy for non-members. + permission::grant -party_id [acs_magic_object registered_users] -object_id $item_id -privilege read } # the last param is the title of the new file in the CR. @@ -105,15 +117,7 @@ ] content::item::set_live_revision -revision_id $revision_id - # since it's just the header logo, which can't be accessed outside of - # the community anyway, let everyone have access to see it. That way - # it won't cause any trouble later on when we try to implement - # try-before-you-buy for non-members. - permission::grant -party_id [acs_magic_object registered_users] -object_id $revision_id -privilege read - - ns_log notice "aks1: new revision_id $revision_id" - } on_error { # most likely a duplicate name, double click, etc. ad_return_complaint 1 " @@ -190,7 +194,8 @@ set header_url "/resources/dotlrn/logo-$scope_name.gif" } else { - set header_url "[dotlrn_community::get_community_url $community_id]/file-storage/download/?version_id=$revision_id" + set item_id [content::revision::item_id -revision_id $revision_id] + set header_url "[subsite::get_url]image/$item_id" } @@ -268,4 +273,3 @@ } ad_return_template -