news::markdown_image::attach (private)
news::markdown_image::attach item_id drafts
Defined in packages/news/tcl/markdown-image-procs.tcl
Attach these images to the article item shared by its revisions.
- Parameters:
- item_id (required)
- drafts (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: dict for {image_id draft} $drafts { lassign $draft path mime set result [attachments::richtext::file_attach -item_id $image_id -object_id $item_id -import_file $path -mime_type $mime -title "Pasted image.[lindex [split $mime /] 1]" -user_id [ad_conn user_id] -peeraddr [ad_conn peeraddr] -package_id [ad_conn package_id]] if {![dict get $result success]} { error "Could not attach the pasted image." } ns_atclose [list ::news::markdown_image::discard_attached_draft $item_id $image_id $path] }XQL Not present: Generic, PostgreSQL, Oracle