do_comcode_attachments (line 33)
Get an array containing new comcode, and tempcode. The function wraps the normal comcode_to_tempcode function. The function will do attachment management, including deleting of attachments that have become unused due to editing of some comcode and removing of the reference.
array
do_comcode_attachments
(LONG_TEXT $original_comcode, ID_TEXT $type, ID_TEXT $id, [boolean $previewing_only = false], [?object $connection = NULL], [?boolean $insert_as_admin = NULL], [?MEMBER $for_member = NULL])
-
LONG_TEXT
$original_comcode: The unparsed comcode that references the attachments
-
ID_TEXT
$type: The type the attachment will be used for (e.g. download)
-
ID_TEXT
$id: The ID the attachment will be used for
-
boolean
$previewing_only: Whether we are only previewing the attachments (i.e. don't store them!)
-
?object
$connection: The database connection to use (NULL: standard site connection)
-
?boolean
$insert_as_admin: Whether to insert it as an admin (any comcode parsing will be carried out with admin privileges) (NULL: autodetect)
-
?MEMBER
$for_member: The member to use for ownership permissions (NULL: current member)
final_attachments_from_preview (line 436)
Finalise attachments which were created during a preview, so that they have the proper reference IDs.
void
final_attachments_from_preview
(ID_TEXT $id, [?object $connection = NULL])
-
ID_TEXT
$id: The id in the set of the arbitrary types that the attached is for
-
?object
$connection: The database connection to use (NULL: standard site connection)
insert_lang_comcode_attachments (line 400)
Insert some comcode content that may contain attachments, and return the language id.
integer
insert_lang_comcode_attachments
(integer $level, LONG_TEXT $text, ID_TEXT $type, ID_TEXT $id, [?object $connection = NULL], [boolean $insert_as_admin = false], [?MEMBER $for_member = NULL])
-
integer
$level: The level of importance this language string holds
-
LONG_TEXT
$text: The comcode content
-
ID_TEXT
$type: The arbitrary type that the attached is for (e.g. download)
-
ID_TEXT
$id: The id in the set of the arbitrary types that the attached is for
-
?object
$connection: The database connection to use (NULL: standard site connection)
-
boolean
$insert_as_admin: Whether to insert it as an admin (any comcode parsing will be carried out with admin privileges)
-
?MEMBER
$for_member: The member to use for ownership permissions (NULL: current member)
_check_attachment_count (line 352)
Check that not too many attachments have been uploaded for the member submitting.
void
_check_attachment_count
()