fs::item_editable_info (public, deprecated)

 fs::item_editable_info -item_id item_id

Defined in packages/file-storage/tcl/file-storage-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Returns an array containing elements editable_p, mime_type, file_extension if an fs item is editable through the browser, editable_p is set to 1 DEPRECATED: it is unclear what editable is supposed to mean. As of 2023-03-16 file-storage does not offer inline editing and no package, including file-storage itself, appears to be using this api.

Switches:
-item_id
(required)
Returns:
Error:
Author:
Deds Castillo <deds@i-manila.com.ph>
Created:
2004-07-03
See Also:
  • nothing

Partial Call Graph (max 5 caller/called nodes):
%3 fs::item_editable_p fs::item_editable_p (public, deprecated) fs::item_editable_info fs::item_editable_info fs::item_editable_p->fs::item_editable_info ad_log_deprecated ad_log_deprecated (public) fs::item_editable_info->ad_log_deprecated content::item::get content::item::get (public) fs::item_editable_info->content::item::get db_string db_string (public) fs::item_editable_info->db_string

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc fs::item_editable_info
    # ideally, this would get values from parameters
    # hardcoding it for now
    set editable_mime_types [list "text/html" "text/plain"]

    content::item::get -item_id $item_id -array_name item_info
    set mime_info(mime_type) [set mime_type $item_info(mime_type)]
    set mime_info(file_extension) [db_string get_extension {
        select file_extension from cr_mime_types where mime_type = :mime_type
    }]

    if {[string tolower $mime_info(mime_type)] in $editable_mime_types} {
        set mime_info(editable_p) 1
    } else {
        set mime_info(editable_p) 0
    }
    return [array get mime_info]
Generic XQL file:
packages/file-storage/tcl/file-storage-procs.xql

PostgreSQL XQL file:
packages/file-storage/tcl/file-storage-procs-postgresql.xql

Oracle XQL file:
packages/file-storage/tcl/file-storage-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: