Index: openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp 27 Nov 2007 18:02:10 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp 31 Mar 2009 14:39:45 -0000 1.10 @@ -1,5 +1,5 @@ -#acs-subsite.lt_Edit_comment_for_the_# +doc @context;noquote@ - \ No newline at end of file + Index: openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl 27 Nov 2007 19:29:27 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl 31 Mar 2009 14:39:45 -0000 1.8 @@ -33,15 +33,19 @@ return } -set context [list [list "./" [_ acs-subsite.Your_Portrait]] [_ acs-subsite.edit_comment]] +set doc(title) [_ acs-subsite.Edit_caption] +set context [list \ + [list [ad_pvt_home] [ad_pvt_home_name]] \ + [list "./" [_ acs-subsite.Your_Portrait]] \ + $doc(title)] if { $return_url eq "" } { set return_url [ad_pvt_home] } ad_form -name comment_edit -export {user_id return_url} -form { {description:text(textarea),optional - {label "#acs-subsite.Story_behind_photo#"} + {label "#acs-subsite.Caption#"} {value $description} {html {rows "6" cols "50"}} } Index: openacs-4/packages/acs-subsite/www/user/portrait/erase.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/erase.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/www/user/portrait/erase.adp 27 Nov 2007 20:18:43 -0000 1.8 +++ openacs-4/packages/acs-subsite/www/user/portrait/erase.adp 31 Mar 2009 14:39:45 -0000 1.9 @@ -1,5 +1,5 @@ -#acs-subsite.Erase_Portrait# +doc @context;noquote@ Index: openacs-4/packages/acs-subsite/www/user/portrait/erase.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/erase.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/user/portrait/erase.tcl 27 Nov 2007 20:18:43 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/user/portrait/erase.tcl 31 Mar 2009 14:39:45 -0000 1.7 @@ -13,7 +13,7 @@ set current_user_id [ad_conn user_id] -if {$user_id eq ""} { +if {$user_id eq "" || $user_id eq $current_user_id} { set user_id $current_user_id set admin_p 0 } else { @@ -22,10 +22,17 @@ ad_require_permission $user_id "write" +set doc(title) [_ acs-subsite.Erase] if {$admin_p} { - set context [list [list "./?[export_vars user_id]" [_ acs-subsite.User_Portrait]] [_ acs-subsite.Erase]] + set context [list \ + [list [ad_pvt_home] [ad_pvt_home_name]] \ + [list "./?[export_vars user_id]" [_ acs-subsite.User_Portrait]] \ + $doc(title)] } else { - set context [list [list "./" [_ acs-subsite.Your_Portrait]] [_ acs-subsite.Erase]] + set context [list \ + [list [ad_pvt_home] [ad_pvt_home_name]] \ + [list "./" [_ acs-subsite.Your_Portrait]] \ + $doc(title)] } if { $return_url eq "" } { Index: openacs-4/packages/acs-subsite/www/user/portrait/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/index.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-subsite/www/user/portrait/index.adp 21 Nov 2007 17:01:55 -0000 1.11 +++ openacs-4/packages/acs-subsite/www/user/portrait/index.adp 31 Mar 2009 14:39:45 -0000 1.12 @@ -1,5 +1,5 @@ -#acs-subsite.lt_Portrait_of_first_last# +doc @context;noquote@ @@ -10,12 +10,12 @@
-Portrait of @first_names@ @last_name@ +@doc.title@
@@ -24,10 +24,10 @@ #acs-subsite.Options#: @@ -58,9 +58,3 @@ - - - - - - Index: openacs-4/packages/acs-subsite/www/user/portrait/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/index.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/www/user/portrait/index.tcl 10 Jan 2007 21:22:11 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/user/portrait/index.tcl 31 Mar 2009 14:39:45 -0000 1.10 @@ -71,14 +71,14 @@ set portrait_p 1 } -if {$portrait_p} { - if {$admin_p} { - set context [list [list [ad_pvt_home] "Your Account"] "Your Portrait"] - } else { - set context [list [list [ad_pvt_home] "User's Account"] "User's Portrait"] - } +if { $admin_p } { + set doc(title) [_ acs-subsite.Your_Portrait] } else { - set context [list "No Portrait"] + set doc(title) [_ acs-subsite.lt_Portrait_of_first_last] +} +set context [list [list [ad_pvt_home] [ad_pvt_home_name]] $doc(title)] + +if {! $portrait_p } { set return_code "no_portrait" ad_return_template return Index: openacs-4/packages/acs-subsite/www/user/portrait/upload.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/upload.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-subsite/www/user/portrait/upload.adp 27 Nov 2007 19:29:27 -0000 1.10 +++ openacs-4/packages/acs-subsite/www/user/portrait/upload.adp 31 Mar 2009 14:39:45 -0000 1.11 @@ -1,18 +1,10 @@ -#acs-subsite.Upload_Portrait# +doc @context;noquote@

#acs-subsite.lt_How_would_you_like_the#

#acs-subsite.lt_Upload_your_favorite#

- -
-#acs-subsite.Your_Portrait# -
-(#acs-subsite.Erase_Portrait#) -
-
- Index: openacs-4/packages/acs-subsite/www/user/portrait/upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/upload.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-subsite/www/user/portrait/upload.tcl 6 Jan 2009 02:25:34 -0000 1.13 +++ openacs-4/packages/acs-subsite/www/user/portrait/upload.tcl 31 Mar 2009 14:39:45 -0000 1.14 @@ -17,11 +17,12 @@ set portrait_p [db_0or1row "checkportrait" {}] - if { $portrait_p } { - set story [db_string "getstory" {}] + set doc(title) [_ acs-subsite.upload_a_replacement_por] + set description [db_string "getstory" {}] } else { - set story "" + set doc(title) [_ acs-subsite.Upload_Portrait] + set description "" set revision_id "" } @@ -45,9 +46,14 @@ } if {$admin_p} { - set context [list [list "./?[export_vars user_id]" [_ acs-subsite.User_Portrait]] [_ acs-subsite.Upload_Portrait]] + set context [list \ + [list "./?[export_vars user_id]" [_ acs-subsite.User_Portrait]] \ + $doc(title)] } else { - set context [list [list "./?[export_vars return_url]" [_ acs-subsite.Your_Portrait]] [_ acs-subsite.Upload_Portrait]] + set context [list \ + [list [ad_pvt_home] [ad_pvt_home_name]] \ + [list "./?[export_vars return_url]" [_ acs-subsite.Your_Portrait]] \ + $doc(title)] } set help_text [_ acs-subsite.lt_Use_the_Browse_button] @@ -60,18 +66,17 @@ } if { $portrait_p } { - set description [db_string getstory {}] ad_form -extend -name "portrait_upload" -form { {portrait_comment:text(textarea),optional - {label "#acs-subsite.Story_Behind_Photo#"} + {label "#acs-subsite.Caption#"} {value $description} {html {rows 6 cols 50}} } } } else { ad_form -extend -name "portrait_upload" -form { {portrait_comment:text(textarea),optional - {label "#acs-subsite.Story_Behind_Photo#"} + {label "#acs-subsite.Caption#"} {html {rows 6 cols 50}} } } @@ -114,6 +119,10 @@ set n_bytes [file size $tmp_filename] + # Sizes we want for the portrait + set sizename_list {avatar thumbnail} + array set resized_portrait [list] + # strip off the C:\directories... crud and just get the file name if {![regexp {([^/\\]+)$} $upload_file match client_filename]} { # couldn't find a match @@ -128,9 +137,12 @@ if { $item_id eq ""} { # The user doesn't have a portrait relation yet set item_id [content::item::new -name "portrait-of-user-$user_id" -parent_id $user_id -content_type image] - set resized_item_id "" } else { - set resized_item_id [image::get_resized_item_id -item_id $item_id -size_name "thumbnail"] + foreach sizename $sizename_list { + set resized_portrait($sizename) [image::get_resized_item_id \ + -item_id $item_id \ + -size_name $sizename] + } } # Load the file into the revision @@ -149,12 +161,14 @@ content::item::set_live_revision -revision_id $revision_id - if {$resized_item_id ne ""} { - # Delete the item - content::item::delete -item_id $resized_item_id + foreach sizename $sizename_list { + if { $resized_portrait($sizename) ne "" } { + # Delete the item + content::item::delete -item_id $resized_portrait($sizename) - # Resize the item - image::resize -item_id $item_id -size_name "thumbnail" + # Resize the item + image::resize -item_id $item_id -size_name $sizename + } } # Only create the new relationship if there does not exist one already