richtext-procs.tcl

Utilities to attach files to an object in the context of richtext editors.

Location:
packages/attachments/tcl/richtext-procs.tcl
Created:
15 Aug 2017
Author:
Gustaf Neumann, Antonio Pisano.

Procedures in this file

Detailed information

attachments::richtext::file_attach (public)

 attachments::richtext::file_attach [ -import_file import_file ] \
    [ -title title ] [ -mime_type mime_type ] [ -object_id object_id ] \
    [ -privilege privilege ] [ -user_id user_id ] \
    [ -peeraddr peeraddr ] [ -package_id package_id ]

Insert the provided file to the content repository as a new item and attach it to the specified object_id via the attachment API. This makes sure that the file will be deleted from the content repository, when the provided object_id is deleted. The user must have at least "read" privileges on the object, but other stronger privileges can be supplied via parameter.

Switches:
-import_file (optional)
-title (optional)
-mime_type (optional)
-object_id (optional)
-privilege (optional, defaults to "read")
-user_id (optional)
-peeraddr (optional)
-package_id (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 attachments::attach attachments::attach (public) attachments::richtext::require_root_folder attachments::richtext::require_root_folder (private) content::item::new content::item::new (public) permission::require_permission permission::require_permission (public) attachments::richtext::file_attach attachments::richtext::file_attach attachments::richtext::file_attach->attachments::attach attachments::richtext::file_attach->attachments::richtext::require_root_folder attachments::richtext::file_attach->content::item::new attachments::richtext::file_attach->permission::require_permission

Testcases:
No testcase defined.

attachments::richtext::require_root_folder (private)

 attachments::richtext::require_root_folder [ -parent_id parent_id ] \
    [ -name name ]

Helper function to find the root folder for ckfinder attachments.

Switches:
-parent_id (optional, defaults to "-100")
-name (optional, defaults to "attachments")

Partial Call Graph (max 5 caller/called nodes):
%3 attachments::richtext::file_attach attachments::richtext::file_attach (public) attachments::richtext::require_root_folder attachments::richtext::require_root_folder attachments::richtext::file_attach->attachments::richtext::require_root_folder content::item::get_id content::item::get_id (public) attachments::richtext::require_root_folder->content::item::get_id content::item::new content::item::new (public) attachments::richtext::require_root_folder->content::item::new

Testcases:
No testcase defined.
[ show source ]