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.13 -r1.13.6.1 --- openacs-4/packages/dotlrn/www/community-edit-2.tcl 3 Jul 2003 23:03:38 -0000 1.13 +++ openacs-4/packages/dotlrn/www/community-edit-2.tcl 6 Aug 2004 18:41:54 -0000 1.13.6.1 @@ -62,6 +62,10 @@ set client_filename $header_img } +# title of CR item. This must be unique because all uploaded logos are stored +# in the CR root folder (-100). +set logo_name "community_logo_$community_id" + if { ![empty_string_p [ad_parameter MaximumFileSize]] && $tmp_size > 0 && $tmp_size > [ad_parameter MaximumFileSize] } { @@ -76,22 +80,40 @@ # import the content now, so that we can spit it out in the preview db_transaction { - # We will store the image in the communities' shared folder. - set parent_id [dotlrn_fs::get_community_shared_folder -community_id $community_id] - + # We will store the image in the topmost root folder + set parent_id [db_string get_root_folder {}] - # the last param "object name" is unused - set revision_id [cr_import_content \ - -title $title \ - -description "[_ dotlrn.groups_icon]" \ - -image_only \ - $parent_id \ - $tmp_filename \ - $tmp_size \ - $mime_type \ - "$client_filename-$title" - ] + # if this is a re-upload, pass along the item_id + set item_id [db_string get_item_id "" -default ""] + if { ![empty_string_p $item_id] } { + # the last param is the title of the new file in the CR. + set revision_id [cr_import_content \ + -title $title \ + -description "group's icon" \ + -image_only \ + -item_id $item_id \ + $parent_id \ + $tmp_filename \ + $tmp_size \ + $mime_type \ + $logo_name + ] + } else { + # the last param is the title of the new file in the CR. + set revision_id [cr_import_content \ + -title $title \ + -description "group's icon" \ + -image_only \ + $parent_id \ + $tmp_filename \ + $tmp_size \ + $mime_type \ + $logo_name + ] + } + cr_set_imported_content_live $mime_type $revision_id + ns_log notice "aks1: new revision_id $revision_id" } on_error { Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-edit-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-edit-revert-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-edit-revert-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/community-edit-revert.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-revert.tcl,v diff -u -r1.6 -r1.6.6.1 --- openacs-4/packages/dotlrn/www/community-edit-revert.tcl 23 Oct 2002 12:38:39 -0000 1.6 +++ openacs-4/packages/dotlrn/www/community-edit-revert.tcl 6 Aug 2004 18:41:54 -0000 1.6.6.1 @@ -45,6 +45,13 @@ -community_id $community_id } +# either way, remove the logo from the CR +set parent_id [db_string get_root_folder {}] +set logo_name "community_logo_$community_id" +set item_id [db_string get_item_id "" -default ""] +if { ![empty_string_p $item_id] } { + db_exec_plsql delete_cr_item "" +} ad_returnredirect $referer Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-edit-revert.xql'. Fisheye: No comparison available. Pass `N' to diff?