Index: openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl 27 Jun 2015 20:17:07 -0000 1.14 +++ openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl 7 Aug 2017 23:47:58 -0000 1.15 @@ -17,7 +17,7 @@ @param level Change to this level } { db_transaction { - db_dml update_users { } + db_dml update_users {} } } @@ -26,7 +26,7 @@ } { Returns the priv_email field of the user from the users table. } { - set priv_level [db_string get_private_email { }] + set priv_level [db_string get_private_email {}] if {$priv_level eq "5"} { set priv_level [parameter::get_from_package_key -package_key "acs-subsite" \ -parameter "PrivateEmailLevelP" -default 4] @@ -40,7 +40,7 @@ {-bgcolor "" } {-transparent "" } } { - Returns the email in differnet diferent ways (text level 4, image or text and image level 3, link level 2, ...) + Returns the email in differnet different ways (text level 4, image or text and image level 3, link level 2, ...) according to the priv_email field in the users table. To create an image the ImageMagick software is required, if ImageMagick is not present then the @ symbol in the email will be shown as an image. When creating an image you can choose the background color (In this format \#xxxxxx). Also you can make the background color transparent @@ -102,7 +102,7 @@ Returns the email of the user } { - return [db_string get_email { }] + return [db_string get_email {}] } @@ -173,16 +173,16 @@ -description "User email image" -creation_ip $creation_ip ] email_image::add_relation -user_id $user_id -item_id $item_id - db_dml update_cr_items { } - db_dml lob_content { } -blob_files [list ${dest_path}] - db_dml lob_size { } + content::item::set_live_revision -revision_id $revision_id + db_dml new_lob_content {} -blob_files [list ${dest_path}] + db_dml lob_size {} } # Delete the temporary file created by ImageMagick - catch { file delete $dest_path } errMsg + catch { file delete -- $dest_path } errMsg - set img_src [ad_quotehtml "/shared/email-image-bits.tcl?user_id=$user_id&revision_id=$revision_id"] - set send_email_url [ad_quotehtml "/shared/send-email?sendto=$user_id&return_url=$return_url"] + set img_src [ns_quotehtml "/shared/email-image-bits.tcl?user_id=$user_id&revision_id=$revision_id"] + set send_email_url [ns_quotehtml "/shared/send-email?sendto=$user_id&return_url=$return_url"] set email_image [subst {#acs-subsite.Email#} return "$email_image" @@ -250,9 +250,9 @@ set revision_id [content::revision::new -item_id $item_id -title $image_name \ -mime_type $mime_type \ -description "User email image" -creation_ip $creation_ip ] - db_dml update_cr_items { } - db_dml lob_content { } -blob_files [list ${dest_path}] - db_dml lob_size { } + content::item::set_live_revision -revision_id $revision_id + db_dml lob_content {} -blob_files [list ${dest_path}] + db_dml lob_size {} } } else { db_transaction { @@ -265,21 +265,21 @@ email_image::add_relation -user_id $user_id -item_id $item_id - db_dml update_cr_items { } - db_dml lob_content { } -blob_files [list ${dest_path}] - db_dml lob_size { } + db_dml update_cr_items {} + db_dml lob_content {} -blob_files [list ${dest_path}] + db_dml lob_size {} } } # Delete the temporary file created by ImageMagick - catch { file delete $dest_path } errMsg + catch { file delete -- $dest_path } errMsg } ad_proc -public email_image::get_folder_id { } { Returns the folder_id of the folder with the name "Email_Images" } { - return [db_string check_folder_name { } ] + return [db_string check_folder_name {} ] } ad_proc -public email_image::add_relation { @@ -290,7 +290,7 @@ @param item_id the item_id of the image in the content repository } { - db_exec_plsql add_relation { } + db_exec_plsql add_relation {} } ad_proc -public email_image::get_related_item_id { @@ -299,7 +299,7 @@ Returns the item_id of the email_image stored in the content repository for user_id. } { - return [db_string get_rel_item { } -default -1 ] + return [db_string get_rel_item {} -default -1 ] } @@ -318,3 +318,9 @@ rel_types::new email_image_rel "Email Image" "Email Images" user 0 1 content_item 0 1 } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: